Skip to content

Commit 80be558

Browse files
authored
test: Fix open notification test (#1749)
1 parent 843e719 commit 80be558

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,7 @@ task uiAutomationTest( type: Test ) {
213213
filter {
214214
includeTestsMatching 'io.appium.java_client.android.SettingTest'
215215
includeTestsMatching 'io.appium.java_client.android.ClipboardTest'
216+
includeTestsMatching 'io.appium.java_client.android.OpenNotificationsTest'
216217
includeTestsMatching '*.AndroidAppStringsTest'
217218
includeTestsMatching '*.pagefactory_tests.widget.tests.android.*'
218219
includeTestsMatching '*.pagefactory_tests.widget.tests.AndroidPageObjectTest'

src/test/java/io/appium/java_client/android/OpenNotificationsTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package io.appium.java_client.android;
22

33
import static org.junit.jupiter.api.Assertions.assertNotEquals;
4-
import static org.openqa.selenium.By.id;
4+
import static org.openqa.selenium.By.xpath;
55

66
import org.junit.jupiter.api.Test;
77
import org.openqa.selenium.WebElement;
@@ -18,7 +18,7 @@ public void openNotification() {
1818
WebDriverWait wait = new WebDriverWait(driver, Duration.ofSeconds(20));
1919
assertNotEquals(0, wait.until(input -> {
2020
List<WebElement> result = input
21-
.findElements(id("com.android.systemui:id/settings_button"));
21+
.findElements(xpath("//android.widget.Switch[contains(@content-desc, 'Wi-Fi')]"));
2222

2323
return result.isEmpty() ? null : result;
2424
}).size());

0 commit comments

Comments
 (0)