๐ฌ .selectPlatform(options)
This is a proposal for functionality that may be implemented in the future.
TODO: Description here.
Usage
utils.selectPlatform(options)
Parameters
options
(Object?
):options.ios
(Function?
): TODO: Description here.options.android
(Function?
): TODO: Description here.options.web
(Function?
): TODO: Description here.options.native
(Function?
): TODO: Description here.
Returns
Any
: TODO: Description here.
Support
Platform | Supported |
---|---|
iOS | Yes |
Android | Yes |
Web | Yes |
Examples
Handle differing matcher between platforms:
const { element, by, utils } = require("appdriver");
(async () => {
const matcher = utils.selectPlatform({
ios: () => by.label("button"),
android: () => by.id("button")
});
await element(matcher).tap();
})();
Group iOS and Android together:
const { element, by, utils } = require("appdriver");
(async () => {
const matcher = utils.selectPlatform({
native: () => by.label("button"),
web: () => by.css(".button")
});
await element(matcher).tap();
})();