Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

README.md

🍄 Testing Super Mario Bros. Using a Behavior Model

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.

👨‍💻 Credits

📚 References

📋 Prerequisites

pip3 install -r requirements.txt

🎮 Running the game

python3 main.py

🕹️ How to play

  • use LEFT/RIGHT/DOWN key to control player
  • use key a to jump
  • use key s to shoot firewall or run

🧪 Running the tests

🎯 Classical Tests (Default)

  • Run basic movement tests without model:
    python3 tests/run.py

🤖 Tests with Model

  • Run tests using the behavior model:
    python3 tests/run.py --with-model

🎮 Manual Play

  • Play manually without and with model:
    python3 tests/run.py --manual [--with-model] [--play-seconds 30]

🤖 Autonomous Play

  • Run autonomous play without and with model:
    python3 tests/run.py --autonomous [--with-model] [--play-seconds 30]

📁 Path Management

  • Load existing paths for autonomous play:
    python3 tests/run.py --autonomous --load-paths [--save-paths] [--paths-file custom_paths.json]

⚙️ Advanced Options

  • Save video during play:
    python3 tests/run.py --save-video