Skip to content

Commit f5470d9

Browse files
Revert "Upgraded Selenium version to alpha 2. (#1210)"
This reverts commit 7239a9d.
1 parent 5aa8009 commit f5470d9

File tree

13 files changed

+24
-35
lines changed

13 files changed

+24
-35
lines changed

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ signing.secretKeyRingFile=PathToYourKeyRingFile
77
ossrhUsername=your-jira-id
88
ossrhPassword=your-jira-password
99

10-
selenium.version=4.0.0-alpha-2
10+
selenium.version=3.141.59

src/main/java/io/appium/java_client/remote/AppiumCommandExecutor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@
4444
import org.openqa.selenium.remote.ProtocolHandshake;
4545
import org.openqa.selenium.remote.Response;
4646
import org.openqa.selenium.remote.ResponseCodec;
47-
import org.openqa.selenium.remote.codec.w3c.W3CHttpCommandCodec;
4847
import org.openqa.selenium.remote.http.HttpClient;
4948
import org.openqa.selenium.remote.http.HttpRequest;
5049
import org.openqa.selenium.remote.http.HttpResponse;
50+
import org.openqa.selenium.remote.http.W3CHttpCommandCodec;
5151
import org.openqa.selenium.remote.service.DriverService;
5252

5353
import java.io.BufferedInputStream;

src/main/java/io/appium/java_client/remote/AppiumW3CHttpCommandCodec.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232

3333
import org.openqa.selenium.interactions.KeyInput;
3434
import org.openqa.selenium.interactions.Sequence;
35-
import org.openqa.selenium.remote.codec.w3c.W3CHttpCommandCodec;
35+
import org.openqa.selenium.remote.http.W3CHttpCommandCodec;
3636

3737
import java.util.Collection;
3838
import java.util.Map;

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

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

3-
import static java.time.Duration.ofSeconds;
43
import static org.junit.Assert.assertNotEquals;
54
import static org.openqa.selenium.By.id;
65

