app
The portable app lifecycle fixture, available on every platform.
The app fixture opens, restarts, and resets the app under test, and takes
screenshots and recordings. It is on every target. A method the engine can’t perform fails
with UNSUPPORTED_CAPABILITY.
Reference
open, restart, and clearState are bounded by timeout. The others
are bounded by actionTimeout. Both come from the
config: timeout defaults to 120000 ms and
actionTimeout to 30000 ms. The remaining test timeout caps both. app
methods take no per-call timeout option.
baseUrl
The resolved base URL of the target’s app.
- When
app.urldeclares port0,baseUrlcarries the port the run allocated. - On a target that declares no
app.url, it isundefined.
open
Opens the app: the declared URL, a path relative to it, or any absolute
http(s) URL.
On a device target, which has no URL, open() launches the pinned app fresh
and takes no path.
restart
Recreates the execution context and keeps persisted state. Then it reopens the app at its base URL when the target declares one.
clearState
Clears persisted client state and recreates the execution context. Then it reopens the app at its base URL when the target declares one.
clearState inside a serial group destroys the shared state the group
depends on. Use it in beforeEach of an ordinary group instead.
back
Navigates back once.
screenshot
Captures a redacted evidence screenshot and returns its path.
- The file is an attempt artifact under
screenshots/. The returned path is absolute. The report records the path relative to the artifact root. labelnames the step and joins the file name.
The screenshot masks secure fields only, after a Secret fill too. A secret
the app shows anywhere else is in the image. See
screenshots after a secret fill.
startRecording
Starts recording the screen, until stopRecording.
- One recording at a time. The engine has one recorder, so set
video: 'off'on the test: a start fails while the test’s video records. That includes--video,retain-on-failure, and the retrieson-first-retryrecords. - A recording still running when the test ends is stopped and kept.
- Like the test’s video, a recording masks nothing.
stopRecording
Stops the recording and returns its videos, in play order.
- A video is a file (
path, absolute) under the attempt’srecordings/, named001-<name>.<ext>, or aurlwhen a hosted browser or device keeps the recording. - There is one video, except on the web when the page was replaced while
it recorded (
app.restart(),app.clearState()): then one per page. - The step links each video in the trace.
Types
Related
Browser-only operations live on the browser fixture, and
device operations on device.
