flowstride 1.0.20 → 1.0.21
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.
- package/NATIVE_BROWSER.md +341 -0
- package/NATIVE_CI.md +3 -3
- package/README.md +3 -3
- package/dist/adapters/api/undici.d.ts +8 -0
- package/dist/adapters/api/undici.js +11 -0
- package/dist/adapters/web/playwright.d.ts +22 -2
- package/dist/adapters/web/playwright.js +233 -36
- package/dist/ci/config.js +14 -1
- package/dist/ci/distribution.d.ts +38 -0
- package/dist/ci/distribution.js +134 -0
- package/dist/ci/init.d.ts +4 -1
- package/dist/ci/init.js +13 -2
- package/dist/ci/runtime.js +24 -5
- package/dist/cli/commands/run.js +3 -0
- package/dist/cli/index.js +24 -5
- package/dist/manual/security.d.ts +2 -2
- package/dist/native/accessibility.d.ts +3 -0
- package/dist/native/accessibility.js +68 -0
- package/dist/native/assertions.d.ts +2 -0
- package/dist/native/assertions.js +140 -0
- package/dist/native/compatibility.d.ts +3 -0
- package/dist/native/compatibility.js +16 -0
- package/dist/native/components.d.ts +12 -0
- package/dist/native/components.js +122 -0
- package/dist/native/dashboard.d.ts +7 -0
- package/dist/native/dashboard.js +32 -0
- package/dist/native/events.d.ts +34 -0
- package/dist/native/events.js +281 -0
- package/dist/native/evidence.d.ts +3 -0
- package/dist/native/evidence.js +31 -0
- package/dist/native/functions.d.ts +9 -0
- package/dist/native/functions.js +103 -0
- package/dist/native/runtime.d.ts +14 -0
- package/dist/native/runtime.js +154 -0
- package/dist/native/validation.d.ts +107 -0
- package/dist/native/validation.js +84 -0
- package/dist/parser/lexer.js +15 -4
- package/dist/parser/parser.js +1 -1
- package/dist/runner/flow_orchestrator.d.ts +4 -0
- package/dist/runner/flow_orchestrator.js +22 -5
- package/dist/runner/flow_worker.d.ts +7 -0
- package/dist/runner/flow_worker.js +102 -3
- package/dist/types/index.d.ts +10 -0
- package/package.json +20 -9
- package/src/ui/dist/assets/index-DglsL_J2.js +636 -0
- package/src/ui/dist/index.html +1 -1
- package/src/ui/dist/assets/index-B7MuBTWm.js +0 -460
|
@@ -0,0 +1,341 @@
|
|
|
1
|
+
# Native browser workflows
|
|
2
|
+
|
|
3
|
+
OS and Cloud support these commands directly in `.flow` files. Existing commands, plugins and saved sessions continue to work. Use `flow.<area>.<action>` followed by a JSON object. Unknown actions and options fail explicitly.
|
|
4
|
+
|
|
5
|
+
Keep both engine installations current when using these features. If an installed Cloud engine lacks the required capability protocol, the public runner warns and uses OS fallback for the run. Existing commands can still use an older compatible Cloud engine; Cloud-only services require a compatible Cloud installation.
|
|
6
|
+
|
|
7
|
+
## Separate users in one test
|
|
8
|
+
|
|
9
|
+
A **profile** is an independent browser context: its cookies, local storage, session storage, pages and permissions are separate. The original profile is named `default`. Creating a profile selects it; switching profiles returns to the page that user was using.
|
|
10
|
+
|
|
11
|
+
```flow
|
|
12
|
+
flow.browser.create {
|
|
13
|
+
"name": "customer",
|
|
14
|
+
"options": {
|
|
15
|
+
"locale": "en-GB",
|
|
16
|
+
"colorScheme": "dark"
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
flow.open "/login";
|
|
20
|
+
flow.type input "Email" "{{env.CUSTOMER_EMAIL}}";
|
|
21
|
+
flow.type input "Password" "{{env.CUSTOMER_PASSWORD}}";
|
|
22
|
+
flow.click button "Sign in";
|
|
23
|
+
flow.browser.create {
|
|
24
|
+
"name": "admin"
|
|
25
|
+
};
|
|
26
|
+
flow.open "/admin/login";
|
|
27
|
+
flow.browser.use {
|
|
28
|
+
"name": "customer"
|
|
29
|
+
};
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
`flow.save session "customer" persist;` still saves a snapshot of the **currently selected** profile. `flow.use session "customer";` still injects a saved snapshot into the current profile. Saving a snapshot does not create another live user. Sequential customer/admin scenarios remain valid without profiles; use profiles when the users must stay independently logged in.
|
|
33
|
+
|
|
34
|
+
`flow.browser.close` closes a named profile. The `default` profile remains available until file completion. Profiles are reset between files. `flow.switchTo` still selects tabs within the current profile.
|
|
35
|
+
|
|
36
|
+
## Browser selection and settings
|
|
37
|
+
|
|
38
|
+
```sh
|
|
39
|
+
npx flowstride install chromium firefox webkit
|
|
40
|
+
npx flowstride run flows --browser firefox --ci
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
Use `--browser firefox` or `--browser webkit` to select the test engine. The terminal prints the verified engine and version after launch; the dashboard shows **Test browser**, and CI's `summary.json` includes the actual engine for each file. `install` downloads browser binaries and does not open a browser window.
|
|
44
|
+
|
|
45
|
+
Interactive runs display the dashboard in a separate Firefox or WebKit window when either engine is selected. The dashboard remains in the system default browser for Chromium runs. Test pages run headlessly by default; add `--headed` to see the application's own browser window:
|
|
46
|
+
|
|
47
|
+
```sh
|
|
48
|
+
npx flowstride run flows --browser firefox --headed
|
|
49
|
+
npx flowstride run flows --browser webkit --headed
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
CI forces headless execution and opens no dashboard. Firefox and WebKit keep their native user-agent unless you explicitly configure `browserOptions.userAgent`. WebKit is Safari's engine, rather than the installed Safari application.
|
|
53
|
+
|
|
54
|
+
Chromium remains the default. Browser installation must match the installed Flowstride package. In Linux CI, add `--with-deps` to the install command. Browser support does not mean every operating-system/browser/device combination is qualified. Firefox does not support Playwright's mobile emulation setting; phone profiles use its viewport/touch settings without that flag. Chromium-specific game touch and audio-file injection still require Chromium.
|
|
55
|
+
|
|
56
|
+
```json
|
|
57
|
+
{
|
|
58
|
+
"browser": "chromium",
|
|
59
|
+
"browserOptions": {
|
|
60
|
+
"locale": "en-GB",
|
|
61
|
+
"timezoneId": "Europe/London",
|
|
62
|
+
"colorScheme": "dark",
|
|
63
|
+
"permissions": ["geolocation"],
|
|
64
|
+
"geolocation": {
|
|
65
|
+
"latitude": 6.5244,
|
|
66
|
+
"longitude": 3.3792
|
|
67
|
+
},
|
|
68
|
+
"serviceWorkers": "block"
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Validated settings include viewport/screen, device scale, touch/mobile emulation, locale/timezone, color/contrast/motion, JavaScript, HTTPS handling, CSP bypass, permissions/geolocation, offline mode, headers, HTTP credentials, proxy, downloads, strict selectors, storage state and project-local client certificate paths. Use `browserOptions` for the default profile and `options` in `flow.browser.create` for a separate profile. Secrets belong in environment variables or private local files.
|
|
74
|
+
|
|
75
|
+
Runtime commands include `flow.browser.offline` with `value`, `flow.browser.permissions` with `permissions` and optional `origin`, `flow.browser.clearPermissions`, and `flow.browser.geolocation` with latitude/longitude. Recording paths are controlled by evidence settings, rather than arbitrary browser path options. JavaScript logger callbacks are not JSON DSL settings.
|
|
76
|
+
|
|
77
|
+
## Assertions that wait for a condition
|
|
78
|
+
|
|
79
|
+
```flow
|
|
80
|
+
flow.assert.that {
|
|
81
|
+
"selector": "#order-status",
|
|
82
|
+
"condition": "text",
|
|
83
|
+
"value": "Approved",
|
|
84
|
+
"timeout": 10000
|
|
85
|
+
};
|
|
86
|
+
flow.assert.that {
|
|
87
|
+
"role": "button",
|
|
88
|
+
"name": "Submit",
|
|
89
|
+
"condition": "enabled"
|
|
90
|
+
};
|
|
91
|
+
flow.assert.that {
|
|
92
|
+
"selector": ".loading",
|
|
93
|
+
"condition": "visible",
|
|
94
|
+
"not": true
|
|
95
|
+
};
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
Choose one CSS/Playwright `selector` or accessible `role` with an optional exact `name`. An optional `frame` selects an iframe. Conditions include:
|
|
99
|
+
|
|
100
|
+
| Conditions | Expected input |
|
|
101
|
+
| --- | --- |
|
|
102
|
+
| `visible`, `hidden`, `attached`, `enabled`, `disabled`, `editable`, `checked`, `empty`, `focused`, `inViewport` | No value |
|
|
103
|
+
| `text`, `containsText`, `value`, `id`, `accessibleName`, `accessibleDescription` | `value`, or `matches` and optional regex `flags` |
|
|
104
|
+
| `values` | Array of selected option values |
|
|
105
|
+
| `count` | Nonnegative integer `value` |
|
|
106
|
+
| `attribute` | `attribute`; optional expected `value`; omit it to check presence |
|
|
107
|
+
| `css`, `property` | `property` and expected `value` |
|
|
108
|
+
| `url`, `title` | Expected `value` or regex `matches`; no selector needed |
|
|
109
|
+
| `localStorage`, `sessionStorage` | `key` and expected string `value`, or `null` for absence |
|
|
110
|
+
|
|
111
|
+
Text comparisons normalize whitespace. Assertions retry until `timeout` or the configured default; they do not repeatedly click or repeat requests. Existing `flow.expect` syntax remains supported.
|
|
112
|
+
|
|
113
|
+
## Mock requests and wait for network events
|
|
114
|
+
|
|
115
|
+
Use `serviceWorkers: "block"` when mocking an application that registers service workers. Mocking applies to browser traffic in the current profile; it does not intercept `flow.get` or other direct API commands.
|
|
116
|
+
|
|
117
|
+
```flow
|
|
118
|
+
flow.network.route {
|
|
119
|
+
"name": "customer-response",
|
|
120
|
+
"url": "**/api/customer",
|
|
121
|
+
"method": "GET",
|
|
122
|
+
"json": {
|
|
123
|
+
"name": "Documentation Reader"
|
|
124
|
+
},
|
|
125
|
+
"times": 1
|
|
126
|
+
};
|
|
127
|
+
flow.network.arm {
|
|
128
|
+
"name": "customer-request",
|
|
129
|
+
"url": "**/api/customer",
|
|
130
|
+
"kind": "response"
|
|
131
|
+
};
|
|
132
|
+
flow.click button "Load customer";
|
|
133
|
+
flow.network.wait {
|
|
134
|
+
"name": "customer-request"
|
|
135
|
+
};
|
|
136
|
+
flow.network.expect {
|
|
137
|
+
"name": "customer-request",
|
|
138
|
+
"status": 200,
|
|
139
|
+
"path": "name",
|
|
140
|
+
"equals": "Documentation Reader"
|
|
141
|
+
};
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
**Arm before the trigger, then wait.** This captures fast responses and prevents an unobserved timeout while a click is still finishing. Waiters are cleaned up on retry, file completion and shutdown.
|
|
145
|
+
|
|
146
|
+
Routes accept one of `json`, text `body`, or a project-local `fixture`. Optional `status`, `headers`, `contentType`, `method` and positive `times` control the response. URL patterns support `*` within a path segment and `**` across segments.
|
|
147
|
+
|
|
148
|
+
| Route `mode` | Behavior |
|
|
149
|
+
| --- | --- |
|
|
150
|
+
| `fulfill` (default) | Supply the configured response |
|
|
151
|
+
| `abort` | Block the matching request |
|
|
152
|
+
| `continue` | Send the real request; optional `request` changes URL, method, headers or body |
|
|
153
|
+
| `patch` | Fetch the real response and merge configured JSON fields or replace its text body |
|
|
154
|
+
|
|
155
|
+
Remove a route with `flow.network.unroute` and its `name`. Rules and captured events belong to the selected profile. `network.arm` also supports `kind: "request"`, a method, response status filter and timeout. `network.expect` checks status/method and captured body paths or a response/request `header`, using `equals` or `contains`.
|
|
156
|
+
|
|
157
|
+
## Downloads
|
|
158
|
+
|
|
159
|
+
```flow
|
|
160
|
+
flow.download.arm {
|
|
161
|
+
"name": "invoice"
|
|
162
|
+
};
|
|
163
|
+
flow.click link "Download invoice";
|
|
164
|
+
flow.download.save {
|
|
165
|
+
"name": "invoice",
|
|
166
|
+
"file": "downloads/invoice.json"
|
|
167
|
+
};
|
|
168
|
+
flow.download.expect {
|
|
169
|
+
"name": "invoice",
|
|
170
|
+
"filename": "invoice.json",
|
|
171
|
+
"minSize": 1,
|
|
172
|
+
"json": {
|
|
173
|
+
"paid": true
|
|
174
|
+
}
|
|
175
|
+
};
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
The destination must stay inside the project and must not already exist. Assertions support the suggested `filename`, exact `size`, `minSize`, text `contains`, exact `json`, and a SHA-256 `sha256`. Content assertions have a size limit; use size/hash checks for larger downloads. Downloads do not need a custom plugin.
|
|
179
|
+
|
|
180
|
+
## Control time and observe functions
|
|
181
|
+
|
|
182
|
+
```flow
|
|
183
|
+
flow.clock.install {
|
|
184
|
+
"time": "2026-01-01T00:00:00Z"
|
|
185
|
+
};
|
|
186
|
+
flow.open "/timer";
|
|
187
|
+
flow.clock.runFor {
|
|
188
|
+
"milliseconds": 5000
|
|
189
|
+
};
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
Clock commands include `pauseAt`, `resume`, `runFor`, `fastForward`, `setFixedTime` and `setSystemTime`. Date operations accept `time`; advancing accepts `milliseconds`. Install the clock before the application installs its timers. Time control affects the browser page, not the backend or operating-system clock.
|
|
193
|
+
|
|
194
|
+
```flow
|
|
195
|
+
flow.stub.install {
|
|
196
|
+
"name": "analytics",
|
|
197
|
+
"target": "analytics.track",
|
|
198
|
+
"mode": "spy"
|
|
199
|
+
};
|
|
200
|
+
flow.click button "Purchase";
|
|
201
|
+
flow.stub.expect {
|
|
202
|
+
"name": "analytics",
|
|
203
|
+
"count": 1,
|
|
204
|
+
"args": ["purchase"]
|
|
205
|
+
};
|
|
206
|
+
flow.stub.restore {
|
|
207
|
+
"name": "analytics"
|
|
208
|
+
};
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
A spy records calls and invokes the original function. Modes `return` and `throw` replace it with a configured `value` or `error`; `async: true` returns a promise. `beforeLoad: true` installs on the next document, for functions available before application initialization. It cannot replace a function that does not yet exist. `stub.expect` accepts `count`, `minCount`, arguments and timeout. Doubles belong to a page and are restored on cleanup.
|
|
212
|
+
|
|
213
|
+
## Traces, HAR and DOM evidence
|
|
214
|
+
|
|
215
|
+
```json
|
|
216
|
+
{
|
|
217
|
+
"trace": true,
|
|
218
|
+
"har": true,
|
|
219
|
+
"domSnapshots": true,
|
|
220
|
+
"browserOptions": {
|
|
221
|
+
"serviceWorkers": "block"
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
Trace ZIPs include browser actions, DOM snapshots and screenshots. HAR files capture HTTP requests and responses and finalize when their browser context closes. Evidence files include flow/profile names; retries retain earlier attempt videos/traces. A trace records browser operations; Flowstride assertion results and attempts are in `summary.json`.
|
|
227
|
+
|
|
228
|
+
Use `flow.trace.start` (optional `name`) and `flow.trace.stop` for an explicitly bounded trace instead of automatic `trace: true`. Open a local ZIP with:
|
|
229
|
+
|
|
230
|
+
```sh
|
|
231
|
+
npx flowstride trace flowstride-artifacts/example-trace.zip
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
HAR replay uses a local recorded file:
|
|
235
|
+
|
|
236
|
+
```flow
|
|
237
|
+
flow.har.replay {
|
|
238
|
+
"file": "fixtures/customer.har",
|
|
239
|
+
"notFound": "abort"
|
|
240
|
+
};
|
|
241
|
+
flow.open "/customer";
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
An optional `url` limits matching; `notFound: "fallback"` allows unmatched real requests. Replay does not restore application databases or a WebSocket session.
|
|
245
|
+
|
|
246
|
+
The dashboard preserves each step's profile and attempt, lets you choose earlier attempt screenshots, and links to optional DOM snapshots. DOM files are served as inert text. They do not rewind the live application or execute an earlier page.
|
|
247
|
+
|
|
248
|
+
Traces, HAR, downloaded files and DOM/accessibility snapshots can contain application secrets or personal data. They remain local artifacts; these new formats are not automatically uploaded to Cloud. Choose private CI artifacts and an appropriate retention period.
|
|
249
|
+
|
|
250
|
+
## Accessibility and ARIA baselines
|
|
251
|
+
|
|
252
|
+
```flow
|
|
253
|
+
flow.a11y.scan {
|
|
254
|
+
"name": "checkout",
|
|
255
|
+
"include": ["main"],
|
|
256
|
+
"tags": ["wcag2a", "wcag2aa"]
|
|
257
|
+
};
|
|
258
|
+
flow.a11y.snapshot {
|
|
259
|
+
"name": "checkout",
|
|
260
|
+
"selector": "main",
|
|
261
|
+
"baseline": "baselines/checkout.aria.yml"
|
|
262
|
+
};
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
Scans use axe, write a structured report, and fail on violations by default. Options include `exclude`, explicit `rules`, `disableRules`, selected `impacts`, and `maxViolations`. Automated scans cover only part of accessibility; keyboard and assistive-technology review remain necessary.
|
|
266
|
+
|
|
267
|
+
Snapshots compare the complete selected accessibility tree with a reviewed YAML baseline. `flow.a11y.match` compares an inline `yaml` string with the complete captured tree and retries until timeout. These are exact tree comparisons, not Playwright Test's partial snapshot matcher.
|
|
268
|
+
|
|
269
|
+
Create or deliberately update a baseline locally with `--update-baselines`; the snapshot command must specify `baseline`. CI refuses updates. Review baseline changes before accepting them. To capture evidence without comparing or writing a baseline, omit `baseline`.
|
|
270
|
+
|
|
271
|
+
## Component tests
|
|
272
|
+
|
|
273
|
+
Flowstride starts and cleans up a local Vite harness. Keep your normal application framework packages installed in the project. Supported integrations are vanilla JavaScript factories, React components and Vue single-file components. Other frameworks need a dedicated integration and qualification.
|
|
274
|
+
|
|
275
|
+
```flow
|
|
276
|
+
flow.component.mount {
|
|
277
|
+
"framework": "react",
|
|
278
|
+
"module": "src/components/AccountButton.tsx",
|
|
279
|
+
"export": "default",
|
|
280
|
+
"props": {
|
|
281
|
+
"label": "Open account"
|
|
282
|
+
}
|
|
283
|
+
};
|
|
284
|
+
flow.click button "Open account";
|
|
285
|
+
flow.assert.that {
|
|
286
|
+
"selector": "button",
|
|
287
|
+
"condition": "text",
|
|
288
|
+
"value": "Account opened"
|
|
289
|
+
};
|
|
290
|
+
flow.component.update {
|
|
291
|
+
"props": {
|
|
292
|
+
"label": "Updated account"
|
|
293
|
+
}
|
|
294
|
+
};
|
|
295
|
+
flow.component.unmount {};
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
An optional `css` array imports project styles. Supply required application providers through a small test component wrapper. The harness does not load your application Vite configuration, framework router, backend or production build automatically. Vanilla exports receive `(target, props)` and can return a DOM node or an object with `unmount()`.
|
|
299
|
+
|
|
300
|
+
## Scenario retries and flaky outcomes
|
|
301
|
+
|
|
302
|
+
```json
|
|
303
|
+
{
|
|
304
|
+
"retries": 1,
|
|
305
|
+
"failOnFlaky": true
|
|
306
|
+
}
|
|
307
|
+
```
|
|
308
|
+
|
|
309
|
+
Retries are disabled by default. A retry reruns the entire failed scenario, restores its starting browser profiles/storage and local variables, and retains previous attempt diagnostics. A later pass is marked `flaky`; `failOnFlaky` turns it into a failing CI outcome. Bail takes effect after the final failed attempt.
|
|
310
|
+
|
|
311
|
+
Retries cannot undo backend writes, emails, payments, persistent files, or other external effects. Use idempotent test data and explicit application fixtures. Keep retries low while investigating unstable tests.
|
|
312
|
+
|
|
313
|
+
## Browser matrices and multiple CI machines
|
|
314
|
+
|
|
315
|
+
```sh
|
|
316
|
+
npx flowstride ci init github --browsers chromium,firefox,webkit --shards 3
|
|
317
|
+
```
|
|
318
|
+
|
|
319
|
+
The generated workflow creates separate CI jobs with unique evidence names. It uses normal CI runners. Review project dependency/secrets setup as usual. Cancellation stops that job and records an interrupted result; it does not delete other machines' evidence.
|
|
320
|
+
|
|
321
|
+
```sh
|
|
322
|
+
npx flowstride run flows --ci --shard 1/3
|
|
323
|
+
npx flowstride run flows --ci --shard 2/3
|
|
324
|
+
npx flowstride run flows --ci --shard 3/3
|
|
325
|
+
```
|
|
326
|
+
|
|
327
|
+
Run each command on its assigned machine. Preserve its `summary.json` beside its `run-*` evidence folder. Collect all shards for **one browser configuration** into separate project directories and merge:
|
|
328
|
+
|
|
329
|
+
```sh
|
|
330
|
+
npx flowstride merge shard-1/summary.json shard-2/summary.json shard-3/summary.json
|
|
331
|
+
```
|
|
332
|
+
|
|
333
|
+
Merging rejects missing/duplicate shards, mixed source suites and mixed browser configurations. A failed or interrupted shard cannot become a passing merge. Setup `.first.flow` files execute independently on every machine, so setup must be safe to repeat. Metrics count actual shard executions, including repeated setup work.
|
|
334
|
+
|
|
335
|
+
For later runs, use `--shard-history path/to/timings.json` from a previous complete merge. Every machine must use the same file: history assigns longer files first while preserving deterministic, disjoint standard-file coverage. There is no hosted scheduling service or shared in-memory state between machines.
|
|
336
|
+
|
|
337
|
+
## Browser compatibility notes
|
|
338
|
+
|
|
339
|
+
Chromium's current stealth behavior can override an explicitly requested locale. Use Firefox or WebKit for locale-sensitive checks and verify the observed language. For HAR playback in Firefox/WebKit, leave forced browser-offline mode unset and stop the real server to verify the recording; combining forced offline mode and HAR can reject navigation before fulfillment.
|
|
340
|
+
|
|
341
|
+
The maintained command reference, browser compatibility guide and API-to-UI examples are available in the [Flowstride documentation](https://docs.flowstride.io/guide/native-browser-workflows).
|
package/NATIVE_CI.md
CHANGED
|
@@ -12,9 +12,9 @@ npx flowstride install
|
|
|
12
12
|
npx flowstride run flows --ci
|
|
13
13
|
```
|
|
14
14
|
|
|
15
|
-
In CI, use `npm ci` before browser installation and test execution. Browser installation uses the Chromium version matching the installed Flowstride engine. Linux runners may require system browser dependencies; the generated GitHub workflow handles installation for its runner.
|
|
15
|
+
In CI, use `npm ci` before browser installation and test execution. Browser installation uses the Chromium version matching the installed Flowstride engine by default. See [native browser workflows](NATIVE_BROWSER.md) for Firefox, WebKit and browser configuration. Linux runners may require system browser dependencies; the generated GitHub workflow handles installation for its runner.
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
Cloud users authenticate using `npx flowstride login`. In CI, supply the developer token through the `FLOWSTRIDE_TOKEN` secret, never in committed files. Install project dependencies before login, then install the matching browser and run the tests. The OS CLI uses compatible, authorized Cloud engine installations and falls back to OS when the Cloud engine is unavailable.
|
|
18
18
|
|
|
19
19
|
Generate a GitHub Actions workflow explicitly:
|
|
20
20
|
|
|
@@ -32,7 +32,7 @@ Malformed configuration and unsafe output paths fail before execution. Configura
|
|
|
32
32
|
|
|
33
33
|
Native CI is selected by `--ci` or a recognized CI environment. It runs headlessly without a dashboard server and returns nonzero for failed, incomplete, crashed or interrupted execution. JSON and JUnit reports are written at the configured artifact root, which defaults to `flowstride-artifacts`. Media and attachments use a unique run directory referenced by the summary.
|
|
34
34
|
|
|
35
|
-
Flow discovery is recursive. `.first.flow` files run before ordinary files. A failed scenario leaves its remaining steps untested and execution continues to later scenarios. `--bail` stops later work;
|
|
35
|
+
Flow discovery is recursive. `.first.flow` files run before ordinary files. A failed scenario leaves its remaining steps untested and execution continues to later scenarios. `--bail` stops later work; the Cloud engine executes bail runs sequentially.
|
|
36
36
|
|
|
37
37
|
An optional configured local web server is started and stopped with the run. Flowstride rejects a readiness URL that is already serving.
|
|
38
38
|
|
package/README.md
CHANGED
|
@@ -67,15 +67,15 @@ For visual manual test design and execution:
|
|
|
67
67
|
npx flowstride manual
|
|
68
68
|
```
|
|
69
69
|
|
|
70
|
-
## Flowstride
|
|
70
|
+
## Flowstride Cloud
|
|
71
71
|
|
|
72
|
-
|
|
72
|
+
Flowstride Cloud users authenticate through the private installation channel:
|
|
73
73
|
|
|
74
74
|
```sh
|
|
75
75
|
npx flowstride login
|
|
76
76
|
```
|
|
77
77
|
|
|
78
|
-
The OS CLI selects a compatible, authorized
|
|
78
|
+
The OS CLI selects a compatible, authorized Cloud engine when available and falls back to OS when the Cloud engine cannot be used. The Cloud engine is distributed privately.
|
|
79
79
|
|
|
80
80
|
## Test data and artifacts
|
|
81
81
|
|
|
@@ -17,6 +17,14 @@ export declare class ApiAdapter {
|
|
|
17
17
|
setGlobalHeader(name: string, value: string): void;
|
|
18
18
|
setUnauthorizedHandler(handler: () => Promise<void>): void;
|
|
19
19
|
getState(): ApiState;
|
|
20
|
+
checkpointState(): {
|
|
21
|
+
globalHeaders: Record<string, string>;
|
|
22
|
+
status: number | null;
|
|
23
|
+
body: any;
|
|
24
|
+
headers: Record<string, string | string[] | undefined> | null;
|
|
25
|
+
responseTime: number;
|
|
26
|
+
};
|
|
27
|
+
restoreState(snapshot: ReturnType<ApiAdapter['checkpointState']>): void;
|
|
20
28
|
resetState(): void;
|
|
21
29
|
get(path: string, headers?: {
|
|
22
30
|
key: string;
|
|
@@ -30,6 +30,17 @@ class ApiAdapter {
|
|
|
30
30
|
responseTime: this.lastResponseTime,
|
|
31
31
|
};
|
|
32
32
|
}
|
|
33
|
+
checkpointState() {
|
|
34
|
+
return structuredClone({ globalHeaders: this.globalHeaders, status: this.lastStatus, body: this.lastBody, headers: this.lastHeaders, responseTime: this.lastResponseTime });
|
|
35
|
+
}
|
|
36
|
+
restoreState(snapshot) {
|
|
37
|
+
const data = structuredClone(snapshot);
|
|
38
|
+
this.globalHeaders = data.globalHeaders;
|
|
39
|
+
this.lastStatus = data.status;
|
|
40
|
+
this.lastBody = data.body;
|
|
41
|
+
this.lastHeaders = data.headers;
|
|
42
|
+
this.lastResponseTime = data.responseTime;
|
|
43
|
+
}
|
|
33
44
|
resetState() {
|
|
34
45
|
this.lastStatus = null;
|
|
35
46
|
this.lastBody = null;
|
|
@@ -1,17 +1,37 @@
|
|
|
1
|
-
import { Page } from "playwright";
|
|
1
|
+
import { BrowserContext, Page } from "playwright";
|
|
2
2
|
import { FlowstrideConfig } from "../../types";
|
|
3
3
|
export declare class WebAdapter {
|
|
4
4
|
private config;
|
|
5
|
+
activeProfile: string;
|
|
6
|
+
private profiles;
|
|
7
|
+
private contextOptions;
|
|
8
|
+
onPageChanged?: () => Promise<void>;
|
|
9
|
+
profileNames(): string[];
|
|
10
|
+
getContext(): BrowserContext;
|
|
11
|
+
createProfile(profileName: string, options?: unknown): Promise<void>;
|
|
12
|
+
useProfile(profileName: string): Promise<void>;
|
|
13
|
+
closeProfile(profileName: string): Promise<void>;
|
|
14
|
+
beginTrace(profileName?: string, file?: string): Promise<void>;
|
|
15
|
+
endTrace(profileName?: string): Promise<string>;
|
|
16
|
+
private finishProfile;
|
|
17
|
+
checkpointProfiles(): Promise<any>;
|
|
18
|
+
restoreProfiles(snapshot: any): Promise<void>;
|
|
5
19
|
pageErrors: string[];
|
|
6
20
|
private browser;
|
|
7
21
|
private context;
|
|
8
22
|
private page;
|
|
9
23
|
private discoveredPages;
|
|
10
24
|
private dialogHandler;
|
|
11
|
-
private
|
|
25
|
+
private sessionStorageRestores;
|
|
26
|
+
private get pendingSessionStorageRestore();
|
|
12
27
|
private clearSessionStorageRestore;
|
|
13
28
|
constructor(config: FlowstrideConfig);
|
|
14
29
|
getPage(): Page;
|
|
30
|
+
getBrowserInfo(): {
|
|
31
|
+
engine: string;
|
|
32
|
+
version: string;
|
|
33
|
+
headless: boolean;
|
|
34
|
+
};
|
|
15
35
|
initialise(audioInjectionPath?: string): Promise<void>;
|
|
16
36
|
acceptDialog(): Promise<void>;
|
|
17
37
|
rejectDialog(): Promise<void>;
|