flowstride 1.0.20-rc.2 → 1.0.20

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 (43) hide show
  1. package/NATIVE_CI.md +88 -145
  2. package/README.md +46 -221
  3. package/dist/adapters/web/playwright.d.ts +4 -1
  4. package/dist/adapters/web/playwright.js +75 -6
  5. package/dist/ci/config.js +6 -5
  6. package/dist/ci/runtime.js +27 -14
  7. package/dist/cli/commands/run.js +2 -1
  8. package/dist/cli/index.js +35 -50
  9. package/dist/cli/manual_server/workspace_server.js +44 -32
  10. package/dist/cli/utils/cloudSession.d.ts +7 -0
  11. package/dist/cli/utils/cloudSession.js +37 -0
  12. package/dist/cli/utils/proInstaller.d.ts +5 -0
  13. package/dist/cli/utils/proInstaller.js +141 -0
  14. package/dist/game/sdk.js +3 -2
  15. package/dist/index.d.ts +5 -0
  16. package/dist/index.js +9 -0
  17. package/dist/manual/security.d.ts +183 -0
  18. package/dist/manual/security.js +106 -0
  19. package/dist/runner/data_generators.d.ts +1 -0
  20. package/dist/runner/data_generators.js +3 -0
  21. package/dist/runner/dom_stripper.js +3 -0
  22. package/dist/runner/flow_orchestrator.js +13 -22
  23. package/dist/runner/flow_worker.d.ts +1 -0
  24. package/dist/runner/flow_worker.js +68 -47
  25. package/dist/runner/persistent_vault.js +2 -1
  26. package/dist/runner/plugin_manager.js +3 -1
  27. package/dist/security/localDashboard.d.ts +2 -0
  28. package/dist/security/localDashboard.js +22 -0
  29. package/dist/security/redaction.d.ts +4 -0
  30. package/dist/security/redaction.js +51 -0
  31. package/dist/sessions/manager.js +3 -1
  32. package/dist/types/index.d.ts +9 -0
  33. package/dist/utils/cloud.d.ts +6 -0
  34. package/dist/utils/cloud.js +33 -0
  35. package/dist/utils/projectPaths.d.ts +11 -0
  36. package/dist/utils/projectPaths.js +90 -0
  37. package/dist/utils/replayRequest.d.ts +8 -0
  38. package/dist/utils/replayRequest.js +77 -0
  39. package/package.json +23 -14
  40. package/src/ui/dist/assets/index-B7MuBTWm.js +460 -0
  41. package/src/ui/dist/index.html +1 -1
  42. package/RELEASE_NOTES.md +0 -40
  43. package/src/ui/dist/assets/index-DIC22ZK_.js +0 -638
package/NATIVE_CI.md CHANGED
@@ -1,155 +1,98 @@
1
- # Native CI and browser-game candidate
1
+ # Native CI and browser-game testing
2
2
 
3
- This candidate adds native CI and game APIs to both engines. Managed Cloud
4
- execution remains retired. Existing npm OSS / private Pro archive distribution
5
- and fallback remain supported. Naija Throne's current runner is unchanged;
6
- its migration is a separate acceptance step. Native CI uses protocol 1.
7
- The public CLI selects compatible Pro engines or logs the reason and falls back
8
- to OSS. Older Pro CLIs may own the npm binary and do not understand the new
9
- commands; install both candidates when testing the Pro path.
3
+ Flowstride runs `.flow` tests locally and in CI without a custom runner wrapper.
10
4
 
11
- The candidates pin Playwright 1.59.1 in both engines; the native install command
12
- installs that engine's matching Chromium.
5
+ ## Installation and execution
13
6
 
14
- ## Local candidate check
7
+ Use Node.js 22.12 or newer. Install Flowstride as a project dependency and commit the lockfile:
15
8
 
16
- Use a disposable project first. Install the OSS archive, then the Pro archive if
17
- needed. Both candidates must be installed for testing the new Pro path. The
18
- currently hosted Cloud download still serves the existing release; this local
19
- candidate does not change that endpoint or its archive.
9
+ ```sh
10
+ npm install --save-dev flowstride
11
+ npx flowstride install
12
+ npx flowstride run flows --ci
13
+ ```
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.
16
+
17
+ Eligible Pro 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 Pro installations and falls back to OS when Pro is unavailable.
18
+
19
+ Generate a GitHub Actions workflow explicitly:
20
20
 
