Skip to main content
@quiesco/vitest is the recommended runner. Tests are TypeScript, and they reach the app through the app fixture. It needs Vitest 5.1 or later.

Setup

quiesco init --runner vitest installs @quiesco/vitest and vitest, and writes two files:
If the project already has a vitest.config.* for its unit tests, init writes Quiesco’s config to vitest.e2e.config.mts instead, and the e2e:* scripts pass --config vitest.e2e.config.mts.

quiesco()

Types: QuiescoVitestOptions · QuiescoTestConfig quiesco() returns the test options Quiesco needs. Spread it into test and add your own options after it.
number
default:"1"
How many workers run test files in parallel, each on a device of its own (parallel runs). 1 runs the files one at a time.
number
default:"300000"
Timeout of each test and hook, in ms. The first test also waits for the session to start, and booting a device can take minutes.
object
The tag names, when quiesco.config.mts renames them with tags. Pass the same object here.
string[]
Tags of your own to declare, e.g. ['@smoke']. Vitest only accepts declared tags; the platform and browser tags are declared already.
What it sets: --fileParallelism --maxWorkers N on the command line overrides workers.

quiescoPlugin()

Types: QuiescoVitestPlugin Sends the run’s progress to the progress bar of quiesco test and to quiesco ui. It adds its reporter only when one of them runs Vitest, next to your own reporters. Without it, the tests still run, and quiesco test prints a hint at the end.

Hooks for every file

Because of isolate: false, test files share their modules. A support module imported by every file runs only once per worker, so a test.beforeEach(…) at its top level is registered for the first file that imports it, and the other files run without it, silently. Register such hooks in each test file, or in a setup file, which Vitest runs before every file:
Something that runs once for the whole run, such as a mock backend, goes in globalSetup (see the example app).

Writing tests

Import test (or it), describe and expect from @quiesco/vitest. Two fixtures reach the app:
  • app: the Driver.
  • session: the session, for what the Driver does not cover (session.platform, …).
Before each test that uses one of them, the app is reset. After a failed test, the evidence (screenshot, element tree, idle state, logs) is written to the artifacts directory and listed in the failure message. Platform tags go in the test or describe title, or in the test’s tags option:

Running

quiesco test sets QUIESCO_PLATFORM and runs vitest run; other arguments go to Vitest (quiesco test). Running npx vitest run yourself also works with QUIESCO_PLATFORM set, but then Metro is not started for you.