This is a TestFlows example that demonstrates automated testing of a Super Mario Bros. game. The project includes a playable Super Mario Bros. game built with Pygame and automated tests that use a behavior model to test the game.
- Original game code: https://github.com/marblexu/PythonSuperMario
- Based on: https://github.com/justinmeister/Mario-Level-1
-
Testing Super Mario Using a Behavior Model (Part 1). Covers the game’s architecture and the setup of a comprehensive testing framework.
-
Testing Super Mario Using a Behavior Model (Part 2). Delves into the theory behind behavior models and its application in testing.
pip3 install -r requirements.txtpython3 main.py- use
LEFT/RIGHT/DOWNkey to control player - use key
ato jump - use key
sto shoot firewall or run
- Run basic movement tests without model:
python3 tests/run.py
- Run tests using the behavior model:
python3 tests/run.py --with-model
- Play manually without and with model:
python3 tests/run.py --manual [--with-model] [--play-seconds 30]
- Run autonomous play without and with model:
python3 tests/run.py --autonomous [--with-model] [--play-seconds 30]
- Load existing paths for autonomous play:
python3 tests/run.py --autonomous --load-paths [--save-paths] [--paths-file custom_paths.json]
- Save video during play:
python3 tests/run.py --save-video