Adjust the config like this
import { longPress } from "./longPress";
export const config: WebdriverIO.Config = {
//...
before: function (capabilities, specs) {
[Appium] Welcome to Appium v1.18.3 | |
[Appium] Non-default server args: | |
[Appium] basePath: / | |
[Appium] Appium REST http interface listener started on 0.0.0.0:4723 | |
[HTTP] --> POST /session | |
[HTTP] {"capabilities":{"alwaysMatch":{"automationName":"UiAutomator2","deviceName":"Pixel_3_10.0","platformName":"Android","platformVersion":"10.0","orientation":"PORTRAIT","app":"/Users/wimselles/Sauce/Git/SauceLabsHybridApp/apps/Android.SauceLabs.Hybrid.app.1.0.0.apk","appWaitActivity":"com.saucelabshybridapp.MainActivity","noReset":true,"autoGrantPermissions":true,"newCommandTimeout":240,"language":"en","locale":"en"},"firstMatch":[{}]},"desiredCapabilities":{"automationName":"UiAutomator2","deviceName":"Pixel_3_10.0","platformName":"Android","platformVersion":"10.0","orientation":"PORTRAIT","app":"/Users/wimselles/Sauce/Git/SauceLabsHybridApp/apps/Android.SauceLabs.Hybrid.app.1.0.0.apk","appWaitActivity":"com.saucelabshybridapp.MainActivity","noReset":true,"autoGrantPermissions":true,"newCommandTimeout":240,"language":"en |
// You can download the app from here | |
// http://appium.s3.amazonaws.com/ApiDemos-debug-2015-03-19.apk | |
// | |
// If you want to use the app, make sure you add this into your capabilities | |
// appActivity: '.graphics.FingerPaint', | |
// This will make sure that the FingerPaint screen is opened at once! | |
// | |
// Thanks to Jonathan Lipps for this Article | |
// https://appiumpro.com/editions/29 |
[HTTP] --> POST /wd/hub/session | |
[HTTP] {"capabilities":{"alwaysMatch":{"platformName":"iOS","appium:deviceName":"iPhone X","appium:platformVersion":"12.2","appium:orientation":"PORTRAIT","appium:automationName":"XCUITest","appium:app":"/Users/wimselles/Git/wdio-native-demo-app/ios/build/wdioDemoApp/Build/Products/Debug-iphonesimulator/wdioDemoApp.app","appium:newCommandTimeout":240},"firstMatch":[{}]},"desiredCapabilities":{"platformName":"iOS","appium:deviceName":"iPhone X","appium:platformVersion":"12.2","appium:orientation":"PORTRAIT","appium:automationName":"XCUITest","appium:app":"/Users/wimselles/Git/wdio-native-demo-app/ios/build/wdioDemoApp/Build/Products/Debug-iphonesimulator/wdioDemoApp.app","appium:newCommandTimeout":240}} | |
[debug] [W3C] Calling AppiumDriver.createSession() with args: [{"platformName":"iOS","appium:deviceName":"iPhone X","appium:platformVersion":"12.2","appium:orientation":"PORTRAIT","appium:automationName":"XCUITest","appium:app":"/Users/wimselles/Git/wdio-native-demo-app/ios/build |
[debug] [W3C (0bedd823)] Responding to client with driver.createSession() result: {"capabilities":{"webStorageEnabled":false,"locationContextEnabled":false,"browserName":"","platform":"MAC","javascriptEnabled":true,"databaseEnabled":false,"takesScreenshot":true,"networkConnectionEnabled":false,"platformName":"iOS","deviceName":"iPhone X","platformVersion":"12.2","orientation":"PORTRAIT","automationName":"XCUITest","app":"/Users/wimselles/Sauce/Git/appium-boilerplate/apps/iOS-Simulator-NativeDemoApp-0.3.0.app.zip","newCommandTimeout":240,"udid":"EAE23CD4-7B34-42D6-BBFB-F74B1543944D"}} | |
[HTTP] <-- POST /wd/hub/session 200 98636 ms - 569 | |
[HTTP] | |
[HTTP] --> POST /wd/hub/session/0bedd823-3af4-4e59-a0c0-f9cfc370c6d6/element | |
[HTTP] {"using":"accessibility id","value":"Home, tab, 1 of 5"} | |
[debug] [W3C (0bedd823)] Calling AppiumDriver.findElement() with args: ["accessibility id","Home, tab, 1 of 5","0bedd823-3af4-4e59-a0c0-f9cfc370c6d6"] | |
[debug] [XCUITest] Executing command 'findElement' | |
[debug] [BaseDriver] Valid locat |
[Appium] Welcome to Appium v1.14.0 | |
[Appium] Non-default server args: | |
[Appium] chromedriverExecutable: ./chromedriver | |
[Appium] Appium REST http interface listener started on 0.0.0.0:4723 | |
[HTTP] --> POST /wd/hub/session | |
[HTTP] {"capabilities":{"alwaysMatch":{"deviceName":"iPhone X","platformName":"iOS","platformVersion":"12.2","orientation":"PORTRAIT","app":"/Users/wimselles/Sauce/Git/webdriverio-5-playground/apps/iOS.Simulator.SauceLabs.Mobile.Sample.app.2.1.0.app.zip","noReset":true,"newCommandTimeout":240,"fullContextList":true},"firstMatch":[{}]},"desiredCapabilities":{"deviceName":"iPhone X","platformName":"iOS","platformVersion":"12.2","orientation":"PORTRAIT","app":"/Users/wimselles/Sauce/Git/webdriverio-5-playground/apps/iOS.Simulator.SauceLabs.Mobile.Sample.app.2.1.0.app.zip","noReset":true,"newCommandTimeout":240,"fullContextList":true}} | |
[debug] [W3C] Calling AppiumDriver.createSession() with args: [{"deviceName":"iPhone X","platformName":"iOS","platformVersion":"12.2","orientation":"PORTRAIT","app" |
[HTTP] --> POST /wd/hub/session | |
[HTTP] {"capabilities":{"alwaysMatch":{"deviceName":"iPhone X","platformName":"iOS","platformVersion":"12.2","orientation":"PORTRAIT","app":"/Users/wimselles/Sauce/Git/webdriverio-5-playground/apps/iOS.Simulator.SauceLabs.Mobile.Sample.app.1.0.0.app.zip","noReset":true,"newCommandTimeout":240},"firstMatch":[{}]},"desiredCapabilities":{"deviceName":"iPhone X","platformName":"iOS","platformVersion":"12.2","orientation":"PORTRAIT","app":"/Users/wimselles/Sauce/Git/webdriverio-5-playground/apps/iOS.Simulator.SauceLabs.Mobile.Sample.app.1.0.0.app.zip","noReset":true,"newCommandTimeout":240}} | |
[debug] [W3C] Calling AppiumDriver.createSession() with args: [{"deviceName":"iPhone X","platformName":"iOS","platformVersion":"12.2","orientation":"PORTRAIT","app":"/Users/wimselles/Sauce/Git/webdriverio-5-playground/apps/iOS.Simulator.SauceLabs.Mobile.Sample.app.1.0.0.app.zip","noReset":true,"newCommandTimeout":240},null,{"alwaysMatch":{"deviceName":"iPhone X","platformName":"iOS","platformVer |
// The `~` tells WebdriverIO that it needs to look for an accessibiltyID | |
// Android: `content description` | |
// iOS: `accessibility id` | |
$('~accessibiltyID').click(); | |
// -ios predicate string | |
const loginButton = 'type == \'XCUIElementTypeOther\' && name CONTAINS \'test-LOGIN\''; | |
$(`-ios predicate string:${ loginButton }`).click(); | |
// -ios class chain, to make complex selectors |