codeceptjs / codeceptjs/CodeceptJS

Passing ios & android locator values for a single command produces different results than if they were run separately

Offen
#2,551 2 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
JavaScript
Sterne
4.2k
Forks
757
Ø Merge
2 T. 9 Std.
Gemergte PRs (30 T.)
16

Beschreibung

#### What are you trying to achieve?
Reduce lines of code & complexity by passing in the `android` and `ios` locators for functions. Example below:
`I.see({ android: this.home_navTab_android, ios: this.home_navTab_ios });`

#### What do you get instead?

Certain commands or selectors fail when using this method. However, I get different results if I use `I.see()` and pass in single OS locator. i.e Call the OS specific functions individually for each platform.

Using `I.see(this.home_navTab_android);`
```
Test output:
expected current context //* to include "#au.com.flexirent.skye:id/navigation_home"
```
Using: `I.see({ android: this.home_navTab_android, ios: this.home_navTab_ios });`
```
Test output:
expected current context //* to include "[object Object]"
```

### Details
```
* CodeceptJS version: ^2.6.7
* NodeJS Version: v14.3.0
* Operating System: Mac 10.15.5
* puppeteer || webdriverio || protractor || testcafe version (if related)
* Configuration file:

Appium: {
host: "0.0.0.0",
port: 4723,
platform: "Android",
newCommandTimeout: 10000,
desiredCapabilities: {
platformName: 'Android',
deviceName: 'any',
udid: 'emulator-5554',
automationName: 'UiAutomator2',
appPackage: '',
appActivity: '',
},
},
```

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.