Skip to content

Commit 4589c7c

Browse files
committed
Bumping POM versions and making tests pass for TestNG
1 parent 5ed4f62 commit 4589c7c

File tree

4 files changed

+65
-56
lines changed

4 files changed

+65
-56
lines changed

java/testng/pom.xml

+12-6
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@
66

77
<groupId>com.saucelabs</groupId>
88
<artifactId>saucebindings-testng</artifactId>
9-
<version>1.1.0-SNAPSHOT</version>
9+
<version>1.5.0-SNAPSHOT</version>
1010
<name>SauceBindings TestNG</name>
1111
<description>Provides tools for interacting with SauceLabs with TestNG</description>
1212
<url>https://opensource.saucelabs.com/sauce_bindings</url>
1313
<licenses>
1414
<license>
1515
<name>MIT License</name>
16-
<url>http://www.opensource.org/licenses/mit-license.php</url>
16+
<url>https://www.opensource.org/licenses/mit-license.php</url>
1717
<distribution>repo</distribution>
1818
</license>
1919
</licenses>
@@ -28,13 +28,13 @@
2828
<name>Titus Fortner</name>
2929
<email>[email protected]</email>
3030
<organization>Sauce Labs</organization>
31-
<organizationUrl>http://www.saucelabs.com/</organizationUrl>
31+
<organizationUrl>https://www.saucelabs.com/</organizationUrl>
3232
</developer>
3333
<developer>
3434
<name>Nikolay Advolodkin</name>
3535
<email>[email protected]</email>
3636
<organization>Sauce Labs</organization>
37-
<organizationUrl>http://www.saucelabs.com/</organizationUrl>
37+
<organizationUrl>https://www.saucelabs.com/</organizationUrl>
3838
</developer>
3939
</developers>
4040

@@ -55,12 +55,12 @@
5555
<dependency>
5656
<groupId>com.saucelabs</groupId>
5757
<artifactId>sauce_bindings</artifactId>
58-
<version>1.3.0</version>
58+
<version>1.5.0</version>
5959
</dependency>
6060
<dependency>
6161
<groupId>org.testng</groupId>
6262
<artifactId>testng</artifactId>
63-
<version>7.8.0</version>
63+
<version>7.10.2</version>
6464
</dependency>
6565
</dependencies>
6666

@@ -93,6 +93,12 @@
9393
<groupId>org.apache.maven.plugins</groupId>
9494
<artifactId>maven-gpg-plugin</artifactId>
9595
<version>1.6</version>
96+
<configuration>
97+
<gpgArguments>
98+
<arg>--pinentry-mode</arg>
99+
<arg>loopback</arg>
100+
</gpgArguments>
101+
</configuration>
96102
<executions>
97103
<execution>
98104
<id>sign-artifacts</id>

java/testng/src/test/java/com/saucelabs/saucebindings/testng/AdjustOptionsTest.java

+14-14
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,19 @@
1010

1111
public class AdjustOptionsTest extends SauceBaseTest {
1212

13-
@Override
14-
protected SauceOptions createSauceOptions() {
15-
return SauceOptions.firefox()
16-
.setMaxDuration(Duration.ofMinutes(30))
17-
.setJobVisibility(JobVisibility.TEAM)
18-
.setBrowserVersion("87.0")
19-
.build();
20-
}
13+
@Override
14+
protected SauceOptions createSauceOptions() {
15+
return SauceOptions.firefox()
16+
.setMaxDuration(Duration.ofMinutes(30))
17+
.setJobVisibility(JobVisibility.TEAM)
18+
.setBrowserVersion("127.0")
19+
.build();
20+
}
2121

22-
@Test
23-
public void useCustomOptions() {
24-
Capabilities caps = getDriver().getCapabilities();
25-
Assert.assertEquals("firefox", caps.getBrowserName());
26-
Assert.assertEquals("87.0", caps.getCapability("browserVersion"));
27-
}
22+
@Test
23+
public void useCustomOptions() {
24+
Capabilities caps = getDriver().getCapabilities();
25+
Assert.assertEquals("firefox", caps.getBrowserName());
26+
Assert.assertEquals("127.0", caps.getCapability("browserVersion"));
27+
}
2828
}

java/testng/src/test/java/com/saucelabs/saucebindings/testng/ParameterizedOptionsTest.java

+24-21
Original file line numberDiff line numberDiff line change
@@ -11,27 +11,30 @@
1111