@@ -15,7 +14,7 @@ public class OpenNotificationsTest extends BaseAndroidTest {
1514
public void openNotification() {
1615
driver.closeApp();
1716
driver.openNotifications();
18-
WebDriverWait wait = new WebDriverWait(driver, ofSeconds(20));
17+
WebDriverWait wait = new WebDriverWait(driver, 20);
1918
assertNotEquals(0, wait.until(input -> {
2019
List<AndroidElement> result = input
2120
.findElements(id("com.android.systemui:id/settings_button"));

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

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

3-
import static java.time.Duration.ofSeconds;
43
import static org.junit.Assert.assertEquals;
54
import static org.junit.Assert.assertNotNull;
65

@@ -24,7 +23,7 @@ public void afterMethod() {
2423

2524
@Test
2625
public void testLandscapeRightRotation() {
27-
new WebDriverWait(driver, ofSeconds(20)).until(ExpectedConditions
26+
new WebDriverWait(driver, 20).until(ExpectedConditions
2827
.elementToBeClickable(driver.findElementById("android:id/content")
2928
.findElement(MobileBy.AccessibilityId("Graphics"))));
3029
DeviceRotation landscapeRightRotation = new DeviceRotation(0, 0, 90);
@@ -34,7 +33,7 @@ public void testLandscapeRightRotation() {
3433

3534
@Test
3635
public void testLandscapeLeftRotation() {
37-
new WebDriverWait(driver, ofSeconds(20)).until(ExpectedConditions
36+
new WebDriverWait(driver, 20).until(ExpectedConditions
3837
.elementToBeClickable(driver.findElementById("android:id/content")
3938
.findElement(MobileBy.AccessibilityId("Graphics"))));
4039
DeviceRotation landscapeLeftRotation = new DeviceRotation(0, 0, 270);
@@ -44,7 +43,7 @@ public void testLandscapeLeftRotation() {
4443

4544
@Test
4645
public void testPortraitUpsideDown() {
47-
new WebDriverWait(driver, ofSeconds(20)).until(ExpectedConditions
46+
new WebDriverWait(driver, 20).until(ExpectedConditions
4847
.elementToBeClickable(driver.findElementById("android:id/content")
4948
.findElement(MobileBy.AccessibilityId("Graphics"))));
5049
DeviceRotation landscapeRightRotation = new DeviceRotation(0, 0, 180);
@@ -57,7 +56,7 @@ public void testPortraitUpsideDown() {
5756
*/
5857
@Ignore
5958
public void testToastMSGIsDisplayed() {
60-
final WebDriverWait wait = new WebDriverWait(driver, ofSeconds(30));
59+
final WebDriverWait wait = new WebDriverWait(driver, 30);
6160
Activity activity = new Activity("io.appium.android.apis", ".view.PopupMenu1");
6261
driver.startActivity(activity);
6362

src/test/java/io/appium/java_client/appium/element/generation/ios/IOSElementGenerationTest.java

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

33
import static io.appium.java_client.MobileBy.AccessibilityId;
4-
import static java.time.Duration.ofSeconds;
54
import static org.junit.Assert.assertTrue;
65
import static org.openqa.selenium.By.id;
76
import static org.openqa.selenium.By.name;
@@ -85,11 +84,11 @@ public void whenIOSHybridAppIsLaunched() {
8584
Capabilities caps = commonAppCapabilitiesSupplier.get();
8685
return caps.merge(appFileSupplierFunction.apply(webViewApp).get());
8786
}, (by, aClass) -> {
88-
new WebDriverWait(driver, ofSeconds(30))
87+
new WebDriverWait(driver, 30)
8988
.until(ExpectedConditions.presenceOfElementLocated(id("login")))
9089
.click();
9190
driver.findElementByAccessibilityId("webView").click();
92-
new WebDriverWait(driver, ofSeconds(30))
91+
new WebDriverWait(driver, 30)
9392
.until(ExpectedConditions
9493
.presenceOfElementLocated(AccessibilityId("Webview")));
9594
try {

src/test/java/io/appium/java_client/ios/IOSAlertTest.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
package io.appium.java_client.ios;
1818

19-
import static java.time.Duration.ofSeconds;
2019
import static junit.framework.TestCase.assertFalse;
2120
import static org.junit.Assert.assertTrue;
2221
import static org.openqa.selenium.support.ui.ExpectedConditions.alertIsPresent;
@@ -33,7 +32,7 @@
3332
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
3433
public class IOSAlertTest extends AppIOSTest {
3534

36-
private WebDriverWait waiting = new WebDriverWait(driver, ofSeconds(10000));
35+
private WebDriverWait waiting = new WebDriverWait(driver, 10000);
3736
private static final String iOSAutomationText = "show alert";
3837

3938
@Test public void acceptAlertTest() {

src/test/java/io/appium/java_client/ios/IOSDriverTest.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
package io.appium.java_client.ios;
1818

19-
import static java.time.Duration.ofSeconds;
2019
import static org.hamcrest.Matchers.empty;
2120
import static org.hamcrest.Matchers.equalTo;
2221
import static org.hamcrest.Matchers.greaterThan;
@@ -57,7 +56,7 @@ public void getDeviceTimeTest() {
5756
}
5857

5958
@Test public void hideKeyboardWithParametersTest() {
60-
new WebDriverWait(driver, ofSeconds(30))
59+
new WebDriverWait(driver, 30)
6160
.until(ExpectedConditions.presenceOfElementLocated(By.id("IntegerA")))
6261
.click();
6362
driver.hideKeyboard(HideKeyboardStrategy.PRESS_KEY, "Done");
@@ -103,7 +102,7 @@ public void getDeviceTimeTest() {
103102

104103
@Test public void putAppIntoBackgroundAndRestoreTest() {
105104
final long msStarted = System.currentTimeMillis();
106-
driver.runAppInBackground(ofSeconds(4));
105+
driver.runAppInBackground(Duration.ofSeconds(4));
107106
assertThat(System.currentTimeMillis() - msStarted, greaterThan(3000L));
108107
}
109108

@@ -120,7 +119,7 @@ public void getDeviceTimeTest() {
120119
}
121120
assertThat(driver.queryAppState(BUNDLE_ID), equalTo(ApplicationState.RUNNING_IN_FOREGROUND));
122121
Thread.sleep(500);
123-
driver.runAppInBackground(ofSeconds(-1));
122+
driver.runAppInBackground(Duration.ofSeconds(-1));
124123
assertThat(driver.queryAppState(BUNDLE_ID), lessThan(ApplicationState.RUNNING_IN_FOREGROUND));
125124
Thread.sleep(500);
126125
driver.activateApp(BUNDLE_ID);
@@ -129,7 +128,7 @@ public void getDeviceTimeTest() {
129128

130129
@Test public void putAIntoBackgroundWithoutRestoreTest() {
131130
assertThat(driver.findElementsById("IntegerA"), is(not(empty())));
132-
driver.runAppInBackground(ofSeconds(-1));
131+
driver.runAppInBackground(Duration.ofSeconds(-1));
133132
assertThat(driver.findElementsById("IntegerA"), is(empty()));
134133
driver.launchApp();
135134
}

src/test/java/io/appium/java_client/ios/IOSElementTest.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package io.appium.java_client.ios;
22

3-
import static java.time.Duration.ofSeconds;
43
import static org.hamcrest.core.Is.is;
54
import static org.hamcrest.core.IsNot.not;
65
import static org.junit.Assert.assertEquals;
@@ -26,7 +25,7 @@ public void findByAccessibilityIdTest() {
2625
@Ignore
2726
@Test
2827
public void setValueTest() {
29-
WebDriverWait wait = new WebDriverWait(driver, ofSeconds(20));
28+
WebDriverWait wait = new WebDriverWait(driver, 20);
3029

3130
IOSElement slider = wait.until(
3231
driver1 -> driver1.findElement(By.className("XCUIElementTypeSlider")));

src/test/java/io/appium/java_client/ios/IOSNativeWebTapSettingTest.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package io.appium.java_client.ios;
22

3-
import static java.time.Duration.ofSeconds;
43
import static org.junit.Assert.assertTrue;
54

65
import org.junit.Test;
@@ -18,17 +17,17 @@ public class IOSNativeWebTapSettingTest extends BaseSafariTest {
1817
driver.nativeWebTap(true);
1918
WebElement el = driver.findElementById("i am a link");
2019
el.click();
21-
assertTrue(new WebDriverWait(driver, ofSeconds(30))
20+
assertTrue(new WebDriverWait(driver, 30)
2221
.until(ExpectedConditions.titleIs("I am another page title - Sauce Labs")));
2322
driver.navigate().back();
2423

2524
// now do a click with it turned off and assert the same behavior
26-
assertTrue(new WebDriverWait(driver, ofSeconds(30))
25+
assertTrue(new WebDriverWait(driver, 30)
2726
.until(ExpectedConditions.titleIs("I am a page title - Sauce Labs")));
2827
driver.nativeWebTap(false);
2928
el = driver.findElementById("i am a link");
3029
el.click();
31-
assertTrue(new WebDriverWait(driver, ofSeconds(30))
30+
assertTrue(new WebDriverWait(driver, 30)
3231
.until(ExpectedConditions.titleIs("I am another page title - Sauce Labs")));
3332
}
3433
}

0 commit comments

Comments
 (0)