Skip to content

Commit

Permalink
Version 2023.02.03: Selenium - Don't add desired capabilities with em…
Browse files Browse the repository at this point in the history
…pty platform and browser version
  • Loading branch information
KMariusz committed Feb 3, 2023
1 parent d1cbcb7 commit 81408ec
Show file tree
Hide file tree
Showing 10 changed files with 39 additions and 45 deletions.
6 changes: 3 additions & 3 deletions mrchecker-framework-modules/mrchecker-cli-module/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
<parent>
<artifactId>mrchecker-test-framework</artifactId>
<groupId>com.capgemini.mrchecker</groupId>
<version>2023.02.02</version>
<version>2023.02.03</version>
</parent>

<artifactId>mrchecker-cli-module</artifactId>
<version>2023.02.02</version>
<version>2023.02.03</version>
<packaging>jar</packaging>
<name>MrChecker - CLI - Module</name>
<description>MrChecker CLI Module supports:
Expand Down Expand Up @@ -60,7 +60,7 @@
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>mrchecker-core-module</artifactId>
<version>2023.02.02</version>
<version>2023.02.03</version>
</dependency>
</dependencies>

Expand Down
4 changes: 2 additions & 2 deletions mrchecker-framework-modules/mrchecker-core-module/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
<parent>
<artifactId>mrchecker-test-framework</artifactId>
<groupId>com.capgemini.mrchecker</groupId>
<version>2023.02.02</version>
<version>2023.02.03</version>
</parent>

<artifactId>mrchecker-core-module</artifactId>
<version>2023.02.02</version>
<version>2023.02.03</version>
<packaging>jar</packaging>
<name>MrChecker - Test core - Module</name>
<description>MrChecker Test Framework Core is responsible for:
Expand Down
6 changes: 3 additions & 3 deletions mrchecker-framework-modules/mrchecker-database-module/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
<parent>
<artifactId>mrchecker-test-framework</artifactId>
<groupId>com.capgemini.mrchecker</groupId>
<version>2023.02.02</version>
<version>2023.02.03</version>
</parent>

<artifactId>mrchecker-database-module</artifactId>
<version>2023.02.02</version>
<version>2023.02.03</version>
<packaging>jar</packaging>
<name>MrChecker - Database - Module</name>
<description>MrChecker Database Module:
Expand Down Expand Up @@ -80,7 +80,7 @@
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>mrchecker-core-module</artifactId>
<version>2023.02.02</version>
<version>2023.02.03</version>
</dependency>

<!-- JPA dependencies -->
Expand Down
8 changes: 4 additions & 4 deletions mrchecker-framework-modules/mrchecker-mobile-module/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
<parent>
<artifactId>mrchecker-test-framework</artifactId>
<groupId>com.capgemini.mrchecker</groupId>
<version>2023.02.02</version>
<version>2023.02.03</version>
</parent>

<artifactId>mrchecker-mobile-module</artifactId>
<version>2023.02.02</version>
<version>2023.02.03</version>
<packaging>jar</packaging>
<name>MrChecker - Mobile - Module</name>
<description>MrChecker Test Framework name supports:
Expand Down Expand Up @@ -52,12 +52,12 @@
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>mrchecker-core-module</artifactId>
<version>2023.02.02</version>
<version>2023.02.03</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>mrchecker-selenium-module</artifactId>
<version>2023.02.02</version>
<version>2023.02.03</version>
</dependency>

<!--This dependency is necessary for Appium plugin. -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
<parent>
<artifactId>mrchecker-test-framework</artifactId>
<groupId>com.capgemini.mrchecker</groupId>
<version>2023.02.02</version>
<version>2023.02.03</version>
</parent>

<artifactId>mrchecker-playwright-module</artifactId>
<version>2023.02.02</version>
<version>2023.02.03</version>
<packaging>jar</packaging>
<name>MrChecker - Playwright - Module</name>
<description>MrChecker Test Framework Playwright</description>
Expand Down Expand Up @@ -68,7 +68,7 @@
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>mrchecker-core-module</artifactId>
<version>2023.02.02</version>
<version>2023.02.03</version>
</dependency>

<!--This dependency is necessary for Playwright plugin. -->
Expand Down
6 changes: 3 additions & 3 deletions mrchecker-framework-modules/mrchecker-security-module/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
<parent>
<artifactId>mrchecker-test-framework</artifactId>
<groupId>com.capgemini.mrchecker</groupId>
<version>2023.02.02</version>
<version>2023.02.03</version>
</parent>