1212
public class ParameterizedOptionsTest extends SauceParameterizedBaseTest {
1313

14-
@DataProvider(name = "sauceBrowsers", parallel = true)
15-
public static Object[][] sauceBrowserDataProvider() {
16-
return new Object[][]{
17-
new Object[]{SauceOptions.chrome(), "90.0", SaucePlatform.MAC_BIG_SUR},
18-
new Object[]{SauceOptions.firefox(), "89.0", SaucePlatform.MAC_BIG_SUR},
19-
new Object[]{SauceOptions.chrome(), "91.0", SaucePlatform.WINDOWS_10}
20-
};
21-
}
14+
@DataProvider(name = "sauceBrowsers", parallel = true)
15+
public static Object[][] sauceBrowserDataProvider() {
16+
return new Object[][] {
17+
new Object[] {SauceOptions.chrome(), "126.0", SaucePlatform.MAC_VENTURA},
18+
new Object[] {SauceOptions.firefox(), "127.0", SaucePlatform.MAC_VENTURA},
19+
new Object[] {SauceOptions.chrome(), "126.0", SaucePlatform.WINDOWS_10}
20+
};
21+
}
2222

23-
@Override
24-
protected SauceOptions createSauceOptions(Method method, Object[] parameters) {
25-
return ((VDCConfigurations) parameters[0])
26-
.setBrowserVersion((String) parameters[1])
27-
.setPlatformName((SaucePlatform) parameters[2])
28-
.build();
29-
}
23+
@Override
24+
protected SauceOptions createSauceOptions(Method method, Object[] parameters) {
25+
return ((VDCConfigurations) parameters[0])
26+
.setBrowserVersion((String) parameters[1])
27+
.setPlatformName((SaucePlatform) parameters[2])
28+
.build();
29+
}
3030

31-
@Test(dataProvider = "sauceBrowsers")
32-
public void useParameters(VDCConfigurations browser, String browserVersion, SaucePlatform saucePlatform) {
33-
Assert.assertEquals(getDriver().getCapabilities().getBrowserName(), browser.build().getBrowserName().getValue());
34-
String version = (String) getDriver().getCapabilities().getCapability("browserVersion");
35-
Assert.assertTrue(version.contains(browserVersion));
36-
}
31+
@Test(dataProvider = "sauceBrowsers")
32+
public void useParameters(
33+
VDCConfigurations browser, String browserVersion, SaucePlatform saucePlatform) {
34+
Assert.assertEquals(
35+
getDriver().getCapabilities().getBrowserName(),
36+
browser.build().getBrowserName().getValue());
37+
String version = (String) getDriver().getCapabilities().getCapability("browserVersion");
38+
Assert.assertTrue(version.contains(browserVersion));
39+
}
3740
}

java/testng/src/test/java/com/saucelabs/saucebindings/testng/examples/CommonOptionsTest.java

+15-15
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,22 @@
99
// 1. Extend the provided base test class
1010
public class CommonOptionsTest extends SauceBaseTest {
1111

12-
// 2. Create SauceOptions instance with common w3c options
13-
protected SauceOptions createSauceOptions() {
14-
return SauceOptions.firefox()
15-
.setBrowserVersion("85.0")
16-
.setPlatformName(SaucePlatform.WINDOWS_8)
17-
.setUnhandledPromptBehavior(UnhandledPromptBehavior.IGNORE)
18-
.build();
19-
}
12+
// 2. Create SauceOptions instance with common w3c options
13+
protected SauceOptions createSauceOptions() {
14+
return SauceOptions.firefox()
15+
.setBrowserVersion("127.0")
16+
.setPlatformName(SaucePlatform.WINDOWS_10)
17+
.setUnhandledPromptBehavior(UnhandledPromptBehavior.IGNORE)
18+
.build();
19+
}
2020

21-
@Test
22-
public void basicOptions() {
23-
// 3. Session and Driver are created automatically by superclass
21+
@Test
22+
public void basicOptions() {
23+
// 3. Session and Driver are created automatically by superclass
2424

25-
// 4. Use the driver in your tests just like normal
26-
getDriver().get("https://www.saucedemo.com/");
25+
// 4. Use the driver in your tests just like normal
26+
getDriver().get("https://www.saucedemo.com/");
2727

28-
// 5. Session is stopped and results are sent to Sauce Labs automatically by the superclass
29-
}
28+
// 5. Session is stopped and results are sent to Sauce Labs automatically by the superclass
29+
}
3030
}

0 commit comments

Comments
 (0)