Skip to main content
Version: 20.x

System

System APIs allows you to interact with dialogs in the system-level (e.g. permissions, alerts, etc.).

Experimental

System APIs are currently in an experimental phase. This means that the API is not yet final and may change over minor releases.

note

System APIs are only available on iOS. Android support is coming soon.

At the moment, System APIs are limited to system dialogs (e.g. permissions, alerts, etc.). We plan to expand the System APIs to include more system-level interactions in the future, such as OS browser (Safari / Chrome), interactions with push notifications, photo library, etc.

Matchers

System matchers are used to find elements within the system:

by.system.label(label)

Match elements with the specified label.

system.element(by.system.label('Dismiss'));

by.system.type(type)

Match elements with the specified type.

The type value can be any of XCUIElement.ElementType values, such as 'button' or 'textField'.

system.element(by.system.type('button'));

Actions

System actions are used to interact with elements within the system:

tap()

Tap on the element.

system.element(by.system.label('Allow')).tap();

Expectations

System expectations are used to assert the state of elements within the system:

toExist()

Asserts that the element exists.

await expect(system.element(by.system.label('Allow'))).toExist();

not

Negates the expectation.

await expect(system.element(by.system.label('Allow'))).not.toExist();