<artifactId>mrchecker-security-module</artifactId>
<version>2023.02.02</version>
<version>2023.02.03</version>
<packaging>jar</packaging>
<name>MrChecker - Security - Module</name>
<description>MrChecker Test Framework Security supports:
Expand Down Expand Up @@ -63,7 +63,7 @@
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>mrchecker-core-module</artifactId>
<version>2023.02.02</version>
<version>2023.02.03</version>
</dependency>

<!-- Needed to perform all API calls -->
Expand Down
6 changes: 3 additions & 3 deletions mrchecker-framework-modules/mrchecker-selenium-module/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
<parent>
<artifactId>mrchecker-test-framework</artifactId>
<groupId>com.capgemini.mrchecker</groupId>
<version>2023.02.02</version>
<version>2023.02.03</version>
</parent>

<artifactId>mrchecker-selenium-module</artifactId>
<version>2023.02.02</version>
<version>2023.02.03</version>
<packaging>jar</packaging>
<name>MrChecker - Selenium - Module</name>
<description>MrChecker Test Framework Selenium supports:
Expand Down Expand Up @@ -98,7 +98,7 @@
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>mrchecker-core-module</artifactId>
<version>2023.02.02</version>
<version>2023.02.03</version>
</dependency>

<!--This dependency is necessary for Selenium plugin. -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,8 @@ public static void closeDriver() {
}
}

private static boolean isEmpty(String seleniumGridParameter) {
return seleniumGridParameter == null || seleniumGridParameter.trim().isEmpty();
private static boolean isEmpty(String value) {
return value == null || value.trim().isEmpty();
}

private enum Driver {
Expand Down Expand Up @@ -450,18 +450,9 @@ private static INewWebDriver getRemoteDriver(MutableCapabilities options) {
DesiredCapabilities capabilities = new DesiredCapabilities();

String operatingSystem = RuntimeParametersSelenium.OS.getValue();
switch (operatingSystem) {
case "windows":
capabilities.setPlatform(Platform.WINDOWS);
break;
case "vista":
capabilities.setPlatform(Platform.VISTA);
break;
case "mac":
capabilities.setPlatform(Platform.MAC);
break;
default:
capabilities.setPlatform(Platform.LINUX);
if (!isEmpty(operatingSystem)) {
Platform platform = Platform.fromString(operatingSystem);
capabilities.setPlatform(platform);
}

String browser = RuntimeParametersSelenium.BROWSER.getValue();
Expand All @@ -474,13 +465,16 @@ private static INewWebDriver getRemoteDriver(MutableCapabilities options) {
} else {
throw new IllegalStateException("Unsupported browser: " + browser);
}

capabilities.setBrowserName(browser);
//Backward compatibility with Selenium 3 grids
if (Boolean.parseBoolean(System.getProperty("selenium3grid", "false"))) {
capabilities.setCapability("version", RuntimeParametersSelenium.BROWSER_VERSION.getValue());
} else {
capabilities.setVersion(RuntimeParametersSelenium.BROWSER_VERSION.getValue());

String browserVersion = RuntimeParametersSelenium.BROWSER_VERSION.getValue();
if (!isEmpty(browserVersion)) {
//Backward compatibility with Selenium 3 grids
if (Boolean.parseBoolean(System.getProperty("selenium3grid", "false"))) {
capabilities.setCapability("version", browserVersion);
} else {
capabilities.setVersion(browserVersion);
}
}

RuntimeParametersSelenium.BROWSER_OPTIONS.getValues().forEach((key, value) -> {
Expand Down
6 changes: 3 additions & 3 deletions mrchecker-framework-modules/mrchecker-webapi-module/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
<parent>
<artifactId>mrchecker-test-framework</artifactId>
<groupId>com.capgemini.mrchecker</groupId>
<version>2023.02.02</version>
<version>2023.02.03</version>
</parent>

<artifactId>mrchecker-webapi-module</artifactId>
<version>2023.02.02</version>
<version>2023.02.03</version>
<packaging>jar</packaging>
<name>MrChecker - WebApi - Module</name>
<description>
Expand Down Expand Up @@ -80,7 +80,7 @@
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>mrchecker-core-module</artifactId>
<version>2023.02.02</version>
<version>2023.02.03</version>
</dependency>

<!-- Dependency to REST and SOAP lib -->
Expand Down
2 changes: 1 addition & 1 deletion mrchecker-framework-modules/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.capgemini.mrchecker</groupId>
<artifactId>mrchecker-test-framework</artifactId>
<version>2023.02.02</version>
<version>2023.02.03</version>
<name>MrChecker</name>
<description>MrChecker Test Framework is an automated testing framework for functional testing of web applications,
native mobile apps, webservices and database.
Expand Down

0 comments on commit 81408ec

Please sign in to comment.