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#
| # | File | Topic |
|---|---|---|
| 01 | 01-strategy.md | “From the outside like a user” strategy + the conftest.py (FakeDriver, RecordingPOM, builders). |
| 02 | 02-cram-prysk.md | Cram tests (prysk): .t files |
| 03 | 03-pytest-scenarios.md | Test scenarios applied to the framework (pytest + allure + hypothesis). |
| 04 | 04-mypy-plugins-types.md | Tests on static typing via pytest-mypy-plugins (*.yml). |
| 05 | 05-syrupy-snapshots.md | Snapshot tests (syrupy) for pretty_print_results and results_to_json. |
| 06 | 06-hypothesis-properties.md | Property-based testing for invariants. |
| 07 | 07-coverage-policy.md | Coverage policy: what’s tested, what is NOT, why. |
| 08 | 08-allure-history.md | Allure + composite action allure-history + GH Pages deploy. |
Summary table#
| Family | Tool | Quantity | Topic | Target |
|---|---|---|---|---|
| Scenarios | pytest + allure-pytest | ~15 test_*.py files | DSL, orchestration, Playwright actor | Covers behavior |
| Cram | prysk | 15 .t files | Selenium + Playwright CLI: parsing, validations, defaults | Covers CLI user surface |
| Static types | pytest-mypy-plugins | ~5 *test_types.yml files | Type inferences, narrowing, expected errors | Covers typing |
| Snapshots | syrupy | 2 .ambr files | Output of pretty_print_results, results_to_json | Covers output format |
| Property-based | hypothesis | 1 file (test_invariants_properties.py) | Behavior on random values | Covers robustness to inputs |
Approach#
In conftest.py: