steppy-dev 0.3.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (177) hide show
  1. steppy/CHANGELOG.md +862 -0
  2. steppy/__init__.py +9 -0
  3. steppy/__main__.py +13 -0
  4. steppy/_cli_common.py +183 -0
  5. steppy/_docker/Dockerfile.installed +53 -0
  6. steppy/_parallel/__init__.py +7 -0
  7. steppy/_parallel/compose.py +349 -0
  8. steppy/_parallel/event_bus.py +418 -0
  9. steppy/_parallel/failures.py +267 -0
  10. steppy/_parallel/fingerprint.py +141 -0
  11. steppy/_parallel/image.py +380 -0
  12. steppy/_parallel/lastfailed.py +125 -0
  13. steppy/_parallel/lifecycle.py +90 -0
  14. steppy/_parallel/preauth.py +109 -0
  15. steppy/_parallel/progress.py +101 -0
  16. steppy/_parallel/queue.py +385 -0
  17. steppy/_parallel/renderer.py +489 -0
  18. steppy/_parallel/retry.py +316 -0
  19. steppy/_player_bundle/THIRD_PARTY_LICENSES.txt +158 -0
  20. steppy/_player_bundle/__init__.py +100 -0
  21. steppy/_player_bundle/steppy-cursor-legacy.js +2 -0
  22. steppy/_player_bundle/steppy-cursor-legacy.js.map +1 -0
  23. steppy/_player_bundle/steppy-player.js +5419 -0
  24. steppy/_player_bundle/steppy-player.js.map +1 -0
  25. steppy/_player_bundle/steppy-video.js +472 -0
  26. steppy/_player_bundle/steppy-video.js.map +1 -0
  27. steppy/_templating.py +117 -0
  28. steppy/assertions.py +251 -0
  29. steppy/auth.py +493 -0
  30. steppy/build.py +2798 -0
  31. steppy/build_models.py +669 -0
  32. steppy/buildid.py +134 -0
  33. steppy/bundle/__init__.py +47 -0
  34. steppy/bundle/archive.py +239 -0
  35. steppy/bundle/classify.py +329 -0
  36. steppy/bundle/create.py +490 -0
  37. steppy/bundle/hashing.py +28 -0
  38. steppy/bundle/manifest.py +334 -0
  39. steppy/bundle/results.py +546 -0
  40. steppy/bundle_cli.py +455 -0
  41. steppy/captures.py +207 -0
  42. steppy/cli.py +2489 -0
  43. steppy/cloud/__init__.py +58 -0
  44. steppy/cloud/client.py +267 -0
  45. steppy/cloud/upload.py +497 -0
  46. steppy/compat.py +109 -0
  47. steppy/config.py +231 -0
  48. steppy/config_schema.py +87 -0
  49. steppy/contracts/__init__.py +54 -0
  50. steppy/contracts/bundle.py +215 -0
  51. steppy/contracts/report.py +346 -0
  52. steppy/contracts/tours.py +505 -0
  53. steppy/coordinator.py +1352 -0
  54. steppy/coverage/__init__.py +9 -0
  55. steppy/coverage/gaps.py +190 -0
  56. steppy/coverage/manifest.py +193 -0
  57. steppy/coverage/merge.py +363 -0
  58. steppy/coverage/normalize.py +174 -0
  59. steppy/coverage/report.py +178 -0
  60. steppy/coverage/sourcemap.py +219 -0
  61. steppy/coverage/store.py +473 -0
  62. steppy/coverage/triage.py +151 -0
  63. steppy/coverage_cli.py +265 -0
  64. steppy/durations.py +48 -0
  65. steppy/exclusive.py +178 -0
  66. steppy/flaky_cli.py +169 -0
  67. steppy/generator.py +633 -0
  68. steppy/guide.py +1467 -0
  69. steppy/history.py +352 -0
  70. steppy/init_cli.py +330 -0
  71. steppy/locales.py +282 -0
  72. steppy/migrate/__init__.py +35 -0
  73. steppy/migrate/apply.py +194 -0
  74. steppy/migrate/plan.py +199 -0
  75. steppy/migrate/rules.py +465 -0
  76. steppy/migrate/verify.py +163 -0
  77. steppy/migrate_cli.py +152 -0
  78. steppy/models.py +2539 -0
  79. steppy/naming.py +37 -0
  80. steppy/parser.py +475 -0
  81. steppy/pdf.py +193 -0
  82. steppy/presets.py +284 -0
  83. steppy/record_cli.py +796 -0
  84. steppy/report/__init__.py +37 -0
  85. steppy/report/assets.py +197 -0
  86. steppy/report/build.py +261 -0
  87. steppy/report/coverage_source.py +277 -0
  88. steppy/report/model.py +423 -0
  89. steppy/report/render.py +303 -0
  90. steppy/report/source.py +238 -0
  91. steppy/report_cli.py +173 -0
  92. steppy/runmeta.py +114 -0
  93. steppy/selection.py +183 -0
  94. steppy/sitemap.py +205 -0
  95. steppy/skills/steppy-app-tours/SKILL.md +448 -0
  96. steppy/skills/steppy-ci-report/SKILL.md +567 -0
  97. steppy/skills/steppy-scenario-author/SKILL.md +2176 -0
  98. steppy/skills/steppy-template/SKILL.md +676 -0
  99. steppy/templates/_steppy_events.py +291 -0
  100. steppy/templates/_steppy_tours.py +404 -0
  101. steppy/templates/angular/component-interactive.ts.j2 +109 -0
  102. steppy/templates/angular/component-video.ts.j2 +112 -0
  103. steppy/templates/angular/component.ts.j2 +229 -0
  104. steppy/templates/angular/content.ts.j2 +31 -0
  105. steppy/templates/angular/gitignore.j2 +3 -0
  106. steppy/templates/angular/group.component.ts.j2 +39 -0
  107. steppy/templates/angular/onboarding.component.ts.j2 +43 -0
  108. steppy/templates/angular/routes.ts.j2 +34 -0
  109. steppy/templates/ci/github-actions.yml +284 -0
  110. steppy/templates/ci/gitlab-ci.yml +178 -0
  111. steppy/templates/conftest.py.j2 +2405 -0
  112. steppy/templates/guide.book.html.j2 +145 -0
  113. steppy/templates/guide.fragment.html.j2 +257 -0
  114. steppy/templates/guide.html.j2 +301 -0
  115. steppy/templates/guide.md.j2 +18 -0
  116. steppy/templates/init/config.yaml +124 -0
  117. steppy/templates/init/credentials.yaml.example +30 -0
  118. steppy/templates/init/scenarios/example--first-flow.md +53 -0
  119. steppy/templates/report/_head.html.j2 +14 -0
  120. steppy/templates/report/_mark.html.j2 +3 -0
  121. steppy/templates/report/coverage.html.j2 +124 -0
  122. steppy/templates/report/index.html.j2 +203 -0
  123. steppy/templates/report/report.css +401 -0
  124. steppy/templates/report/scenario.html.j2 +137 -0
  125. steppy/templates/static/_headers.j2 +30 -0
  126. steppy/templates/static/_mode_links.html.j2 +22 -0
  127. steppy/templates/static/_seo_head.html.j2 +37 -0
  128. steppy/templates/static/cursor.js.j2 +10 -0
  129. steppy/templates/static/group.html.j2 +78 -0
  130. steppy/templates/static/guides.css +678 -0
  131. steppy/templates/static/index.html.j2 +79 -0
  132. steppy/templates/static/interactive.html.j2 +100 -0
  133. steppy/templates/static/onboarding.html.j2 +64 -0
  134. steppy/templates/static/page.html.j2 +145 -0
  135. steppy/templates/static/robots.txt.j2 +7 -0
  136. steppy/templates/static/video.html.j2 +135 -0
  137. steppy/templates/test_scenario.py.j2 +767 -0
  138. steppy/testids.py +166 -0
  139. steppy/totp.py +26 -0
  140. steppy/tour_spec.py +163 -0
  141. steppy/tours/__init__.py +22 -0
  142. steppy/tours/actions.py +402 -0
  143. steppy/tours/compiler.py +144 -0
  144. steppy/tours/diagnostics.py +137 -0
  145. steppy/tours/emit.py +239 -0
  146. steppy/tours/ids.py +40 -0
  147. steppy/tours/inference.py +399 -0
  148. steppy/tours/model.py +120 -0
  149. steppy/tours/paths.py +126 -0
  150. steppy/tours/pipeline.py +277 -0
  151. steppy/tours/publish.py +124 -0
  152. steppy/tours/replay.py +234 -0
  153. steppy/tours/routes.py +175 -0
  154. steppy/tours/settings.py +164 -0
  155. steppy/tours/text.py +237 -0
  156. steppy/tours_cli.py +219 -0
  157. steppy/tts/__init__.py +280 -0
  158. steppy/tts/cache.py +185 -0
  159. steppy/tts/presets.py +125 -0
  160. steppy/tts/providers/__init__.py +6 -0
  161. steppy/tts/providers/http.py +184 -0
  162. steppy/tts/providers/local.py +207 -0
  163. steppy/tts/providers/null.py +28 -0
  164. steppy/tts/registry.py +201 -0
  165. steppy/tts/track.py +158 -0
  166. steppy/tts/types.py +94 -0
  167. steppy/update_cli.py +460 -0
  168. steppy/video.py +730 -0
  169. steppy/video_cache.py +239 -0
  170. steppy/video_cli.py +271 -0
  171. steppy/worker.py +301 -0
  172. steppy_dev-0.3.0.dist-info/METADATA +1335 -0
  173. steppy_dev-0.3.0.dist-info/RECORD +177 -0
  174. steppy_dev-0.3.0.dist-info/WHEEL +4 -0
  175. steppy_dev-0.3.0.dist-info/entry_points.txt +2 -0
  176. steppy_dev-0.3.0.dist-info/licenses/LICENSE +202 -0
  177. steppy_dev-0.3.0.dist-info/licenses/NOTICE +13 -0
@@ -0,0 +1,178 @@
1
+ # Steppy CI pipeline — copy this to .gitlab-ci.yml in your project.
2
+ #
3
+ # Runs your Steppy scenarios on every push / merge request, and publishes a
4
+ # browsable run report as a job artifact.
5
+ #
6
+ # Prerequisites in your project:
7
+ # - config.yaml + scenarios/ committed
8
+ # - credentials provided via CI/CD variables (referenced as ${VAR} in
9
+ # config.yaml — e.g. STEPPY_ADMIN_USERNAME / STEPPY_ADMIN_PASSWORD). Mark
10
+ # them Masked, and Protected if they only belong on protected branches.
11
+ # - your app reachable from the runner (a `services:` entry, a prior job, or
12
+ # apps.<role>.url pointing at a deployed environment)
13
+
14
+ stages:
15
+ - test
16
+
17
+ variables:
18
+ # Keep pip's cache inside the project so `cache:` below can actually reach it.
19
+ PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
20
+
21
+ e2e:
22
+ stage: test
23
+ # The Playwright image already carries the browsers and their system
24
+ # dependencies, which is the slow half of `playwright install --with-deps`.
25
+ # Pin the tag to the Playwright version your steppy requires.
26
+ image: mcr.microsoft.com/playwright/python:v1.60.0-jammy
27
+ cache:
28
+ key:
29
+ files:
30
+ - pyproject.toml
31
+ paths:
32
+ - .cache/pip
33
+ script:
34
+ # Steppy is not on PyPI yet, so CI installs from git. Pin a tag rather than a
35
+ # branch: an e2e suite that silently changes its own tooling mid-week turns
36
+ # every unexplained failure into a two-hour bisect.
37
+ #
38
+ # The extras are what make `report.html` and `report.retries` /
39
+ # `steppy run --retries N` do anything — without them Steppy warns and skips
40
+ # those features rather than failing the run. `bundle` adds zstd compression.
41
+ - pip install 'steppy-dev[retry,report,bundle] @ git+https://github.com/Steppy-dev/steppy.git@v0.3.0'
42
+ # In-app tours (only with `tours.enabled: true`): fail fast when the tour files
43
+ # committed to the app no longer match the scenarios. It compares content for
44
+ # the build id each committed copy records, so a new commit alone never fails
45
+ # it. The app under test must be built with those files before the replays run.
46
+ # - steppy tours --check
47
+ - steppy generate
48
+ # --bundle records per-test and per-step events plus JUnit XML, which is what
49
+ # lets the report name the step a failure died in rather than only the test.
50
+ - steppy run --trace --bundle
51
+ after_script:
52
+ # after_script runs even when the run failed, which is exactly when the
53
+ # report matters. `steppy report` exits 0 either way — it describes
54
+ # rendering, not the run — so it never masks the job's real status.
55
+ - steppy report || true
56
+ artifacts:
57
+ when: always
58
+ expire_in: 30 days
59
+ paths:
60
+ - output/report/
61
+ - output/
62
+ reports:
63
+ # Set report.junit_xml in config.yaml, or use --bundle's fixed path, and
64
+ # GitLab renders per-test results in the merge request widget.
65
+ junit: output/junit/*/*.xml
66
+
67
+ # ── Publishing the report to GitLab Pages ─────────────────────────────────────
68
+ #
69
+ # GitLab Pages has one real advantage over GitHub's for this: it can be
70
+ # restricted to project members (Settings → Pages → "Access Control", or
71
+ # `pages.access_control` in gitlab.rb on self-managed). That makes publishing a
72
+ # run report viable for client work, which is not true on GitHub Pages.
73
+ #
74
+ # ⚠ Still read this first. Access control is a project setting, not something
75
+ # this file can guarantee — check it before the first deploy. A public Pages site
76
+ # publishes your screenshots permanently. `screenshot.mask` (config.yaml) can
77
+ # redact fields at capture time, and the report marks every page `noindex` and
78
+ # ships a robots.txt that disallows everything, but neither is a control you
79
+ # should rely on. `--screenshots failed` (the default) copies only the captures of
80
+ # variants that did not pass; `--screenshots all` puts every step of every locale
81
+ # and layout on whatever the site's audience turns out to be.
82
+ #
83
+ # GitLab Pages publishes whatever a job named `pages` leaves in `public/`.
84
+ #
85
+ # pages:
86
+ # stage: deploy
87
+ # image: alpine:latest
88
+ # needs:
89
+ # - job: e2e
90
+ # artifacts: true
91
+ # # Default branch only: a report from every merge request would publish work
92
+ # # in progress, and each deploy replaces the last.
93
+ # rules:
94
+ # - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
95
+ # when: always
96
+ # script:
97
+ # - mv output/report public
98
+ # artifacts:
99
+ # paths:
100
+ # - public
101
+ #
102
+ # A project has exactly ONE Pages site. If you also publish generated guides
103
+ # (`steppy build`), decide the tree before anything links to it — e.g. the report
104
+ # under public/report/ and the guides under public/guides/ — because moving the
105
+ # report later also moves badge.json, and that URL is a contract with every
106
+ # README that points at it.
107
+ #
108
+ # ── The e2e-surface coverage badge ────────────────────────────────────────────
109
+ #
110
+ # `steppy report` writes a shields endpoint at badge.json in the site root, so
111
+ # once the pages job above is live the badge is served at $CI_PAGES_URL/badge.json:
112
+ #
113
+ # ![e2e surface](https://img.shields.io/endpoint?url=https://<group>.gitlab.io/<project>/badge.json)
114
+ #
115
+ # Three prerequisites, in order — miss any one and there is no number:
116
+ #
117
+ # 1. badge.json is written ONLY when the run recorded coverage. Without
118
+ # `steppy run --coverage` the report has no coverage section and no badge
119
+ # file at all, and the shields URL 404s.
120
+ # 2. A percentage needs a DECLARED surface to score against, which means a
121
+ # `coverage:` block in config.yaml naming `coverage.apis[].openapi` (a URL
122
+ # the runner can reach) and optionally `coverage.sitemap`. With coverage
123
+ # recorded but nothing declared, the badge honestly reads `n/a` in grey
124
+ # rather than 0%.
125
+ # 3. `steppy coverage refresh` EXITS 1 when no `coverage:` block is configured,
126
+ # which is why these steps are not armed by default.
127
+ #
128
+ # Two things worth knowing before you turn it on:
129
+ #
130
+ # * Recording drives CDP precise coverage, which costs runtime — recording it
131
+ # on default-branch pipelines only is usually the right trade.
132
+ # * Declare `coverage.non_ui` in config.yaml (health checks, webhook receivers,
133
+ # OAuth callbacks, internal cron). Triage flags set with `steppy coverage
134
+ # triage` live in the gitignored .steppy/coverage.db, so a fresh CI checkout
135
+ # has none and every one of those endpoints counts against you.
136
+ #
137
+ # script:
138
+ # - steppy run --trace --bundle --coverage
139
+ # after_script:
140
+ # - steppy coverage refresh && steppy coverage report --json output/coverage/gaps.json || true
141
+ # - steppy report || true
142
+ #
143
+ # ── Results bundles ───────────────────────────────────────────────────────────
144
+ #
145
+ # Instead of (or alongside) a loose output/ tree, package the run into one
146
+ # portable, self-describing archive:
147
+ #
148
+ # after_script:
149
+ # - steppy bundle create || true
150
+ # artifacts:
151
+ # paths:
152
+ # - output/bundles/
153
+ #
154
+ # The archive holds output/ exactly as steppy wrote it, so `tar -xf` then
155
+ # `steppy report`, `steppy guide` or `steppy build` works unchanged on a
156
+ # downloaded artifact.
157
+ #
158
+ # ── Running in parallel ───────────────────────────────────────────────────────
159
+ #
160
+ # `steppy run --workers 4` needs a `parallel:` block + per-app internal_url in
161
+ # config.yaml, a docker-compose file with healthchecks, and Docker available to
162
+ # the runner (a docker:dind service, or a shell executor on a Docker host). Two
163
+ # things worth knowing about the output:
164
+ #
165
+ # * Failed scenarios are re-run once at reduced concurrency. One that then
166
+ # passes is reported as FLAKY and does NOT fail the pipeline — it lost a
167
+ # race, it is not broken. Pass --strict-flaky to change that, or
168
+ # --retry-pass 0 to turn the retry off.
169
+ # * If the app or auth is down, the run aborts after ~10 scenarios instead of
170
+ # burning the full wall clock on 300 identical failures.
171
+ #
172
+ # `steppy flaky` ranks repeat offenders across runs, which needs the history to
173
+ # survive between pipelines:
174
+ #
175
+ # cache:
176
+ # key: steppy-history
177
+ # paths:
178
+ # - .steppy/history.jsonl