21
21
  ```sh
22
- npm install --save-dev /absolute/path/flowstride-1.0.20-rc.2.tgz
23
- # Optional: install the local matching Pro candidate after project dependencies.
24
- npm install --no-save /absolute/path/flowstride-pro-1.0.15-rc.1.tgz
25
- npx --no-install flowstride install
26
- npx --no-install flowstride run --ci
22
+ npx flowstride ci init github
23
+ ```
24
+
25
+ The command requires an npm project with a committed lockfile and refuses to overwrite an existing workflow. It does not run automatically during installation.
26
+
27
+ ## Configuration and reports
28
+
29
+ `flowstride.config.json` supports `testDir`, `baseUrl`, `timeout`, `device` (`desktop`, `phone`, `landscape`), optional `viewport`, `pluginsDir`, `artifactsDir`, `recordVideo` (boolean), `browserErrors` (`fail` or `record`), and `webServer` (`command`, local readiness `url`, optional `cwd` and `timeout`).
30
+
31
+ Malformed configuration and unsafe output paths fail before execution. Configuration, plugin, environment, upload, session and output paths must remain inside the project, including resolved symlinks.
32
+
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
+
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; Pro executes bail runs sequentially.
36
+
37
+ An optional configured local web server is started and stopped with the run. Flowstride rejects a readiness URL that is already serving.
38
+
39
+ Cloud reporting is disabled by default in native CI. Set `cloudSync: true` to enable authenticated reporting. Reporting and video status are recorded separately in the summary and `.flowstride/cloud-sync.json`; a reporting failure does not change a passed test into a failed test.
40
+
41
+ ## Browser-game actions
42
+
43
+ Register the built-in alias:
44
+
45
+ ```text
46
+ let game = "flowstride:game";
27
47
  ```
28
48
 
29
- Pro continues to require your normal valid developer credentials for licensed
30
- features. Installing Pro uses `--no-save`: another `npm ci` can remove it. Keep
31
- project dependency installation before Pro installation. An installed Pro package
32
- can own `node_modules/.bin/flowstride`; both that entry point and the public OSS
33
- entry point must be covered when checking fallback.
34
-
35
- The sample in `examples/native-game` uses a tiny local canvas game. Copy its
36
- files into a disposable project containing the installed candidates, then run
37
- the command above. `server.mjs` is the game fixture's HTTP server; it contains no
38
- Flowstride runner, adapter, worker, or CI orchestration code. A real application
39
- uses its normal development/start command instead.
40
-
41
- ## Configuration
42
-
43
- `flowstride.config.json` supports `testDir`, `baseUrl`, `timeout`, `device`
44
- (`desktop`, `phone`, `landscape`), optional `viewport`, `pluginsDir`,
45
- `artifactsDir`, `recordVideo` (boolean), `browserErrors` (`fail` or `record`), and
46
- `webServer` (`command`, local readiness `url`, optional `cwd` and `timeout`).
47
- Malformed configuration and unsafe output paths fail before execution.
48
-
49
- Native CI is selected by `--ci` or a recognized CI environment. It runs without
50
- a dashboard server, returns nonzero for failed/incomplete/crashed execution,
51
- and writes latest `summary.json`/`junit.xml` reports at the configured artifact
52
- root. Media and attachments go into a unique run directory referenced by the
53
- summary, so local reruns retain history without mixing evidence.
54
- SIGINT/SIGTERM produce interrupted results. The run owns its optional local
55
- server and refuses an already-serving readiness URL.
56
-
57
- Cloud reporting is off by default in native CI. `cloudSync: true` explicitly
58
- allows existing authenticated reporting; its existing server-side security and
59
- storage limitations still apply. Normal interactive reporting and the restored
60
- Cloud URL overrides remain separate from retired managed execution.
61
-
62
- `npx flowstride ci init github` generates a workflow explicitly, never during
63
- installation, and refuses to overwrite it. It assumes an npm project with a
64
- committed lockfile. Other package managers and monorepos can use the composite
65
- action's install-command and working-directory inputs. The composite action is
66
- in the OSS repository's `action/` directory and becomes remotely usable only
67
- once that source is pushed. Pin its commit when configuring a consumer workflow.
68
- Pro jobs pass a developer token as a secret; dependency installation precedes
69
- Pro login/install, matching-browser installation, execution, and artifact upload.
70
-
71
- ## Native game actions
72
-
73
- Register the built-in alias with `let game = "flowstride:game"`. It requires no
74
- custom plugin file. Available actions:
75
-
76
- - `tap`: canvas selector, x/y; relative coordinates by default, or `unit: "pixels"`.
77
- - `drag`/`swipe`: canvas, from/to coordinates, optional duration and input type.
49
+ The built-in game API provides:
50
+
51
+ - `tap`: canvas selector and coordinates; relative coordinates by default, or `unit: "pixels"`.
52
+ - `drag` and `swipe`: canvas, start/end coordinates, optional duration and input type.
78
53
  - `key`: key name and optional hold duration.
