You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/build/Appium.js
+45-51Lines changed: 45 additions & 51 deletions
Original file line number
Diff line number
Diff line change
@@ -44,7 +44,7 @@ const vendorPrefix = {
44
44
*
45
45
* This helper should be configured in codecept.conf.ts or codecept.conf.js
46
46
*
47
-
* * `appiumV2`: set this to true if you want to run tests with AppiumV2. See more how to setup [here](https://codecept.io/mobile/#setting-up)
47
+
* * `appiumV2`: by default is true, set this to false if you want to run tests with AppiumV1. See more how to setup [here](https://codecept.io/mobile/#setting-up)
48
48
* * `app`: Application path. Local path or remote URL to an .ipa or .apk file, or a .zip containing one of these. Alias to desiredCapabilities.appPackage
49
49
* * `host`: (default: 'localhost') Appium host
50
50
* * `port`: (default: '4723') Appium port
@@ -124,7 +124,7 @@ const vendorPrefix = {
124
124
* {
125
125
* helpers: {
126
126
* Appium: {
127
-
* appiumV2: true,
127
+
* appiumV2: true, // By default is true, set to false if you want to run against Appium v1
128
128
* host: "hub-cloud.browserstack.com",
129
129
* port: 4444,
130
130
* user: process.env.BROWSERSTACK_USER,
@@ -178,16 +178,12 @@ class Appium extends Webdriver {
178
178
super(config)
179
179
180
180
this.isRunning=false
181
-
if(config.appiumV2===true){
182
-
this.appiumV2=true
183
-
}
181
+
this.appiumV2=config.appiumV2||true
184
182
this.axios=axios.create()
185
183
186
184
webdriverio=require('webdriverio')
187
185
if(!config.appiumV2){
188
-
console.log(
189
-
'The Appium core team does not maintain Appium 1.x anymore since the 1st of January 2022. Please migrating to Appium 2.x by adding appiumV2: true to your config.',
190
-
)
186
+
console.log('The Appium core team does not maintain Appium 1.x anymore since the 1st of January 2022. Appium 2.x is used by default.')
config.capabilities[`${vendorPrefix.appium}:tunnelIdentifier`]=config[`${vendorPrefix.appium}:tunnelIdentifier`]||config.capabilities[`${vendorPrefix.appium}:tunnelIdentifier`]// Adding the code to connect to sauce labs via sauce tunnel
@@ -2044,12 +2042,8 @@ function parseLocator(locator) {
2044
2042
}
2045
2043
2046
2044
locator=newLocator(locator,'xpath')
2047
-
if(locator.type==='css'&&!this.isWeb)
2048
-
thrownewError(
2049
-
'Unable to use css locators in apps. Locator strategies for this request: xpath, id, class name or accessibility id',
2050
-
)
2051
-
if(locator.type==='name'&&!this.isWeb)
2052
-
thrownewError("Can't locate element by name in Native context. Use either ID, class name or accessibility id")
2045
+
if(locator.type==='css'&&!this.isWeb)thrownewError('Unable to use css locators in apps. Locator strategies for this request: xpath, id, class name or accessibility id')
2046
+
if(locator.type==='name'&&!this.isWeb)thrownewError("Can't locate element by name in Native context. Use either ID, class name or accessibility id")
0 commit comments