Checkora uses Django's testing framework along with Selenium-based integration tests.
Current test locations:
game/tests.pygame/test_analysis.pygame/selenium_tests/test_boards.pygame/selenium_tests/test_navigation.py
python manage.py testRuns the complete test suite.
python manage.py test gameRuns all tests inside the game application.
python manage.py test game.tests
python manage.py test game.test_analysispython manage.py test game.tests.ClassNamepython manage.py test game.tests.ClassName.test_method_namepython manage.py test --verbosity=2Provides detailed debugging information.
game/selenium_tests/test_boards.pygame/selenium_tests/test_navigation.py
Before running Selenium tests:
- Install project dependencies
- Install Selenium
- Use a supported browser
- Ensure browser driver versions match the installed browser
python manage.py test game.selenium_testsEnsure your browser driver version matches your installed browser.
Check whether page elements or selectors have changed.
Prefer explicit waits instead of fixed delays.
Add tests when:
- Introducing a new feature
- Fixing a bug
- Modifying game logic
- Updating analysis functionality
- Changing APIs, views, or models
Use descriptive names:
def test_player_can_start_new_game():
pass- Keep tests independent
- Test one behavior at a time
- Use clear assertions
- Use descriptive test names
- Avoid unnecessary delays in Selenium tests
Before opening a PR:
- Run all relevant tests
- Verify functionality manually
- Add tests for new features when appropriate
- Ensure existing tests continue to pass
- Update documentation if required