Skip to main content
A fixture is the state your app is in before a check’s steps begin: signed in, a cart with two items, a clean install. It can reset the app, add launch arguments, copy seed files, empty the keychain, set the pasteboard and run sign-in steps.

Write a fixture

Write it once in .mobster/fixtures/:
Then name it in each check that needs it:

What a fixture holds

A sign-in uses the project’s secrets: ${TEST_EMAIL} and ${TEST_PASSWORD} come from mobster env (Checks), are filled in when the run starts, and never reach a report. Fixtures compose in the order you name them. reset and a nonempty pasteboard take the last one set. Keychain resets, args and steps add up. dialogs merge key by key, a later fixture first and the check last. env and a file’s destination are replaced by a later fixture. A fixture used twice runs once, and a circle (a extends b extends a) is refused with the chain.

List and apply fixtures

mobster fixtures apply sets up a simulator now, without a check: it resets the app, resets the keychain, copies the files and sets the pasteboard. It doesn’t launch the app, and leaves a fixture’s args, env and steps for a check to use:
The file in the app’s container then reads {"items": 2}, and xcrun simctl pbpaste prints SAVE10. The first run on a simulator also builds WebDriverAgent, which takes about 2 minutes. --json prints the list as JSON. GET /api/tests/fixtures?project=/abs/path returns it to Mobster for Mac: each fixture’s flattened reset, args, env, steps, files, keychain, dialogs, destructive, and whether a pasteboard is set, never its text. Apply in a project’s Fixtures section in Mobster for Mac runs mobster fixtures apply on a Mobster simulator. A fixture that erases data, reinstalls the app, resets the keychain, replaces files or sets the pasteboard asks first and says which. It sends POST /api/tests/fixtures/apply with {project, names, bundle?, sim?}, which needs Mobster for Mac’s session. bundle is the project’s app unless you name one. It answers when the simulator is ready, applies one fixture set at a time (409 busy), never takes an iPhone and never waits for a simulator a check holds.

Use fixtures on your iPhone

On a phone, launch arguments, environment and steps work, so a sign-in fixture runs there. A reset, seed files, a keychain reset and a pasteboard change the device’s state, so they run on simulators only. A check on a real iPhone whose fixture holds any of them doesn’t run, and says why before it touches the phone:
Files go only inside the app’s data container on a simulator Mobster made. A destination that leaves the container, a symbolic link in the way, a source outside .mobster/fixtures/ and more than 20 MB are refused, and nothing is copied.