Skip to content

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
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
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
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 ​

TaskCommands
Browser conditionsflow.assert.that
Stored valuesflow.assert.value
Dialogflow.dialog.expect
Network trafficflow.network.expect
Downloadsflow.download.expect
Spies and stubsflow.stub.expect
JSON Schemaflow.api.expectSchema
API pollingflow.api.poll
Console messagesflow.console.expect
Live messagesflow.channel.expect
Accessibility scanflow.a11y.scan
ARIA snapshotflow.a11y.snapshot
ARIA matchflow.a11y.match
Visual comparisonflow.visual.match

Browser interactions and scope ​

TaskCommands
Configurable typingflow.input.type
Scrollingflow.scroll
Named tabsflow.tab.name, flow.tab.arm, flow.tab.use, flow.tab.close
Framesflow.frame.use, flow.frame.main
Dialog captureflow.dialog.arm

Files, data and suite control ​

TaskCommands
File selectionflow.files.select
Fixture dataflow.data.load
Local file inspectionflow.file.read
Data-driven scenariosflow.data.cases
Cleanupflow.cleanup.register
Conditional skipsflow.skipIf

API and browser network ​

TaskCommands
Request and body formatsflow.api.request
Named API contextsflow.api.create, flow.api.use, flow.api.close
Routesflow.network.route, flow.network.unroute
Browser request and response captureflow.network.arm, flow.network.wait

Application evidence ​

TaskCommands
Console observerflow.console.arm
WebSocket and SSE observersflow.channel.arm
Visual captureflow.visual.capture

Profiles, downloads and browser tools ​

TaskCommands
Browser profiles and permissionsflow.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 saveflow.download.arm, flow.download.save
Clock controlflow.clock.install, flow.clock.pauseAt, flow.clock.resume, flow.clock.runFor, flow.clock.fastForward, flow.clock.setFixedTime, flow.clock.setSystemTime
Function spies and stubsflow.stub.install, flow.stub.restore
Trace evidenceflow.trace.start, flow.trace.stop
HAR replayflow.har.replay
Componentsflow.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.

TaskCommands and examples
Canvas inputgame.tap, game.drag, game.swipe and game.key
Capture or compare pixelsgame.checkpoint and game.snapshot, game.expectVisual
Read and save game stategame.state and game.snapshotState
Verify game state or persistencegame.expectState, game.expectPreserved
Prepare test state and pick a Three.js objectgame.fixture, game.select

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.

TaskCommands and examples
Read a browser property or a captured response fieldflow.extract property and flow.extract network
Record a failed check and continueflow.soft
Set a delay, log a test note, pause or pace actionsflow.wait, flow.log, flow.pause and flow.pace
Press a key, clear or focus a control, and use pointer actionsflow.press, flow.clear, flow.focus, flow.blur, flow.doubleClick and flow.rightClick
Navigate browser historyflow.goBack, flow.goForward and flow.reload
Reproduce generated dataflow.data.seed
Reuse a command fragmentflow.call
Select scenarios from the CLITags: and --tag

The browser and API indexes cover established keyword commands. Projects can also define their own object arguments through the plugin SDK.

Flowstride is MIT licensed. Flowstride Cloud offers free and paid workspace plans.