Structured command index
Flowstride (FS) and Flowstride Pro accept the same built-in structured commands. A structured command takes a JSON object containing named inputs. An assertion verifies a result. Other structured commands can send a request, configure a browser, capture evidence or prepare test data.
flow.assert.that {
"target": "Order summary",
"condition": "visible",
"timeout": 5000
};Put the command inside a valid .flow scenario. Use JSON double quotes and type booleans and numbers as true and 5000. Use {} for commands that take no settings. Keep one Feature at the top of the file and use the normal scenario structure. An intermediate And is for assertions. Then is the last block of its scenario and can hold multiple commands.
Readable targeting
Start with the label or text a tester can see. When two controls have the same label, add the element type, a named container or a spatial relationship.
flow.assert.that {
"target": {
"text": "Submit",
"element": "button",
"inside": "Checkout",
"under": "Password"
},
"condition": "enabled"
};Use inside for containment. You can add one of near, above, under (or below), leftOf and rightOf for layout. These relationships depend on the current page layout. Supported element values in a readable object are button, link (or a), input (or field), div, span, image (or img), text, table, tr, th, td and iframe.
For a browser assertion, role with an optional exact accessible name is another way to identify the control. If readable or semantic targeting cannot uniquely identify it, supply an explicit selector to a command that supports selector. Use it as an alternative to target.
flow.assert.that {
"selector": "[data-testid='checkout-submit']",
"condition": "enabled"
};Each link below leads to its inputs and an example. The structured assertions reference keeps all checks, including every flow.assert.that condition, on one page.
Assertions and comparisons
| Task | Commands |
|---|---|
| Browser conditions | flow.assert.that |
| Stored values | flow.assert.value |
| Dialog | flow.dialog.expect |
| Network traffic | flow.network.expect |
| Downloads | flow.download.expect |
| Spies and stubs | flow.stub.expect |
| JSON Schema | flow.api.expectSchema |
| API polling | flow.api.poll |
| Console messages | flow.console.expect |
| Live messages | flow.channel.expect |
| Accessibility scan | flow.a11y.scan |
| ARIA snapshot | flow.a11y.snapshot |
| ARIA match | flow.a11y.match |
| Visual comparison | flow.visual.match |
Browser interactions and scope
| Task | Commands |
|---|---|
| Configurable typing | flow.input.type |
| Scrolling | flow.scroll |
| Named tabs | flow.tab.name, flow.tab.arm, flow.tab.use, flow.tab.close |
| Frames | flow.frame.use, flow.frame.main |
| Dialog capture | flow.dialog.arm |
Files, data and suite control
| Task | Commands |
|---|---|
| File selection | flow.files.select |
| Fixture data | flow.data.load |
| Local file inspection | flow.file.read |
| Data-driven scenarios | flow.data.cases |
| Cleanup | flow.cleanup.register |
| Conditional skips | flow.skipIf |
API and browser network
| Task | Commands |
|---|---|
| Request and body formats | flow.api.request |
| Named API contexts | flow.api.create, flow.api.use, flow.api.close |
| Routes | flow.network.route, flow.network.unroute |
| Browser request and response capture | flow.network.arm, flow.network.wait |
Application evidence
| Task | Commands |
|---|---|
| Console observer | flow.console.arm |
| WebSocket and SSE observers | flow.channel.arm |
| Visual capture | flow.visual.capture |
Profiles, downloads and browser tools
| Task | Commands |
|---|---|
| Browser profiles and permissions | flow.browser.create, flow.browser.use, flow.browser.close, flow.browser.list, flow.browser.offline, flow.browser.permissions, flow.browser.clearPermissions, flow.browser.geolocation |
| Download capture and save | flow.download.arm, flow.download.save |
| Clock control | flow.clock.install, flow.clock.pauseAt, flow.clock.resume, flow.clock.runFor, flow.clock.fastForward, flow.clock.setFixedTime, flow.clock.setSystemTime |
| Function spies and stubs | flow.stub.install, flow.stub.restore |
| Trace evidence | flow.trace.start, flow.trace.stop |
| HAR replay | flow.har.replay |
| Components | flow.component.mount, flow.component.update, flow.component.unmount |
Game commands
The built-in game module also uses objects. Declare let game = "flowstride:game" in the flow. The following commands work with the application’s canvas and, where needed, its game bridge.
| Task | Commands and examples |
|---|---|
| Canvas input | game.tap, game.drag, game.swipe and game.key |
| Capture or compare pixels | game.checkpoint and game.snapshot, game.expectVisual |
| Read and save game state | game.state and game.snapshotState |
| Verify game state or persistence | game.expectState, game.expectPreserved |
| Prepare test state and pick a Three.js object | game.fixture, game.select |
Related commands with keyword syntax
These additions use quoted values or keywords outside a JSON object. They can be combined with any structured workflow that uses the same runner or browser scope.
| Task | Commands and examples |
|---|---|
| Read a browser property or a captured response field | flow.extract property and flow.extract network |
| Record a failed check and continue | flow.soft |
| Set a delay, log a test note, pause or pace actions | flow.wait, flow.log, flow.pause and flow.pace |
| Press a key, clear or focus a control, and use pointer actions | flow.press, flow.clear, flow.focus, flow.blur, flow.doubleClick and flow.rightClick |
| Navigate browser history | flow.goBack, flow.goForward and flow.reload |
| Reproduce generated data | flow.data.seed |
| Reuse a command fragment | flow.call |
| Select scenarios from the CLI | Tags: and --tag |
The browser and API indexes cover established keyword commands. Projects can also define their own object arguments through the plugin SDK.
