Skip to content

Commit

Permalink
Update dependency com.saucelabs:saucebindings-junit5 to v1.5.0 (#177)
Browse files Browse the repository at this point in the history
* Update dependency com.saucelabs:saucebindings-junit5 to v1.5.0

* Fixing tests

* Correcting name

* Avoid setting file name

* Setting cap when app name is not null

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Diego Molina <[email protected]>
  • Loading branch information
renovate[bot] and diemol authored Jul 15, 2024
1 parent aee8e5d commit 32e36ae
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 67 deletions.
6 changes: 1 addition & 5 deletions .github/workflows/gitpod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,10 @@ jobs:
with:
java-version: 11
- name: Run tests
working-directory: ./gitpod
env:
SAUCE_USERNAME: ${{ secrets.SAUCE_USERNAME }}
SAUCE_ACCESS_KEY: ${{ secrets.SAUCE_ACCESS_KEY }}
BUILD: 'selenium-build-whatever'
BROWSER_NAME: chrome
# !!!IMPORTANT!!! THIS MUST ALWAYS MATCH WHAT IS IN GITPOD.YML; SAUCE LABS CUSTOMERS RELY ON THIS!!!!:
run: |
mvn dependency:resolve
mvn test-compile
mvn test -Dtest=SeleniumTest
run: mvn test -pl gitpod
118 changes: 58 additions & 60 deletions gitpod/pom.xml
Original file line number Diff line number Diff line change
@@ -1,67 +1,65 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>demo-java</artifactId>
<groupId>com.saucelabs</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>demo-java</artifactId>
<groupId>com.saucelabs</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

<artifactId>gitpod</artifactId>
<artifactId>gitpod</artifactId>

<properties>
<maven.surefire.version>3.0.0-M5</maven.surefire.version>
<appium.version>9.0.0</appium.version>
<selenium.version>4.14.1</selenium.version>
</properties>
<properties>
<maven.surefire.version>3.3.1</maven.surefire.version>
<appium.version>9.0.0</appium.version>
<selenium.version>4.14.1</selenium.version>
</properties>

<dependencies>
<dependency>
<groupId>com.saucelabs</groupId>
<artifactId>saucebindings-junit5</artifactId>
<version>1.0.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>${selenium.version}</version>
</dependency>
<dependency>
<groupId>io.appium</groupId>
<artifactId>java-client</artifactId>
<version>${appium.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
<dependencies>
<dependency>
<groupId>com.saucelabs</groupId>
<artifactId>saucebindings-junit5</artifactId>
<version>1.5.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>${selenium.version}</version>
</dependency>
<dependency>
<groupId>io.appium</groupId>
<artifactId>java-client</artifactId>
<version>${appium.version}</version>
<scope>test</scope>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>${maven.surefire.version}</version>
<configuration>
<systemPropertyVariables>
<PARALLELISM>20</PARALLELISM>
<MINIMUM_RUNNABLE>20</MINIMUM_RUNNABLE>
<MAX_POOL_SIZE>20</MAX_POOL_SIZE>
<CORE_POOL_SIZE>20</CORE_POOL_SIZE>
</systemPropertyVariables>
<properties>
<configurationParameters>
junit.jupiter.execution.parallel.enabled = true
junit.jupiter.execution.parallel.mode.default = concurrent
junit.jupiter.execution.parallel.mode.classes.default = concurrent
junit.jupiter.execution.parallel.config.strategy = fixed
junit.jupiter.execution.parallel.config.strategy = custom
junit.jupiter.execution.parallel.config.custom.class = com.saucelabs.saucebindings.junit5.CustomStrategy
</configurationParameters>
</properties>
</configuration>
</plugin>
</plugins>
</build>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>${maven.surefire.version}</version>
<configuration>
<systemPropertyVariables>
<PARALLELISM>20</PARALLELISM>
<MINIMUM_RUNNABLE>20</MINIMUM_RUNNABLE>
<MAX_POOL_SIZE>20</MAX_POOL_SIZE>
<CORE_POOL_SIZE>20</CORE_POOL_SIZE>
</systemPropertyVariables>
<properties>
<configurationParameters>
junit.jupiter.execution.parallel.enabled = true
junit.jupiter.execution.parallel.mode.default = concurrent
junit.jupiter.execution.parallel.mode.classes.default = concurrent
junit.jupiter.execution.parallel.config.strategy = dynamic
</configurationParameters>
</properties>
</configuration>
</plugin>
</plugins>
</build>
</project>
6 changes: 4 additions & 2 deletions gitpod/src/test/java/com/saucedemo/selenium/AppiumTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,16 @@ public void setup(TestInfo testInfo) throws MalformedURLException {
options.setCapability(
"browserName", System.getenv().getOrDefault("BROWSER_NAME", defaultBrowser));
options.setCapability("platformName", platformName);
options.setCapability("appium:app", "storage:filename=" + appName);
if (appName != null) {
options.setCapability("appium:app", "storage:filename=" + appName);
}
options.setCapability("appium:platformVersion", System.getenv("PLATFORM_VERSION"));
options.setCapability(
"appium:deviceName", System.getenv().getOrDefault("DEVICE_NAME", "Google.*"));
options.setCapability(
"appium:automationName", System.getenv().getOrDefault("AUTOMATION_NAME", "UiAutomator2"));

ArrayList<String> tags = new ArrayList();
ArrayList<String> tags = new ArrayList<>();
if (System.getenv("GITPOD_WORKSPACE_ID") != null) {
tags.add("gitpod");
}
Expand Down

0 comments on commit 32e36ae

Please sign in to comment.