Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/appium_Android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches:
- 3.x
- kobenguyent-patch-2

env:
CI: true
Expand Down
1 change: 1 addition & 0 deletions lib/helper/Appium.js
Original file line number Diff line number Diff line change
Expand Up @@ -1654,6 +1654,7 @@ class Appium extends Webdriver {
*/
async seeElement(locator) {
if (this.isWeb) return super.seeElement(locator)
this.switchToContext('NATIVE_APP')
return super.seeElement(parseLocator.call(this, locator))
}

Expand Down
20 changes: 11 additions & 9 deletions lib/helper/WebDriver.js
Original file line number Diff line number Diff line change
Expand Up @@ -1458,16 +1458,18 @@ class WebDriver extends Helper {
* {{ react }}
*
*/
async seeElement(locator) {
const res = await this._locate(locator, true)
assertElementExists(res, locator)
const selected = await forEachAsync(res, async el => el.isDisplayed())
try {
return truth(`elements of ${new Locator(locator)}`, 'to be seen').assert(selected)
} catch (e) {
dontSeeElementError(locator)
}
async seeElement(locator) {
const elements = await this._locate(locator, true);
assertElementExists(elements, locator);

const visibility = await forEach(elements, async el => el.isDisplayed());

try {
return truth(`elements of ${new Locator(locator)}`, 'to be seen').assert(visibility);
} catch (error) {
dontSeeElementError(locator);
}
}

/**
* {{> dontSeeElement }}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@
"typedoc-plugin-markdown": "4.6.3",
"typescript": "5.8.3",
"wdio-docker-service": "3.2.1",
"webdriverio": "9.12.5",
"webdriverio": "9.14.0",
"xml2js": "0.6.2",
"xpath": "0.0.34"
},
Expand Down
Loading