### Start demo server on alternate port in PowerShell Source: https://github.com/heroamogs/flowstride-os/blob/prod/examples/native-workflows/README.md PowerShell equivalent for setting FLOWSTRIDE_EXAMPLE_PORT before starting the server. Restarting the app clears its demo users and profile changes. ```powershell $env:FLOWSTRIDE_EXAMPLE_PORT = "4108" node workflow-examples/shared/server.mjs ``` -------------------------------- ### Copy native-workflows examples into project Source: https://github.com/heroamogs/flowstride-os/blob/prod/examples/native-workflows/README.md Copies the examples shipped by the installed package into your project so fixture edits, sessions, and reports stay in your workspace. Use a fresh destination; in an existing project, preserve your configuration and fixtures instead of overwriting them. ```sh cp -R node_modules/flowstride/examples/native-workflows workflow-examples ``` -------------------------------- ### Start the demo application server Source: https://github.com/heroamogs/flowstride-os/blob/prod/examples/native-workflows/README.md Run the shared demo server from the project root. It prints http://127.0.0.1:4107 and listens only on loopback; it is a demonstration fixture, not a production authentication service. ```sh node workflow-examples/shared/server.mjs ``` -------------------------------- ### Install Flowstride and run example flow Source: https://github.com/heroamogs/flowstride-os/blob/prod/README.md Install Flowstride as a dev dependency, initialize the project, and run the example flow. The init command creates project folders and an example flow, and installs Chromium. ```sh npm install --save-dev flowstride npx flowstride init npx flowstride run flows/example.flow ``` -------------------------------- ### Install Flowstride and initialize workspace Source: https://github.com/heroamogs/flowstride-os/blob/prod/examples/native-workflows/README.md Sets up a new project with Flowstride using Node.js 22.12 or newer. The init command creates the workspace, and the explicit browser-install command installs the Chromium build matching the selected engine. ```sh mkdir flowstride-workflows cd flowstride-workflows npm init -y npm i flowstride npx flowstride init npx flowstride install chromium ``` -------------------------------- ### Run a named example with npx flowstride run Source: https://github.com/heroamogs/flowstride-os/blob/prod/examples/native-workflows/README.md Run the api-and-ui example flow. Interactive execution opens the local dashboard. ```sh npx flowstride run workflow-examples/api-and-ui/flows/api-and-ui.flow ``` -------------------------------- ### Install and run Flowstride with Chromium, Firefox, or WebKit Source: https://github.com/heroamogs/flowstride-os/blob/prod/examples/native-workflows/README.md Install Chromium, Firefox, and WebKit via `npx flowstride install`, then run the API/UI workflow with `--browser firefox --ci` or `--browser webkit --ci`. Chromium is the default; Firefox and WebKit support API/UI, iframe, table, and variable examples, while audio-file microphone injection requires Chromium. Use `--headed` to see the browser window during an interactive run. ```sh npx flowstride install chromium firefox webkit npx flowstride run workflow-examples/api-and-ui/flows/api-and-ui.flow --browser firefox --ci npx flowstride run workflow-examples/api-and-ui/flows/api-and-ui.flow --browser webkit --ci ``` -------------------------------- ### Install TypeScript compiler for plugin example Source: https://github.com/heroamogs/flowstride-os/blob/prod/examples/native-workflows/iframes/README.md Install TypeScript 5.9.3 as a dev dependency before running the plugin example. Keep the compiler in your lockfile so CI uses the same version; newer compiler majors may be incompatible with the plugin loader. The native readable-target example does not need this extra setup. ```sh npm i --save-dev typescript@5.9.3 ``` -------------------------------- ### Start demo server on alternate port with FLOWSTRIDE_EXAMPLE_PORT Source: https://github.com/heroamogs/flowstride-os/blob/prod/examples/native-workflows/README.md If port 4107 is occupied, select another port and update BASE_URL to match. Restarting the app clears its demo users and profile changes; a saved browser session does not restore the in-memory database. ```sh FLOWSTRIDE_EXAMPLE_PORT=4108 node workflow-examples/shared/server.mjs ``` -------------------------------- ### Copy native-workflows examples on PowerShell Source: https://github.com/heroamogs/flowstride-os/blob/prod/examples/native-workflows/README.md PowerShell equivalent of the copy command for moving the shipped examples into your project. Use a fresh destination; in an existing project, preserve your configuration and fixtures instead of overwriting them. ```powershell Copy-Item -Recurse node_modules/flowstride/examples/native-workflows workflow-examples ``` -------------------------------- ### Flowstride project configuration for CI application startup Source: https://github.com/heroamogs/flowstride-os/blob/prod/examples/native-workflows/README.md JSON configuration for Flowstride to own the local application's lifecycle: it starts the command, checks readiness at the URL, runs tests, and stops the app afterward. Requires `BASE_URL` set in the environment or `.env`. Flowstride refuses to adopt a readiness URL that is already serving. ```json { "testDir": "workflow-examples/api-and-ui/flows", "timeout": 10000, "cloudSync": false, "webServer": { "command": "node workflow-examples/shared/server.mjs", "url": "http://127.0.0.1:4107", "timeout": 10000 } } ``` -------------------------------- ### Run a named example headlessly with --ci Source: https://github.com/heroamogs/flowstride-os/blob/prod/examples/native-workflows/README.md Headless execution returns a process exit code and retains evidence. A successful run exits with code 0; deliberate failures exit nonzero. Read flowstride-artifacts/summary.json and junit.xml; the summary identifies its unique run-* evidence directory. Failed assertions retain their screenshot and video when recording is enabled. ```sh npx flowstride run workflow-examples/api-and-ui/flows/api-and-ui.flow --ci ``` -------------------------------- ### Configure local application URL with .env Source: https://github.com/heroamogs/flowstride-os/blob/prod/examples/native-workflows/README.md Creates or updates a project-root .env file with BASE_URL and EXAMPLE_LABEL. OS and Cloud load .env automatically for a run; BASE_URL supplies the base for relative browser and API URLs. You can alternatively set baseUrl in flowstride.config.json, but BASE_URL takes precedence. ```dotenv BASE_URL=http://127.0.0.1:4107 EXAMPLE_LABEL="Workflow fixture" ``` -------------------------------- ### Add .gitignore entries for Flowstride project Source: https://github.com/heroamogs/flowstride-os/blob/prod/examples/native-workflows/README.md Ensures sensitive and generated files are excluded from version control. Share placeholder values in .env.example; keep real credentials in local configuration or CI secrets. ```gitignore node_modules/ .env .env.* !.env.example .flowstride/ flowstride-artifacts/ ``` -------------------------------- ### Run a named local example in CI with npx flowstride Source: https://github.com/heroamogs/flowstride-os/blob/prod/NATIVE_CI.md Use this command in a CI job after `npm ci` and matching browser installation to run a named local example. `--no-install` makes a missing local Flowstride installation fail instead of fetching a package; ordinary interactive commands use `npx flowstride`. ```sh npx --no-install flowstride run workflow-examples/api-and-ui/flows/api-and-ui.flow --ci ``` -------------------------------- ### Install Chromium for audio-file microphone injection Source: https://github.com/heroamogs/flowstride-os/blob/prod/examples/native-workflows/audio-to-text/README.md Install the matching Chromium browser explicitly for audio-file microphone injection. Run this if Chromium is not already available after the shared setup. ```sh npx flowstride install chromium ``` -------------------------------- ### Example flow file Source: https://github.com/heroamogs/flowstride-os/blob/prod/README.md An example .flow test file showing a Feature and Scenario with Given/Then steps. Replace the URL and assertion with values from your own application. ```text Feature: Home page Scenario: Show the sign-in form Given "Open the application" flow.open "https://your-application.example/login"; Then "The sign-in button is visible" flow.expect visible "Sign in"; ``` -------------------------------- ### Install browsers and run flows with browser selection Source: https://github.com/heroamogs/flowstride-os/blob/prod/NATIVE_BROWSER.md Install Chromium, Firefox, and WebKit binaries, then run flows with the Firefox engine in CI mode. The terminal prints the verified engine and version after launch; CI's summary.json includes the actual engine for each file. The install command downloads browser binaries and does not open a browser window. ```sh npx flowstride install chromium firefox webkit npx flowstride run flows --browser firefox --ci ``` -------------------------------- ### Install matching browser explicitly Source: https://github.com/heroamogs/flowstride-os/blob/prod/README.md Install the matching browser (Chromium, Firefox, or WebKit) explicitly. Chromium is the default; audio-file microphone injection requires Chromium. ```sh npx flowstride install ``` -------------------------------- ### Install dependencies for the React Dashboard Source: https://github.com/heroamogs/flowstride-os/blob/prod/CONTRIBUTING.md Navigate to the UI directory, install dependencies, and return to the root. ```bash cd src/ui npm install cd ../../ ``` -------------------------------- ### Initialize GitHub CI with browsers and shards Source: https://github.com/heroamogs/flowstride-os/blob/prod/NATIVE_BROWSER.md Generates a workflow with separate CI jobs for the specified browsers and shard count, using normal CI runners. Review project dependency/secrets setup as usual. ```sh npx flowstride ci init github --browsers chromium,firefox,webkit --shards 3 ``` -------------------------------- ### Install and run Flowstride tests in CI Source: https://github.com/heroamogs/flowstride-os/blob/prod/NATIVE_CI.md Install Flowstride as a dev dependency, install the browser, and run tests with the native CI flag. Requires Node.js 22.12 or newer and a committed lockfile. ```sh npm install --save-dev flowstride npx flowstride install npx flowstride run flows --ci ``` -------------------------------- ### Stub a function with flow.stub.install and verify calls Source: https://github.com/heroamogs/flowstride-os/blob/prod/NATIVE_BROWSER.md Installs a spy on analytics.track, clicks a purchase button, expects one call with argument 'purchase', then restores the stub. A spy records calls and invokes the original function; modes 'return' and 'throw' replace it with a configured value or error, and 'async: true' returns a promise. 'beforeLoad: true' installs on the next document for functions available before initialization, but 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. ```flow flow.stub.install { "name": "analytics", "target": "analytics.track", "mode": "spy" }; flow.click button "Purchase"; flow.stub.expect { "name": "analytics", "count": 1, "args": ["purchase"] }; flow.stub.restore { "name": "analytics" }; ``` -------------------------------- ### Install dependencies for the core runner Source: https://github.com/heroamogs/flowstride-os/blob/prod/CONTRIBUTING.md Install npm dependencies for the core runner. ```bash npm install ``` -------------------------------- ### Control time with flow.clock.install and flow.clock.runFor Source: https://github.com/heroamogs/flowstride-os/blob/prod/NATIVE_BROWSER.md Installs a fixed clock time, opens a page, and advances time by 5000 milliseconds. Clock commands include pauseAt, resume, runFor, fastForward, setFixedTime, and setSystemTime. Install the clock before the application installs its timers; time control affects the browser page, not the backend or operating-system clock. ```flow flow.clock.install { "time": "2026-01-01T00:00:00Z" }; flow.open "/timer"; flow.clock.runFor { "milliseconds": 5000 }; ``` -------------------------------- ### Run the deliberate failure example Source: https://github.com/heroamogs/flowstride-os/blob/prod/examples/native-workflows/api-and-ui/README.md Runs a scenario that expects loginCount to equal 99, causing the final assertion to fail and the process to exit nonzero. Inspect the failed step, screenshot, and video. A completed HTTP request is not proof of success; use explicit status/body assertions. ```sh npx flowstride run workflow-examples/api-and-ui/negative/wrong-backend-state.flow --ci ``` -------------------------------- ### Open local manual workspace Source: https://github.com/heroamogs/flowstride-os/blob/prod/examples/native-workflows/manual-testing/README.md Starts the Flowstride manual workspace. After copying the fixture, choose the Profile review template from the flow selector; refresh the workspace if it was open before the file was copied. ```sh npx flowstride manual ``` -------------------------------- ### Microphone and transcript UI fixture flow Source: https://github.com/heroamogs/flowstride-os/blob/prod/examples/native-workflows/audio-to-text/README.md Flow definition for the microphone demo. It injects a PCM WAV fixture before browser startup, grants microphone permission, opens /audio, clicks Start recording, waits for the pipeline, stops recording, and asserts the transcript contains the fixture text. The fixture path is literal and relative to the project root; flow variables are not resolved in the pre-launch path. ```flow Feature: Microphone and transcript UI fixture Scenario: Capture a known microphone signal Given "Configure a PCM WAV before browser startup" flow.injectAudio "workflow-examples/audio-to-text/fixtures/microphone-tone.wav"; flow.browser.permissions { "permissions": [ "microphone" ] }; flow.open "/audio"; When "Start recording" flow.click button "Start recording"; flow.expect visible "Recording active"; When "Allow the fixture audio to play and stop" flow.waitForPipeline; flow.click button "Stop recording"; Then "The simulated transcription result is displayed" flow.expect transcript contains "Fixture transcript: audio received."; flow.assert.that { "selector": "#transcript", "condition": "text", "value": "Fixture transcript: audio received." }; ``` -------------------------------- ### Real transcription workflow template Source: https://github.com/heroamogs/flowstride-os/blob/prod/examples/native-workflows/audio-to-text/README.md Flow template that injects a known audio file, grants microphone permission, opens the recording page, starts and stops recording, then asserts the transcript contains the expected phrase. Adapt buttons, labels, and selectors to your application. ```flow Feature: Verify a real application's speech transcription Scenario: Record known spoken audio and check the resulting transcript Given "A spoken PCM WAV and an authorized recording page" flow.injectAudio "fixtures/voice-note.wav"; flow.browser.permissions { "permissions": ["microphone"] }; flow.open "{{env.TRANSCRIPTION_URL}}"; When "Start the application's recording" flow.click button "Start recording"; flow.expect visible "Recording active"; When "Allow the audio clip to play and stop recording" flow.waitForPipeline; flow.click button "Stop recording"; Then "The new transcript contains the expected spoken words" flow.assert.that { "selector": "#transcript", "condition": "containsText", "value": "{{env.EXPECTED_TRANSCRIPT}}", "timeout": 60000 }; ``` -------------------------------- ### Generate GitHub Actions workflow Source: https://github.com/heroamogs/flowstride-os/blob/prod/README.md Generate a GitHub Actions workflow in an npm project with a committed lockfile. Workflow generation is explicit; package installation does not create a workflow. ```sh npx flowstride ci init github ``` -------------------------------- ### Run the TypeScript compiler in watch mode Source: https://github.com/heroamogs/flowstride-os/blob/prod/CONTRIBUTING.md Start the TypeScript compiler in watch mode to automatically recompile on changes. ```bash npm run build:watch ``` -------------------------------- ### ESLint configuration with React-specific lint rules Source: https://github.com/heroamogs/flowstride-os/blob/prod/src/ui/README.md Install eslint-plugin-react-x and eslint-plugin-react-dom to enable React-specific lint rules. Add their recommended configs to the extends array, and keep the same parserOptions for TypeScript project files. ```JavaScript // eslint.config.js import reactX from 'eslint-plugin-react-x' import reactDom from 'eslint-plugin-react-dom' export default defineConfig([ globalIgnores(['dist']), { files: ['**/*.{ts,tsx}'], extends: [ // Other configs... // Enable lint rules for React reactX.configs['recommended-typescript'], // Enable lint rules for React DOM reactDom.configs.recommended, ], languageOptions: { parserOptions: { project: ['./tsconfig.node.json', './tsconfig.app.json'], tsconfigRootDir: import.meta.dirname, }, // other options... }, }, ]) ``` -------------------------------- ### Shell: Run two flow files sequentially Source: https://github.com/heroamogs/flowstride-os/blob/prod/examples/native-workflows/variables-and-reuse/README.md Runs the two flow files together sequentially with a single worker. The .first.flow setup executes before the ordinary file; both files pass. ```sh npx flowstride run workflow-examples/variables-and-reuse/flows --workers 1 --ci ``` -------------------------------- ### game.swipe Source: https://github.com/heroamogs/flowstride-os/blob/prod/NATIVE_CI.md Performs a swipe action on a canvas from start to end coordinates. Supports optional duration and input type. ```APIDOC ## [POST] game.swipe ### Description Performs a swipe action on a canvas from start to end coordinates. Supports optional duration and input type. ### Method POST ### Endpoint game.swipe ### Parameters #### Request Body - **canvas** (string) - Required - Canvas selector. - **start** (object) - Required - Start coordinates. - **x** (number) - Required - X coordinate. - **y** (number) - Required - Y coordinate. - **end** (object) - Required - End coordinates. - **x** (number) - Required - X coordinate. - **y** (number) - Required - Y coordinate. - **duration** (number) - Optional - Duration of the swipe in milliseconds. - **inputType** (string) - Optional - Input type (e.g., "mouse", "touch"). ### Request Example { "canvas": "#gameCanvas", "start": { "x": 0.2, "y": 0.3 }, "end": { "x": 0.8, "y": 0.7 }, "duration": 500, "inputType": "touch" } ### Response #### Success Response (200) - **status** (string) - Description of the action result. #### Response Example { "status": "success" } ``` -------------------------------- ### Connect Cloud with npx flowstride login Source: https://github.com/heroamogs/flowstride-os/blob/prod/examples/native-workflows/api-ui-otp/README.md Authenticate the FlowStrider CLI with a developer token. In CI, use the FLOWSTRIDE_TOKEN secret and the normal Cloud setup described in NATIVE_CI.md. ```sh npx flowstride login ``` -------------------------------- ### game.drag Source: https://github.com/heroamogs/flowstride-os/blob/prod/NATIVE_CI.md Performs a drag action on a canvas from start to end coordinates. Supports optional duration and input type. ```APIDOC ## [POST] game.drag ### Description Performs a drag action on a canvas from start to end coordinates. Supports optional duration and input type. ### Method POST ### Endpoint game.drag ### Parameters #### Request Body - **canvas** (string) - Required - Canvas selector. - **start** (object) - Required - Start coordinates. - **x** (number) - Required - X coordinate. - **y** (number) - Required - Y coordinate. - **end** (object) - Required - End coordinates. - **x** (number) - Required - X coordinate. - **y** (number) - Required - Y coordinate. - **duration** (number) - Optional - Duration of the drag in milliseconds. - **inputType** (string) - Optional - Input type (e.g., "mouse", "touch"). ### Request Example { "canvas": "#gameCanvas", "start": { "x": 0.2, "y": 0.3 }, "end": { "x": 0.8, "y": 0.7 }, "duration": 500, "inputType": "mouse" } ### Response #### Success Response (200) - **status** (string) - Description of the action result. #### Response Example { "status": "success" } ``` -------------------------------- ### Download and verify a file with flow.download commands Source: https://github.com/heroamogs/flowstride-os/blob/prod/NATIVE_BROWSER.md Downloads a file by clicking a link, saves it to a project path, and asserts its properties. The destination must stay inside the project and must not already exist. Assertions support suggested filename, exact size, minSize, text contains, exact JSON, and SHA-256 hash; content assertions have a size limit, so use size/hash checks for larger downloads. No custom plugin is needed. ```flow flow.download.arm { "name": "invoice" }; flow.click link "Download invoice"; flow.download.save { "name": "invoice", "file": "downloads/invoice.json" }; flow.download.expect { "name": "invoice", "filename": "invoice.json", "minSize": 1, "json": { "paid": true } }; ``` -------------------------------- ### Run microphone demo flow Source: https://github.com/heroamogs/flowstride-os/blob/prod/examples/native-workflows/audio-to-text/README.md Run the self-contained microphone demo flow with Chromium in CI mode. The demo injects a PCM WAV fixture, captures microphone input, and produces a deterministic transcript-like response. The run exits 0 when successful. ```sh npx flowstride run workflow-examples/audio-to-text/flows/microphone-demo.flow --browser chromium --ci ``` -------------------------------- ### Copy profile-review.json fixture (sh) Source: https://github.com/heroamogs/flowstride-os/blob/prod/examples/native-workflows/manual-testing/README.md Creates the manual_flows/templates directory and copies the supplied profile-review.json fixture into it with a new filename. Use a different destination filename if a template with that name already exists. ```sh mkdir -p manual_flows/templates cp workflow-examples/manual-testing/fixtures/profile-review.json "manual_flows/templates/Profile review.json" ``` -------------------------------- ### Open a local trace ZIP with npx flowstride trace Source: https://github.com/heroamogs/flowstride-os/blob/prod/NATIVE_BROWSER.md Use the CLI command to open a local trace ZIP file for inspection. Replace the path with your actual trace file. ```sh npx flowstride trace flowstride-artifacts/example-trace.zip ``` -------------------------------- ### Run real transcription workflow Source: https://github.com/heroamogs/flowstride-os/blob/prod/examples/native-workflows/audio-to-text/README.md Executes the real-transcription template with Chromium. Expected: the application receives the spoken audio and the newly produced transcript contains the known phrase. ```sh npx flowstride run workflow-examples/audio-to-text/templates/real-transcription.flow --browser chromium --ci ``` -------------------------------- ### game.snapshot Source: https://github.com/heroamogs/flowstride-os/blob/prod/NATIVE_CI.md Takes a screenshot of a canvas for comparison with explicit change thresholds. ```APIDOC ## [POST] game.snapshot ### Description Takes a screenshot of a canvas for comparison with explicit change thresholds. ### Method POST ### Endpoint game.snapshot ### Parameters #### Request Body - **canvas** (string) - Required - Canvas selector. - **threshold** (number) - Optional - Change threshold for comparison. ### Request Example { "canvas": "#gameCanvas", "threshold": 0.1 } ### Response #### Success Response (200) - **status** (string) - Description of the action result. #### Response Example { "status": "success" } ``` -------------------------------- ### Copy profile-review.json fixture (PowerShell) Source: https://github.com/heroamogs/flowstride-os/blob/prod/examples/native-workflows/manual-testing/README.md PowerShell equivalent of the shell copy command: creates the manual_flows/templates directory and copies the fixture into it. Use a different destination filename if a template with that name already exists. ```powershell New-Item -ItemType Directory -Force manual_flows/templates Copy-Item workflow-examples/manual-testing/fixtures/profile-review.json "manual_flows/templates/Profile review.json" ``` -------------------------------- ### Flow scenario: Create through API and sign in through UI Source: https://github.com/heroamogs/flowstride-os/blob/prod/examples/native-workflows/api-and-ui/README.md A single .flow scenario that creates a user via API, extracts the response, signs in through the browser, and verifies the backend state. Uses extracted values @createdId and @createdEmail later in the file. Use 'And' for intermediate assertions and 'Then' for the final outcome. ```flow Feature: API and browser in one test Scenario: Create through API and sign in through UI Given "Create a disposable user" flow.post "/api/users" with reqBody; """ { "email": "$randomEmail@example.test", "password": "fixture-password", "name": "Workflow Reader" } """ flow.extract resBody "id" as "createdId"; flow.extract resBody "email" as "createdEmail"; And "Creation succeeds" flow.expect status "201"; When "Sign in through the browser" flow.open "/login"; flow.type input "Email" "@createdEmail"; flow.type input "Password" "fixture-password"; flow.click button "Sign in"; And "The UI shows the created account" flow.expect visible "Welcome, Workflow Reader"; When "Verify backend state from the same test" flow.get "/api/users/@createdId"; Then "The backend recorded the browser login" flow.expect status "200"; flow.expect resBody "loginCount" equals "1"; ``` -------------------------------- ### Accessibility scan and snapshot with baseline Source: https://github.com/heroamogs/flowstride-os/blob/prod/NATIVE_BROWSER.md Runs an axe-based accessibility scan and a snapshot comparison against a reviewed YAML baseline. Scans fail on violations by default; snapshots require a baseline and CI refuses baseline updates. ```flow flow.a11y.scan { "name": "checkout", "include": ["main"], "tags": ["wcag2a", "wcag2aa"] }; flow.a11y.snapshot { "name": "checkout", "selector": "main", "baseline": "baselines/checkout.aria.yml" }; ``` -------------------------------- ### Run negative workflow to confirm wrong transcript fails Source: https://github.com/heroamogs/flowstride-os/blob/prod/examples/native-workflows/audio-to-text/README.md Executes the negative workflow that captures audio but expects a phrase the demo never produces. Must fail and exit nonzero. Use Chromium because Firefox and WebKit reject flow.injectAudio explicitly. ```sh npx flowstride run workflow-examples/audio-to-text/negative/wrong-transcript.flow --browser chromium --ci ``` -------------------------------- ### game.expectVisual Source: https://github.com/heroamogs/flowstride-os/blob/prod/NATIVE_CI.md Compares a canvas screenshot against a baseline with explicit change thresholds. ```APIDOC ## [POST] game.expectVisual ### Description Compares a canvas screenshot against a baseline with explicit change thresholds. ### Method POST ### Endpoint game.expectVisual ### Parameters #### Request Body - **canvas** (string) - Required - Canvas selector. - **threshold** (number) - Optional - Change threshold for comparison. ### Request Example { "canvas": "#gameCanvas", "threshold": 0.1 } ### Response #### Success Response (200) - **status** (string) - Description of the action result. #### Response Example { "status": "success" } ``` -------------------------------- ### Component mount, click, assert, update, and unmount Source: https://github.com/heroamogs/flowstride-os/blob/prod/NATIVE_BROWSER.md Mounts a React component in a local Vite harness, clicks a button, asserts text, updates props, and unmounts. The harness does not load the application Vite config, router, backend, or production build automatically. ```flow flow.component.mount { "framework": "react", "module": "src/components/AccountButton.tsx", "export": "default", "props": { "label": "Open account" } }; flow.click button "Open account"; flow.assert.that { "selector": "button", "condition": "text", "value": "Account opened" }; flow.component.update { "props": { "label": "Updated account" } }; flow.component.unmount {}; ``` -------------------------------- ### game.snapshotState Source: https://github.com/heroamogs/flowstride-os/blob/prod/NATIVE_CI.md Captures selected state for comparison across actions or reloads. ```APIDOC ## [POST] game.snapshotState ### Description Captures selected state for comparison across actions or reloads. ### Method POST ### Endpoint game.snapshotState ### Parameters #### Request Body - **paths** (array) - Required - List of dotted paths to capture. ### Request Example { "paths": ["player.health", "score"] } ### Response #### Success Response (200) - **status** (string) - Description of the action result. #### Response Example { "status": "success" } ``` -------------------------------- ### game.key Source: https://github.com/heroamogs/flowstride-os/blob/prod/NATIVE_CI.md Sends a key press to the game. Supports optional hold duration. ```APIDOC ## [POST] game.key ### Description Sends a key press to the game. Supports optional hold duration. ### Method POST ### Endpoint game.key ### Parameters #### Request Body - **key** (string) - Required - Key name (e.g., "ArrowUp", "Space"). - **holdDuration** (number) - Optional - Duration to hold the key in milliseconds. ### Request Example { "key": "Space", "holdDuration": 100 } ### Response #### Success Response (200) - **status** (string) - Description of the action result. #### Response Example { "status": "success" } ``` -------------------------------- ### Mock requests and wait for network events Source: https://github.com/heroamogs/flowstride-os/blob/prod/NATIVE_BROWSER.md Use flow.network.route to mock a request and flow.network.arm to capture a network event, then wait and expect. Arm before the trigger to capture fast responses; waiters are cleaned up on retry, file completion, and shutdown. Routes accept json, text body, or fixture; URL patterns support * and **. ```flow flow.network.route { "name": "customer-response", "url": "**/api/customer", "method": "GET", "json": { "name": "Documentation Reader" }, "times": 1 }; flow.network.arm { "name": "customer-request", "url": "**/api/customer", "kind": "response" }; flow.click button "Load customer"; flow.network.wait { "name": "customer-request" }; flow.network.expect { "name": "customer-request", "status": 200, "path": "name", "equals": "Documentation Reader" }; ``` -------------------------------- ### Run the adapted workflow template Source: https://github.com/heroamogs/flowstride-os/blob/prod/examples/native-workflows/api-ui-otp/README.md Execute the workflow template explicitly with the CLI. Expected: registration succeeds, the code is retrieved and entered, the application confirms sign-in, and the process exits 0. ```sh npx flowstride run workflow-examples/api-ui-otp/templates/api-ui-otp.flow --ci ``` -------------------------------- ### Clone the repository Source: https://github.com/heroamogs/flowstride-os/blob/prod/CONTRIBUTING.md Clone your forked repository and navigate into the project directory. ```bash git clone https://github.com/YOUR-USERNAME/flowstride-os.git cd flowstride-os ``` -------------------------------- ### game.checkpoint Source: https://github.com/heroamogs/flowstride-os/blob/prod/NATIVE_CI.md Takes a named screenshot, optionally of one canvas. ```APIDOC ## [POST] game.checkpoint ### Description Takes a named screenshot, optionally of one canvas. ### Method POST ### Endpoint game.checkpoint ### Parameters #### Request Body - **name** (string) - Required - Name of the checkpoint. - **canvas** (string) - Optional - Canvas selector to capture. ### Request Example { "name": "level1-start", "canvas": "#gameCanvas" } ### Response #### Success Response (200) - **status** (string) - Description of the action result. #### Response Example { "status": "success" } ``` -------------------------------- ### Enable trace, HAR, and DOM snapshots in browser options Source: https://github.com/heroamogs/flowstride-os/blob/prod/NATIVE_BROWSER.md Configure browser options to record a trace, capture HAR, and take DOM snapshots. Setting serviceWorkers to "block" prevents service workers from interfering with the recording. ```json { "trace": true, "har": true, "domSnapshots": true, "browserOptions": { "serviceWorkers": "block" } } ``` -------------------------------- ### Configure environment variables for API and UI URLs Source: https://github.com/heroamogs/flowstride-os/blob/prod/examples/native-workflows/api-ui-otp/README.md Set the sign-up API endpoint and login page URL in your private .env file. These values are referenced by the workflow template via {{env.SIGNUP_URL}} and {{env.LOGIN_URL}}. ```dotenv SIGNUP_URL=https://your-test-application.example/api/register LOGIN_URL=https://your-test-application.example/login ``` -------------------------------- ### Create and switch browser profiles for separate users Source: https://github.com/heroamogs/flowstride-os/blob/prod/NATIVE_BROWSER.md Use this Flowstride workflow to simulate independent users in one test. A profile is a separate browser context with its own cookies, storage, and pages. Creating a profile selects it; switching profiles returns to that user's page. The original profile is named 'default'. Profiles are reset between files. ```flow flow.browser.create { "name": "customer", "options": { "locale": "en-GB", "colorScheme": "dark" } }; flow.open "/login"; flow.type input "Email" "{{env.CUSTOMER_EMAIL}}"; flow.type input "Password" "{{env.CUSTOMER_PASSWORD}}"; flow.click button "Sign in"; flow.browser.create { "name": "admin" }; flow.open "/admin/login"; flow.browser.use { "name": "customer" }; ``` -------------------------------- ### Configure private application values for real transcription Source: https://github.com/heroamogs/flowstride-os/blob/prod/examples/native-workflows/audio-to-text/README.md Sets the transcription URL and expected transcript as private application values. The recording must be a known spoken PCM WAV at the literal path fixtures/voice-note.wav with a conventional 44-byte header. ```dotenv TRANSCRIPTION_URL=https://your-test-application.example/record EXPECTED_TRANSCRIPT="the known words spoken in the recording" ``` -------------------------------- ### game.select Source: https://github.com/heroamogs/flowstride-os/blob/prod/NATIVE_CI.md Resolves a stable object ID via a game bridge and performs real pointer input. ```APIDOC ## [POST] game.select ### Description Resolves a stable object ID via a game bridge and performs real pointer input. ### Method POST ### Endpoint game.select ### Parameters #### Request Body - **objectId** (string) - Required - Stable object ID. ### Request Example { "objectId": "player-1" } ### Response #### Success Response (200) - **status** (string) - Description of the action result. #### Response Example { "status": "success" } ``` -------------------------------- ### Configure browser options in JSON Source: https://github.com/heroamogs/flowstride-os/blob/prod/NATIVE_BROWSER.md JSON configuration for browser options, including locale, timezone, color scheme, permissions, geolocation, and service workers. 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. ```json { "browser": "chromium", "browserOptions": { "locale": "en-GB", "timezoneId": "Europe/London", "colorScheme": "dark", "permissions": ["geolocation"], "geolocation": { "latitude": 6.5244, "longitude": 3.3792 }, "serviceWorkers": "block" } } ``` -------------------------------- ### game.expectState Source: https://github.com/heroamogs/flowstride-os/blob/prod/NATIVE_CI.md Asserts that the application state matches expected values, optionally using dotted paths. ```APIDOC ## [POST] game.expectState ### Description Asserts that the application state matches expected values, optionally using dotted paths. ### Method POST ### Endpoint game.expectState ### Parameters #### Request Body - **path** (string) - Optional - Dotted path to a specific state value. - **expected** (any) - Required - Expected value. ### Request Example { "path": "player.health", "expected": 100 } ### Response #### Success Response (200) - **status** (string) - Description of the assertion result. #### Response Example { "status": "success" } ``` -------------------------------- ### Run sharded flows on CI machines Source: https://github.com/heroamogs/flowstride-os/blob/prod/NATIVE_BROWSER.md Run each command on its assigned machine. Preserve its summary.json beside its run-* evidence folder. Cancellation stops that job and records an interrupted result. ```sh npx flowstride run flows --ci --shard 1/3 ``` ```sh npx flowstride run flows --ci --shard 2/3 ``` ```sh npx flowstride run flows --ci --shard 3/3 ``` -------------------------------- ### Merge shard summaries Source: https://github.com/heroamogs/flowstride-os/blob/prod/NATIVE_BROWSER.md Collect all shards for one browser configuration into separate project directories and merge. Merging rejects missing/duplicate shards, mixed source suites and mixed browser configurations. A failed or interrupted shard cannot become a passing merge. ```sh npx flowstride merge shard-1/summary.json shard-2/summary.json shard-3/summary.json ``` -------------------------------- ### Run restore flow with npx flowstride Source: https://github.com/heroamogs/flowstride-os/blob/prod/examples/native-workflows/variables-and-reuse/README.md Executes the restore flow in a fresh CLI invocation. This restores the saved browser snapshot in a new process. ```sh npx flowstride run workflow-examples/variables-and-reuse/sessions/restore.flow --ci ``` -------------------------------- ### Run session-saving flow with npx flowstride Source: https://github.com/heroamogs/flowstride-os/blob/prod/examples/native-workflows/variables-and-reuse/README.md Executes the session-saving flow in CI mode. The flow creates a demo user, signs in through the UI, and saves the browser session. ```sh npx flowstride run workflow-examples/variables-and-reuse/sessions/save.flow --ci ``` -------------------------------- ### Configure environment for existing account OTP Source: https://github.com/heroamogs/flowstride-os/blob/prod/examples/native-workflows/api-ui-otp/README.md Set these environment variables to use a preapproved test account with the existing-account-otp.flow template. The account must require an email OTP challenge; an account that signs in directly does not exercise email delivery or retrieval. ```dotenv LOGIN_URL=https://your-test-application.example/login OTP_TEST_EMAIL=your-supported-test-address@flowstridemail.com OTP_TEST_PASSWORD=replace-with-the-application-test-password ``` -------------------------------- ### Flow workflow: register, sign in, and verify email OTP Source: https://github.com/heroamogs/flowstride-os/blob/prod/examples/native-workflows/api-ui-otp/README.md Complete application template that registers a test account via API, signs in through the UI, retrieves the OTP with flow.mail.getOtp, submits it, and asserts successful authentication. Requires your application's real routes and selectors. The address suffix must stay consistent between registration, UI sign-in, and inbox polling. ```flow Feature: Register through an application API and verify an email OTP in the UI Scenario: Complete an email-verified sign-in with a disposable account Given "The application creates an active test account" flow.post "{{env.SIGNUP_URL}}" with reqBody; """ { "firstName": "Example", "lastName": "Reader", "email": "$randomEmail@flowstridemail.com", "password": "$randomPassword" } """ flow.extract resBody "userId" as "newUserId"; flow.expect status "201"; When "Open the application's sign-in form" flow.open "{{env.LOGIN_URL}}"; flow.type input "Email" "@randomEmail@flowstridemail.com"; flow.type input "Password" "@randomPassword"; flow.click button "Login"; When "Retrieve the delivered code through FlowMail" flow.mail.getOtp "@randomEmail@flowstridemail.com" into "loginOtp"; When "Submit the retrieved code" flow.type input "Enter 6-digit OTP" "@loginOtp"; flow.click button "Verify OTP"; Then "The application confirms successful authentication" flow.expect visible "Logout"; ``` -------------------------------- ### Register built-in game alias Source: https://github.com/heroamogs/flowstride-os/blob/prod/NATIVE_CI.md Registers the built-in alias for the game API. Use this before accessing game actions like tap, drag, key, checkpoint, snapshot, state, fixture, and select. ```text let game = "flowstride:game"; ``` -------------------------------- ### flow.network.arm Source: https://github.com/heroamogs/flowstride-os/blob/prod/NATIVE_BROWSER.md Arm a network event waiter before triggering an action, to capture fast responses. Supports waiting for request or response events with optional filters. ```APIDOC ## flow.network.arm ### Description Arm a network event waiter before triggering an action, to capture fast responses. Supports waiting for request or response events with optional filters. ### Method flow.network.arm ### Parameters #### Request Body - **name** (string) - Required - Unique name for the waiter. - **url** (string) - Required - URL pattern to match. - **kind** (string) - Optional - Event kind: `response` (default) or `request`. - **method** (string) - Optional - HTTP method to filter. - **status** (number) - Optional - Response status filter. - **timeout** (number) - Optional - Timeout in milliseconds. ### Request Example ```json { "name": "customer-request", "url": "**/api/customer", "kind": "response" } ``` ### Response #### Success Response - **status** (string) - "success" if armed. #### Response Example ```json { "status": "success" } ``` ``` -------------------------------- ### Run tests in CI mode Source: https://github.com/heroamogs/flowstride-os/blob/prod/README.md Run tests headlessly in CI. Returns a nonzero exit code for failed or interrupted execution, and writes JSON and JUnit reports to flowstride-artifacts by default. ```sh npx flowstride run flows --ci ``` -------------------------------- ### Register and call the iframe plugin (explicit-frame-plugin.flow) Source: https://github.com/heroamogs/flowstride-os/blob/prod/examples/native-workflows/iframes/README.md Registers the `frame-actions.ts` plugin and calls it to click a CSS target in the selected child frame. Run with `npx flowstride run workflow-examples/iframes/flows/explicit-frame-plugin.flow --ci`; expected output is the same child-frame result passing. This is a project extension for the explicit action; it uses the normal Flowstride runner and requires no private runner imports. ```flow Feature: An explicit iframe action through a focused project plugin let frameActions = "workflow-examples/iframes/plugins/frame-actions.ts"; Scenario: Click a CSS target in the selected child frame Given "The embedded profile is open" flow.open "/frames"; When "Click the explicit child-frame selector" frameActions.click { "frame": "#profile-frame", "selector": "#frame-only" }; Then "The selected frame shows its result" flow.assert.that { "frame": "#profile-frame", "selector": "#frame-result", "condition": "text", "value": "Clicked in frame" }; ``` ```sh npx flowstride run workflow-examples/iframes/flows/explicit-frame-plugin.flow --ci ``` -------------------------------- ### Run existing-account-otp.flow with npx flowstride Source: https://github.com/heroamogs/flowstride-os/blob/prod/examples/native-workflows/api-ui-otp/README.md Execute the existing-account-otp.flow template in CI mode. The chosen account must require an email OTP challenge; an account that signs in directly does not exercise email delivery or retrieval. ```sh npx flowstride run workflow-examples/api-ui-otp/templates/existing-account-otp.flow --ci ``` -------------------------------- ### Configure scenario retries and flaky failure Source: https://github.com/heroamogs/flowstride-os/blob/prod/NATIVE_BROWSER.md JSON configuration to enable one retry per scenario and fail CI on flaky outcomes. Retries are disabled by default; a retry reruns the entire failed scenario, restores browser profiles/storage and local variables, and retains previous attempt diagnostics. A later pass is marked flaky, and failOnFlaky turns it into a failing CI outcome. ```json { "retries": 1, "failOnFlaky": true } ``` -------------------------------- ### game.state Source: https://github.com/heroamogs/flowstride-os/blob/prod/NATIVE_CI.md Retrieves exposed application state, optionally using dotted paths. ```APIDOC ## [GET] game.state ### Description Retrieves exposed application state, optionally using dotted paths. ### Method GET ### Endpoint game.state ### Parameters #### Query Parameters - **path** (string) - Optional - Dotted path to a specific state value. ### Request Example GET /game.state?path=player.health ### Response #### Success Response (200) - **state** (object) - The application state or the value at the specified path. #### Response Example { "state": { "player": { "health": 100 } } } ``` -------------------------------- ### game.expectPreserved Source: https://github.com/heroamogs/flowstride-os/blob/prod/NATIVE_CI.md Asserts that selected state remains unchanged across actions or reloads. ```APIDOC ## [POST] game.expectPreserved ### Description Asserts that selected state remains unchanged across actions or reloads. ### Method POST ### Endpoint game.expectPreserved ### Parameters #### Request Body - **paths** (array) - Required - List of dotted paths to verify. ### Request Example { "paths": ["player.health", "score"] } ### Response #### Success Response (200) - **status** (string) - Description of the assertion result. #### Response Example { "status": "success" } ``` -------------------------------- ### registerGame Source: https://github.com/heroamogs/flowstride-os/blob/prod/NATIVE_CI.md Registers a game bridge for a generic browser game. Supply readState and optional test-only fixtures. ```APIDOC ## registerGame ### Description Registers a game bridge for a generic browser game. Supply readState and optional test-only fixtures. ### Method registerGame ### Endpoint flowstride/dist/game/bridge.js ### Parameters #### Request Body - **readState** (function) - Required - Function to read application state. - **fixtures** (object) - Optional - Test-only fixtures. ### Request Example import { registerGame } from 'flowstride/dist/game/bridge.js'; registerGame({ readState: () => ({ player: { health: 100 } }) }); ### Response #### Success Response (200) - **status** (string) - Description of the registration result. #### Response Example { "status": "success" } ``` -------------------------------- ### Run flows with headed Firefox and WebKit Source: https://github.com/heroamogs/flowstride-os/blob/prod/NATIVE_BROWSER.md Run flows with the Firefox or WebKit engine in headed mode to see the application's own browser window. 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. ```sh npx flowstride run flows --browser firefox --headed npx flowstride run flows --browser webkit --headed ``` -------------------------------- ### game.tap Source: https://github.com/heroamogs/flowstride-os/blob/prod/NATIVE_CI.md Performs a tap action on a canvas at specified coordinates. Coordinates are relative by default, or can be specified in pixels. ```APIDOC ## [POST] game.tap ### Description Performs a tap action on a canvas at specified coordinates. Coordinates are relative by default, or can be specified in pixels. ### Method POST ### Endpoint game.tap ### Parameters #### Request Body - **canvas** (string) - Required - Canvas selector. - **coordinates** (object) - Required - Coordinates for the tap. - **x** (number) - Required - X coordinate. - **y** (number) - Required - Y coordinate. - **unit** (string) - Optional - Coordinate unit: "relative" (default) or "pixels". ### Request Example { "canvas": "#gameCanvas", "coordinates": { "x": 0.5, "y": 0.5 }, "unit": "relative" } ### Response #### Success Response (200) - **status** (string) - Description of the action result. #### Response Example { "status": "success" } ``` -------------------------------- ### Restore persisted account with flow.use session Source: https://github.com/heroamogs/flowstride-os/blob/prod/examples/native-workflows/variables-and-reuse/README.md Loads the saved browser state and verifies the signed-in account and storage values. The flow expects the dashboard to show the welcome message and storage attributes. ```flow Feature: Restore a persisted account Scenario: Restore in a fresh process Given "Load the saved browser state" flow.use session "workflow-reader"; When "Open the account page" flow.open "/dashboard"; Then "Cookies and both storage types are restored" flow.expect visible "Welcome, Workflow Reader"; flow.expect attribute "#storage" "data-mode" "signed-in"; flow.expect attribute "#storage" "data-session" "active"; ``` -------------------------------- ### game.fixture Source: https://github.com/heroamogs/flowstride-os/blob/prod/NATIVE_CI.md Uses a named fixture explicitly registered by the application in test mode. ```APIDOC ## [POST] game.fixture ### Description Uses a named fixture explicitly registered by the application in test mode. ### Method POST ### Endpoint game.fixture ### Parameters #### Request Body - **name** (string) - Required - Name of the fixture. ### Request Example { "name": "level1-data" } ### Response #### Success Response (200) - **status** (string) - Description of the action result. #### Response Example { "status": "success" } ```