Chapter 04 — Framework internal tests

Chapter 04 — Framework internal tests#

How Ocarina tests itself. Five test families, a clear-eyed coverage policy, an Allure report archived on GitHub Pages.

Outline#

#FileTopic
0101-strategy.mdFrom the outside like a user” strategy + the conftest.py (FakeDriver, RecordingPOM, builders).
0202-cram-prysk.mdCram tests (prysk): .t files
0303-pytest-scenarios.mdTest scenarios applied to the framework (pytest + allure + hypothesis).
0404-mypy-plugins-types.mdTests on static typing via pytest-mypy-plugins (*.yml).
0505-syrupy-snapshots.mdSnapshot tests (syrupy) for pretty_print_results and results_to_json.
0606-hypothesis-properties.mdProperty-based testing for invariants.
0707-coverage-policy.mdCoverage policy: what’s tested, what is NOT, why.
0808-allure-history.mdAllure + composite action allure-history + GH Pages deploy.

Summary table#

FamilyToolQuantityTopicTarget
Scenariospytest + allure-pytest~15 test_*.py filesDSL, orchestration, Playwright actorCovers behavior
Cramprysk15 .t filesSelenium + Playwright CLI: parsing, validations, defaultsCovers CLI user surface
Static typespytest-mypy-plugins~5 *test_types.yml filesType inferences, narrowing, expected errorsCovers typing
Snapshotssyrupy2 .ambr filesOutput of pretty_print_results, results_to_jsonCovers output format
Property-basedhypothesis1 file (test_invariants_properties.py)Behavior on random valuesCovers robustness to inputs

Approach#

In conftest.py: