@quiesco/cucumber runs Gherkin features with cucumber-js. Steps reach the app through this.app. It
needs @cucumber/cucumber 12 or later.
Setup
quiesco init --runner cucumber installs @quiesco/cucumber and @cucumber/cucumber, and writes:
It also adds
"allowImportingTsExtensions": true to tsconfig.json, because step files import each other
with .ts (see TypeScript).
features/**/*.feature, cucumber-js’s default. Do not set paths here: paths from
the config are merged with the ones on the command line, so quiesco test features/x.feature would run
every feature.
registerQuiesco()
RegisterOptions · Lifecycle
import '@quiesco/cucumber/register' registers everything with the defaults. To change them, call
registerQuiesco() in the support file instead (not both):
Your own World (see below).
The default timeout of a step. Each Driver call has its own sync timeout; this caps the whole step.
Timeout of the
BeforeAll hook that starts the session. Booting an emulator can take minutes.Timeout of the reset before each scenario. It can start the app again when it is gone, which waits up to
three times the connect timeout.
The World
QuiescoWorld gives every step:
this.app: the Driver.this.platform:'ios','android'or'web', for a step that does the same thing differently per platform. Scenarios for one platform only are better tagged (@ios, …).this.session: the session, for what the Driver does not cover.
world:
TypeScript
Step and support files run with Node’s type stripping, nottsc:
- Relative imports name the
.tsfile:import { TodoDriver } from './todo-driver.ts'. - TypeScript syntax that generates code is not supported: parameter properties
(
constructor(private app: Driver)),enum,namespace. Declare fields instead.
Tags
Platform and browser tags go on the feature, aRule, the scenario or an Examples block; the innermost
one decides (scenario tags). @hard-reset relaunches the app before that scenario.
Running
quiesco test sets QUIESCO_PLATFORM, runs cucumber-js and adds Quiesco’s progress formatter by itself;
other arguments go to cucumber-js, e.g. --tags @smoke or a feature file
(quiesco test). --workers N becomes --parallel N: N worker threads, each with
a session and a device of its own (parallel runs).