79
54
  - `checkpoint`: named screenshot, optionally of one canvas.
80
- - `snapshot` and `expectVisual`: canvas comparison with explicit minChange/maxChange.
81
- - `state`/`expectState`: exposed state, optional dotted path and expected equals.
82
- - `snapshotState`/`expectPreserved`: compare selected state across actions/reloads.
83
- - `fixture`: a named fixture registered by the application in explicit test mode.
84
- - `select`: a stable object ID resolved by the game bridge, then real pointer input.
85
-
86
- Visual checks establish pixel differences, not gameplay correctness; pair them
87
- with state or UI assertions. Mobile profiles emulate Chromium devices, not
88
- physical phones. Touch dragging currently uses Chromium CDP.
89
-
90
- For a generic browser game, import `registerGame` from
91
- `flowstride/dist/game/bridge.js` and supply readState and optional test-only
92
- fixtures. The function manages the browser bridge; no global setup is required
93
- in the test runner.
94
-
95
- ## Three.js integration
96
-
97
- Import `registerThreeGame` from `flowstride/dist/game/three-bridge.js` in the game
98
- bundle. Register the live scene, camera, canvas, the application's own Vector3
99
- and Raycaster constructors, and an optional objects map keyed by stable IDs.
100
- Alternatively, assign `userData.flowstrideId` to scene objects. Optional local
101
- pick points use `userData.flowstridePickPoint: [x, y, z]`.
102
-
103
- The bridge projects the live object and raycasts the live scene; hidden,
104
- occluded, off-screen, covered or non-pickable objects fail explicitly. It creates
105
- no renderer or animation loop. Dispose the bridge when the scene is replaced.
106
-
107
- Optional `readState` provides observable state. `fixtures` are available only
108
- when the application explicitly registers with `testMode: true`; use that
109
- setting in dedicated test builds, never public production builds. Naija Throne
110
- still defines campaign-specific fixtures/rules, using these supported APIs.
111
-
112
- Custom plugins now receive `sdk.game`, `sdk.browser.page()`, and `sdk.run`
113
- (device, artifact directory and attach method), alongside the existing SDK.
114
- They need no global bridge or internal Flowstride class imports.
115
-
116
- ## Validation before release
117
-
118
- Build both packages and run `npm run test:native`. For the optional live Three.js
119
- fixture set `FLOWSTRIDE_THREE_BUILD` to a Three.js build directory containing
120
- three.module.js and three.core.js. OSS CLI handoff tests use
121
- `FLOWSTRIDE_PRO_SOURCE` pointing at the built Pro package.
122
-
123
- Run the real archive install/handoff harness against both candidates, including
124
- missing/broken Pro and revoked-token fallback. Validate GitHub's Linux execution,
125
- real licensed download and Naija Throne migration after local acceptance.
126
- No push, npm publication, Cloud archive replacement or Naija Throne migration
127
- is performed by building these candidates.
128
-
129
- ## Candidate acceptance automation
130
-
131
- The repository's `Native CI acceptance` workflow tests Node 22 and 24 on Linux.
132
- It uses a checksum-pinned archive in `.github/fixtures`, checks its compiled engine
133
- against a fresh build, checks referenced dashboard assets, then installs that exact
134
- archive in a clean consumer. It exercises native browser installation, passing and
135
- deliberately failing game execution, media, server cleanup and workflow preservation.
136
- It also runs the native source suite, including delayed uploads and cancellation.
137
- The Pro archive belongs only in the private Pro repository.
138
-
139
- These jobs do not publish npm packages, replace the hosted Pro archive, deploy
140
- Cloud, or migrate application repositories. Native Cloud reporting stays opt-in.
141
- Qualification covers Chromium and emulated desktop/phone/landscape profiles.
142
- Physical Android/iOS devices, Safari/Firefox and other game engines are outside
143
- this candidate's verified support scope. Real Cloud licensing, reporting and
144
- video storage require a separate live acceptance run.
145
-
146
- ## OSS npm preview release
147
-
148
- OSS `1.0.20-rc.2` requires Node.js 22.12.0+. Publish the verified archive under
149
- `next`; install with `npm install --save-dev flowstride@next` after publication.
150
- Use the release archive and checksum rather than rebuilding from a dirty checkout.
151
- The matching local Pro candidate remains `1.0.15-rc.1`; hosted Pro remains
152
- `1.0.14`. Complete authentication before reinstalling the local Pro candidate.
153
- The unchanged dashboard bundle is reused from the previously qualified rc.1
154
- archive; the engine is rebuilt from this source. The release input manifest
155
- records both that archive's checksum and the merged base commit.
55
+ - `snapshot` and `expectVisual`: canvas comparison with explicit change thresholds.
56
+ - `state` and `expectState`: exposed application state with optional dotted paths.
57
+ - `snapshotState` and `expectPreserved`: compare selected state across actions or reloads.
58
+ - `fixture`: a named fixture explicitly registered by the application in test mode.
59
+ - `select`: a stable object ID resolved by a game bridge, followed by real pointer input.
60
+
61
+ The package includes a small runnable example in `examples/native-game`. Its HTTP server serves the fixture application; it is not a custom test runner. Use your application's normal start command for your own game.
62
+
63
+ Visual checks measure pixel differences. Pair them with state or UI assertions to verify gameplay behavior. Mobile profiles emulate Chromium devices; physical device testing is a separate qualification. Touch dragging currently uses Chromium CDP.
64
+
65
+ ## Application bridges
66
+
67
+ For a generic browser game, import `registerGame` from `flowstride/dist/game/bridge.js`. Supply `readState` and optional test-only fixtures.
68
+
69
+ For Three.js, import `registerThreeGame` from `flowstride/dist/game/three-bridge.js`. Register the live scene, camera, canvas, your application's `Vector3` and `Raycaster` constructors, and an optional map of stable object IDs. Alternatively, assign `userData.flowstrideId` to scene objects. Optional local pick points use `userData.flowstridePickPoint: [x, y, z]`.
70
+
71
+ The bridge projects and raycasts the live scene. Hidden, occluded, off-screen, covered or non-pickable objects fail explicitly. It creates no renderer or animation loop. Dispose the bridge when replacing the scene.
72
+
73
+ Application fixtures are available only when explicitly registered with `testMode: true`. Enable this in dedicated test builds, never public production builds. Your application still defines its own rules, observable state and fixtures.
74
+
75
+ Custom plugins receive `sdk.game`, `sdk.browser.page()` and `sdk.run`, including artifact attachment support, alongside the existing SDK.
76
+
77
+ ## Assertions and browser sessions
78
+
79
+ ```text
80
+ flow.expect attribute "#order" "data-state" "approved";
81
+ flow.expect attribute "#order" "class" contains "selected";
82
+ flow.save session "browser" persist;
83
+ flow.use session "browser";
84
+ ```
85
+
86
+ Attribute comparisons wait up to the configured timeout. Exact matching is case-sensitive; `contains` checks a substring. Missing attributes fail even when the expected value is empty.
87
+
88
+ Sessions capture cookies, local storage, session storage and the current HTTP(S) storage origin. Session storage is restored immediately on the matching origin or before its first matching navigation. It is not seeded into unrelated origins. The initial seed is then removed so later application changes and reloads are preserved.
89
+
90
+ Existing cookie/local-storage snapshots remain compatible. Older snapshots with session storage but no origin use the current application origin or configured `baseUrl`; open the application first or set `baseUrl` if neither is available. Restoration merges saved keys into storage. This is a single-origin storage snapshot.
91
+
92
+ ## Interactive history and debugging
93
+
94
+ Each completed flow tab restores its own last captured screen. Selecting an earlier step remembers a separate history cursor for that file. Flows without screenshots show an empty state. New runs clear previous screens and cursors.
95
+
96
+ The local cURL preview remains `[REDACTED]`. Copy uses the original captured request held in interactive debugger memory. Already-redacted historical data cannot be recovered. CI and Cloud reports retain redaction.
97
+
98
+ Review artifact access and test data: credential redaction does not remove every possible application secret, and screenshots or videos can show sensitive information.
package/README.md CHANGED
@@ -1,263 +1,88 @@
1
1
  # Flowstride
