From 2be94a8fb1af428556bc4cfc3f51c7e4eb29bdb4 Mon Sep 17 00:00:00 2001 From: kobenguyent <7845001+kobenguyent@users.noreply.github.com> Date: Mon, 9 Jun 2025 12:40:46 +0200 Subject: [PATCH 1/7] fix: seeElement wdio --- lib/helper/WebDriver.js | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/lib/helper/WebDriver.js b/lib/helper/WebDriver.js index 5c23dbc27..8cf49fac9 100644 --- a/lib/helper/WebDriver.js +++ b/lib/helper/WebDriver.js @@ -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 Promise.all(elements.map(el => el.isDisplayed())); + + try { + return truth(`elements of ${new Locator(locator)}`, 'to be seen').assert(visibility); + } catch (error) { + dontSeeElementError(locator); } +} /** * {{> dontSeeElement }} From ce504d679e87bd1ce2089fb032b8b28740c6b7a0 Mon Sep 17 00:00:00 2001 From: kobenguyent <7845001+kobenguyent@users.noreply.github.com> Date: Mon, 9 Jun 2025 12:41:44 +0200 Subject: [PATCH 2/7] Update appium_Android.yml --- .github/workflows/appium_Android.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/appium_Android.yml b/.github/workflows/appium_Android.yml index c5e884b81..62ba65484 100644 --- a/.github/workflows/appium_Android.yml +++ b/.github/workflows/appium_Android.yml @@ -4,6 +4,7 @@ on: push: branches: - 3.x + - kobenguyen-patch-2 env: CI: true From bce6a98609c4656fe8396a43955b332dc34f80e1 Mon Sep 17 00:00:00 2001 From: kobenguyent <7845001+kobenguyent@users.noreply.github.com> Date: Mon, 9 Jun 2025 14:01:18 +0200 Subject: [PATCH 3/7] Update WebDriver.js --- lib/helper/WebDriver.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/helper/WebDriver.js b/lib/helper/WebDriver.js index 8cf49fac9..637d4590a 100644 --- a/lib/helper/WebDriver.js +++ b/lib/helper/WebDriver.js @@ -1462,7 +1462,7 @@ async seeElement(locator) { const elements = await this._locate(locator, true); assertElementExists(elements, locator); - const visibility = await Promise.all(elements.map(el => el.isDisplayed())); + const visibility = await forEachAsync(elements, async el => el.isDisplayed()); try { return truth(`elements of ${new Locator(locator)}`, 'to be seen').assert(visibility); From b3efea44b6b350f011702e9e08b8547d8605c8fc Mon Sep 17 00:00:00 2001 From: kobenguyent <7845001+kobenguyent@users.noreply.github.com> Date: Mon, 9 Jun 2025 14:01:31 +0200 Subject: [PATCH 4/7] Update appium_Android.yml --- .github/workflows/appium_Android.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/appium_Android.yml b/.github/workflows/appium_Android.yml index 62ba65484..f829da57a 100644 --- a/.github/workflows/appium_Android.yml +++ b/.github/workflows/appium_Android.yml @@ -4,7 +4,7 @@ on: push: branches: - 3.x - - kobenguyen-patch-2 + - kobenguyent-patch-2 env: CI: true From 7e2ca1021a7067e21a5320653f0eb19a786919d4 Mon Sep 17 00:00:00 2001 From: kobenguyent <7845001+kobenguyent@users.noreply.github.com> Date: Mon, 9 Jun 2025 15:55:49 +0200 Subject: [PATCH 5/7] Update package.json --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index eaad3c2c0..9b5923279 100644 --- a/package.json +++ b/package.json @@ -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" }, From 85a2bc8aacf9565a67b35d6d3ebd210209dd19a2 Mon Sep 17 00:00:00 2001 From: kobenguyent <7845001+kobenguyent@users.noreply.github.com> Date: Tue, 10 Jun 2025 15:13:28 +0200 Subject: [PATCH 6/7] Try out switchContext('NATIVE_APP') --- lib/helper/Appium.js | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/helper/Appium.js b/lib/helper/Appium.js index fcb304263..b0e039e59 100644 --- a/lib/helper/Appium.js +++ b/lib/helper/Appium.js @@ -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)) } From 52bd4d5a39fb965de11c811e25143d41bc189b90 Mon Sep 17 00:00:00 2001 From: kobenguyent <7845001+kobenguyent@users.noreply.github.com> Date: Tue, 10 Jun 2025 15:30:19 +0200 Subject: [PATCH 7/7] Update WebDriver.js --- lib/helper/WebDriver.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/helper/WebDriver.js b/lib/helper/WebDriver.js index 637d4590a..ea31c82f1 100644 --- a/lib/helper/WebDriver.js +++ b/lib/helper/WebDriver.js @@ -1462,7 +1462,7 @@ async seeElement(locator) { const elements = await this._locate(locator, true); assertElementExists(elements, locator); - const visibility = await forEachAsync(elements, async el => el.isDisplayed()); + const visibility = await forEach(elements, async el => el.isDisplayed()); try { return truth(`elements of ${new Locator(locator)}`, 'to be seen').assert(visibility);