2
2
 
3
- **The next-generation, BDD-flavored End-to-End Testing Framework.**
3
+ Flowstride OS is an open source framework for browser, API and manual testing. Write readable `.flow` tests, inspect execution in the local dashboard, or run headlessly in CI.
4
4
 
5
- Flowstride OS combines the human-readable structure of Behavior-Driven Development (BDD) with the raw execution power of Playwright. It allows QA engineers and developers to write robust, maintainable UI and API tests using an intuitive domain-specific language (DSL), while providing a rich, interactive React dashboard to monitor, debug, and replay test runs in real time.
5
+ [Documentation](https://docs.flowstride.io/) · [Flowstride Cloud](https://cloud.flowstride.io/)
6
6
 
7
- [Documentation](https://docs.flowstride.io/)
7
+ ## Requirements
8
8
 
9
- ## Native CI and game testing preview — 1.0.20-rc.2
9
+ - Node.js 22.12 or newer.
10
+ - Chromium installed through Flowstride for browser tests.
10
11
 
11
- This is an opt-in preview intended for the npm `next` tag. The default stable
12
- release remains available through `latest`. After the preview is published:
12
+ ## Get started
13
13
 
14
- ```sh
15
- npm install --save-dev flowstride@next
16
- npx --no-install flowstride install
17
- npx --no-install flowstride run --ci
18
- ```
19
-
20
- Node.js 22.12.0+ is required; acceptance covers the minimum version and current
21
- Node.js 22/24 on Linux, plus Node.js 24 on macOS. The preview adds native CI
22
- exit codes, JSON/JUnit reports, videos/screenshots, device profiles, explicit
23
- GitHub workflow generation, and supported canvas/Three.js testing APIs.
24
- See [native CI setup](NATIVE_CI.md) and [release notes](RELEASE_NOTES.md).
25
-
26
- For this preview, use OSS alone or manually install the matching private Pro
27
- `1.0.15-rc.1` candidate after project dependencies. Normal Cloud login still
28
- serves Pro `1.0.14`; signing in afterward can replace the preview's Pro package,
29
- and that older CLI does not support the new native commands. Cloud reporting
30
- and video-storage defects remain open. Native CI keeps Cloud reporting off by
31
- default. Managed Cloud execution remains retired.
32
-
33
- This release qualifies Chromium desktop and emulated phone/landscape profiles
34
- and browser-game fixtures. It does not establish physical-phone, Safari,
35
- Firefox, other game-engine, or complete application-game coverage.
36
-
37
- ---
38
-
39
- ## Why Flowstride?
40
-
41
- Traditional E2E frameworks force you to choose between highly technical code (which non-developers struggle to read) or rigid low-code tools (which lack flexibility). Flowstride bridges the gap:
42
-
43
- - **Plain-English Selectors**: Target elements spatially (`"Submit" near "Cancel"`) or by text, eliminating brittle CSS/XPath dependencies.
44
- - **Unified UI & API Testing**: Execute browser actions and REST/GraphQL API calls within the exact same scenario.
45
- - **Live Visual Dashboard**: Watch your tests run step-by-step, inspect DOM snapshots, trace network activity, and manually replay API requests directly from the UI.
46
- - **Built-in State Management**: Save and inject browser sessions (cookies, local storage) with a single command to bypass repetitive login steps.
47
-
48
- ---
49
-
50
- ## Installation & Quick Start
51
-
52
- Flowstride requires Node.js 22.12.0 or higher. Use a current patched Node.js 22 or 24 release.
53
-
54
- **1. Install globally (or as a dev dependency in your project):**
55
-
56
- ```bash
57
- npm i flowstride --save-dev
58
- ```
59
-
60
- **2. Initialize a new Flowstride workspace:**
14
+ Install Flowstride in your project:
61
15
 
62
- ```bash
16
+ ```sh
17
+ npm install --save-dev flowstride
63
18
  npx flowstride init
19
+ npx flowstride run flows/example.flow
64
20
  ```
65
21
 
66
- _(This creates the default directory structure (`/flows`, `/reports`, `/plugins`) and generates a `example.flow` sample file.)_
67
-
68
- **3. Install VS Code Extension (Highly Recommended):**
69
-
70
- To get the best developer experience, including syntax highlighting, auto-completion, and native IDE support for .flow files, install our official VS Code extension directly via the VS Code CLI.
22
+ `init` creates the project folders and an example flow, and installs Chromium. You can also install the matching browser explicitly:
71
23
 
72
- Run the command below:
73
-
74
- ```bash
75
- code --install-extension flowstride.flowstride-vscode
24
+ ```sh
25
+ npx flowstride install
76
26
  ```
77
27
 
78
- _Alternatively, you can open the Extensions tab in VS Code and search for Flowstride Automation_
28
+ An example flow:
79
29
 
80
- **4. Run your first test:**
30
+ ```text
31
+ Feature: Home page
81
32
 
82
- ```bash
83
- npx flowstride run
33
+ Scenario: Show the sign-in form
84
34
 
85
- OR
35
+ Given "Open the application"
36
+ flow.open "https://your-application.example/login";
86
37
 
87
- npx flowstride run flows/example.flow
38
+ Then "The sign-in button is visible"
39
+ flow.expect visible "Sign in";
88
40
  ```
89
41
 
90
- _(This command executes your test while instantly booting up the local Flowstride Dashboard.)_
91
-
92
- **5. Login to Flowstride Cloud:**
42
+ Replace the URL and assertion with values from your own application.
93
43
 
94
- Authenticate your local project with your Cloud account to unlock Cloud features after signing up at [cloud.flowstride.io](https://cloud.flowstride.io).
44
+ ## Native CI
95
45
 
96
- ```bash
97
- npx flowstride login
46
+ ```sh
47
+ npx flowstride run flows --ci
98
48
  ```
99
49
 
100
- ---
101
-
102
- ## Execution data and Cloud integration
103
-
104
- Tests run on your machine or CI runner. Native CI writes reports, screenshots,
105
- videos and attachments to the configured local artifact directory. Interactive
106
- API diagnostics are available in the local dashboard. These outputs can contain
107
- application data or credentials; automatic redaction is not guaranteed.
108
-
109
- Cloud login/licensing, FlowMail OTP retrieval and explicitly enabled Cloud
110
- reporting contact their configured services. Native CI leaves Cloud reporting
111
- off unless `cloudSync: true` is explicitly configured. Existing Cloud reporting
112
- and storage limitations remain documented in the preview release notes.
113
-
114
- Use test credentials, keep runtime state and artifacts out of source control,
115
- and choose CI artifact access and retention appropriate to the test data.
116
-
117
- ---
50
+ CI runs headlessly, returns a nonzero exit code for failed or interrupted execution, and writes JSON and JUnit reports to `flowstride-artifacts` by default. Screenshots, videos and attachments are associated with their run.
118
51
 
119
- ## The `.flow` Syntax
120
-
121
- Flowstride utilizes a custom `.flow` file extension. It seamlessly pairs descriptive BDD steps (Given, When, And, Then) with direct, executable `flow.` commands.
122
-
123
- Here is an example of a standard UI and API flow:
124
-
125
- ```bash
126
- // Signing up a new user via API call.
127
- Given "User signup via API call"
128
- flow.post "/api/signup" with reqBody
129
- """
130
- {
131
- "firstName": "Mike",
132
- "lastName": "Doe",
133
- "dob": "1995-05-10",
134
- "sex": "male",
135
- "email": "user@flowstridemail.com",
136
- "password": "$randomPassword"
137
- }
138
- """
139
- flow.extract resBody "userId" as "newUserId"
140
- flow.expect status "201"
141
-
142
- // Approving the new user from admin via API call
143
- When "A new signup user is approved by the Admin"
144
- flow.post "/api/approve" with reqBody
145
- """
146
- {
147
- "userId": "@newUserId"
148
- }
149
- """
150
-
151
- And "Confirm Status Code is 200"
152
- flow.expect status "200"
153
-
154
- And "Confirm resBody message is successful"
155
- flow.expect resBody "message" equals "User approved successfully"
156
-
157
- And "Confirm user status to be active"
158
- flow.expect resBody "user.status" equals "active"
159
-
160
- // Using the newly registered user credentials to login via the UI
161
- When "User lands on home page"
162
- flow.open "/login"
163
-
164
- And "User clicks on Log in, near Sign Up"
165
- flow.click "Log in" near "Sign up"
166
-
167
- And "User inputs newly created credentials"
168
- flow.type "Email" "user@flowstridemail.com"
169
- flow.type "Password" "@randomPassword" // Reusing the random password from API call
170
-
171
- Then "Click on Login button"
172
- flow.click button "Login"
52
+ To generate a GitHub Actions workflow in an npm project with a committed lockfile:
173
53
 
54
+ ```sh
55
+ npx flowstride ci init github
174
56
  ```
175
57
 
176
- ---
177
-
178
- ## Command Reference
179
-
180
- ### Browser Navigation & Context
181
-
182
- | Command | Example | Description |
183
- | :--------- | :----------------------------- | :--------------------------------------------------------------- |
184
- | `open` | `flow.open "https://site.com"` | Navigates the browser to the specified URL. |
185
- | `switchTo` | `flow.switchTo "next"` | Switches to a new tab or window by title/URL or relation. |
186
- | `close` | `flow.close "Modal Title"` | Geometrically calculates and clicks the close button of a modal. |
187
-
188
- ### UI Actions
58
+ Workflow generation is explicit; package installation does not create a workflow. See [NATIVE_CI.md](./NATIVE_CI.md) for configuration and browser-game testing.
189
59
 
190
- | Command | Example | Description |
191
- | :----------- | :---------------------------------------- | :-------------------------------------------------------------- |
192
- | `click` | `flow.click "Submit"` | Clicks an element based on text, CSS, or spatial relation. |
193
- | `forceClick` | `flow.forceClick "#hidden-btn"` | Bypasses Playwright's actionability checks to force a click. |
194
- | `type` | `flow.type "Email" "test@test.com"` | Types value into an input field matching the target. |
195
- | `passcode` | `flow.passcode "OTP" "123456"` | Specifically handles split OTP/Passcode input arrays. |
196
- | `select` | `flow.select "Option 1" from "Dropdown"` | Selects an option from a native select or custom portal. |
197
- | `check` | `flow.check "Terms and Conditions"` | Checks a checkbox or radio button. |
198
- | `upload` | `flow.upload "Avatar" "path/to/file.jpg"` | Uploads a local file to a file input element. |
199
- | `drag` | `flow.drag "Item A" into "Zone B"` | Drags a source element and drops it into a destination element. |
60
+ ## Local dashboard and manual testing
200
61
 
201
- ### Assertions
62
+ Interactive runs open a dashboard for execution, per-flow screen history, network inspection and API Replay. The local cURL preview remains redacted; its Copy control copies the original captured request when it is still available in the interactive debugger.
202
63
 
203
- | Command | Example | Description |
204
- | :--------------- | :------------------------------------- | :----------------------------------------------------- |
205
- | `expect visible` | `flow.expect visible "Success"` | Asserts an element is attached to the DOM and visible. |
206
- | `expect text` | `flow.expect text "Error"` | Asserts specific text is present in the UI. |
207
- | `expect value` | `flow.expect value "Username" "admin"` | Asserts the input value of a targeted field. |
64
+ For visual manual test design and execution:
208
65
 
209
- ### Session Management
210
-
211
- | Command | Example | Description |
212
- | :------------- | :------------------------- | :---------------------------------------------------------------------------- |
213
- | `save session` | `flow.save session "Auth"` | Captures current cookies/storage into memory (add `persist` to save to disk). |
214
- | `use session` | `flow.use session "Auth"` | Injects previously saved cookies/storage directly into the browser. |
215
-
216
- ### API Testing
217
-
218
- | Command | Example | Description |
219
- | :----------------------------- | :-------------------------------------------- | :----------------------------------------------------------------- |
220
- | `get`, `post`, `put`, `delete` | `flow.post "/api/users" with reqBody "{...}"` | Executes HTTP requests natively via Undici. |
221
- | `extract` | `flow.extract resBody "token" as "jwt"` | Parses API responses and saves data to a local or global variable. |
222
- | `expect status` | `flow.expect status "200"` | Asserts the HTTP status code of the last API call. |
223
-
224
- _(For a complete list of commands, API assertions, and plugin integration rules, please see the official documentation)._
225
-
226
- ---
227
-
228
- ## Interactive Dashboard
229
-
230
- Running a `.flow` file automatically boots the Flowstride Dashboard.
231
-
232
- - **Live Execution:** Watch tests execute in real-time with an integrated screencast.
233
- - **Step Diagnostics:** Click on any step (Pass or Fail) to view exact execution context, error stack traces, and a DOM snapshot with the target element highlighted.
234
- - **Network Interception:** View all intercepted XHR/Fetch requests. You can click **Replay** on any API log to independently re-execute the request from the Node.js backend natively.
235
- - **Soft Kill & Rerun:** Use the top navigation bar to seamlessly abort running tests, clear state, and restart execution without touching the terminal.
236
-
237
- ---
238
-
239
- ## Flowstride OS vs. Enterprise
66
+ ```sh
67
+ npx flowstride manual
68
+ ```
240
69
 
241
- **Flowstride OS** is free, fully featured, and highly capable for individual developers and standard QA teams.
70
+ ## Flowstride Pro
242
71
 
243
- **Flowstride Enterprise** (`flowstride.io`) unlocks advanced capabilities for massive-scale automation:
72
+ Eligible Flowstride Cloud users install Pro through the authenticated private channel:
244
73
 
245
- - **Distributed Parallel Execution Grid**: Run thousands of tests simultaneously across dynamically spun-up workers.
246
- - **AI Auto-Healing**: Let AI automatically fix broken or outdated selectors during test execution based on DOM analysis.
247
- - **Automated FlowMail (OTP/2FA)**: Fully native email extraction (`flow.getOtp`) to bypass complex 2FA flows.
248
- - **High-Fidelity PDF Exports**: Programmatic, C-suite ready PDF report generation.
249
- - **Cloud Storage & History**: Store all your test runs in the cloud to access and reference them at any time.
250
- - **Native Integrations**: Seamlessly connect your testing workflows directly with Jira and Slack.
251
- - **Massive Team Collaboration**: Scale your operations by connecting with 70+ team members in a shared workspace.
74
+ ```sh
75
+ npx flowstride login
76
+ ```
252
77
 
253
- ---
78
+ The OS CLI selects a compatible, authorized Pro engine when available and falls back to OS when Pro cannot be used. Pro is distributed privately.
254
79
 
255
- ## Contributing
80
+ ## Test data and artifacts
256
81
 
257
- We welcome contributions from the community! Whether you are fixing bugs, proposing new features, or improving documentation, please feel free to open an issue or submit a Pull Request.
82
+ Flowstride redacts recognized credentials in logs and reports. Redaction cannot guarantee removal of arbitrary application data, and screenshots or videos can contain sensitive information. Use appropriate test data and restrict access to artifacts, persisted sessions and raw requests copied for debugging.
258
83
 
259
- When submitting a PR, please ensure you test your changes against the core parser (`src/parser/`) and the Playwright web adapter (`src/adapters/web/`).
84
+ Keep `.flowstride/` and `flowstride-artifacts/` out of version control. CI Cloud reporting is disabled by default and requires explicit configuration and valid credentials.
260
85
 
261
86
  ## License
262
87
 
263
- This project is licensed under the [MIT License](LICENSE).
88
+ MIT.
@@ -8,6 +8,8 @@ export declare class WebAdapter {
8
8
  private page;
9
9
  private discoveredPages;
10
10
  private dialogHandler;
11
+ private pendingSessionStorageRestore;
12
+ private clearSessionStorageRestore;
11
13
  constructor(config: FlowstrideConfig);
12
14
  getPage(): Page;
13
15
  initialise(audioInjectionPath?: string): Promise<void>;
@@ -15,11 +17,12 @@ export declare class WebAdapter {
15
17
  rejectDialog(): Promise<void>;
16
18
  injectAudio(filePath: string): Promise<void>;
17
19
  switchTo(target: string): Promise<void>;
18
- injectStorage(cookies?: any[], localStorage?: Record<string, string>, fallbackDomain?: string): Promise<void>;
20
+ injectStorage(cookies?: any[], localStorage?: Record<string, string>, fallbackDomain?: string, sessionStorage?: Record<string, string>, storageOrigin?: string): Promise<void>;
19
21
  getState(): Promise<{
20
22
  cookies: any[];
21
23
  localStorage: Record<string, string>;
22
24
  sessionStorage: Record<string, string>;
25
+ storageOrigin?: string;
23
26
  }>;
24
27
  getCurrentUrl(): string;
25
28
  navigate(url: string): Promise<void>;