From 748cb74d46e17ac52222cc0c5911dae2cffdb77a Mon Sep 17 00:00:00 2001 From: Adrian Ciuciui Date: Sun, 13 Apr 2025 17:11:04 +0300 Subject: [PATCH 1/6] Added configurations to the chromedriver so that it doesn't get blocked Updated versions in POM --- pom.xml | 4 ++-- src/test/java/saucedemo/base/BaseTest.java | 12 +++++++----- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/pom.xml b/pom.xml index b03de8e..88f3a7f 100644 --- a/pom.xml +++ b/pom.xml @@ -27,7 +27,7 @@ io.rest-assured rest-assured - 4.5.1 + 5.4.0 test @@ -41,7 +41,7 @@ io.github.bonigarcia webdrivermanager - 5.5.3 + 5.6.3 diff --git a/src/test/java/saucedemo/base/BaseTest.java b/src/test/java/saucedemo/base/BaseTest.java index 367ea0d..90fccf7 100644 --- a/src/test/java/saucedemo/base/BaseTest.java +++ b/src/test/java/saucedemo/base/BaseTest.java @@ -37,14 +37,16 @@ public void readPropertiesFile() { @BeforeMethod public void setup() { - WebDriverManager.chromedriver().setup(); ChromeOptions options = new ChromeOptions(); - options.addArguments("--no-sandbox"); - options.addArguments("--disable-dev-shm-usage"); - options.addArguments("--headless"); + options.addArguments("--no-sandbox"); // Bypass OS security model + options.addArguments("--incognito"); // Runs a new, clean instance of the browser + options.addArguments("--disable-dev-shm-usage"); // Overcome limited resource problems in Docker + options.addArguments("--headless"); // The browser is not displayed + options.addArguments("--disable-gpu"); // Disables the GPU, used when running headless + options.addArguments("--start-maximized"); // Runs on the entire screen + options.addArguments("--disable-features=PasswordCheck"); // No longer displays a pop-up mentioning that the "passwords are exposed in a data breach" driver = new ChromeDriver(options); - driver.manage().window().maximize(); driver.navigate().to(PROPERTIES.getProperty("url.base")); BasePageObject.setDriver(driver); waitImplicit(1); From d425ea0688c1db5bbb6ec603abea5e9228a56539 Mon Sep 17 00:00:00 2001 From: Adrian Ciuciui <31804204+AdrianCiuciui@users.noreply.github.com> Date: Sun, 13 Apr 2025 14:04:33 +0300 Subject: [PATCH 2/6] Delete .github/workflows/maven-publish.yml --- .github/workflows/maven-publish.yml | 29 ----------------------------- 1 file changed, 29 deletions(-) delete mode 100644 .github/workflows/maven-publish.yml diff --git a/.github/workflows/maven-publish.yml b/.github/workflows/maven-publish.yml deleted file mode 100644 index 6d2a763..0000000 --- a/.github/workflows/maven-publish.yml +++ /dev/null @@ -1,29 +0,0 @@ -# This workflow will build a package using Maven and then publish it to GitHub packages when a release is created -# For more information see: https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#apache-maven-with-a-settings-path - -name: Run Tests for the Project - -on: - push: - branches: - - master - pull_request: - branches: - - master - workflow_dispatch: - -jobs: - tests: - runs-on: ubuntu-latest - - steps: - - name: Checkout - uses: actions/checkout@v3 - - name: Set up JDK 11 - uses: actions/setup-java@v3 - with: - java-version: '11' - distribution: 'temurin' - cache: maven - - name: Run tests - run: mvn test From 3579b66b044b66918a8a7aa79dc180f8fb95e57a Mon Sep 17 00:00:00 2001 From: Adrian Ciuciui <31804204+AdrianCiuciui@users.noreply.github.com> Date: Sun, 13 Apr 2025 14:14:25 +0300 Subject: [PATCH 3/6] Update maven.yml --- .github/workflows/maven.yml | 24 ++++++------------------ 1 file changed, 6 insertions(+), 18 deletions(-) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index c6bb036..2872d8f 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -1,35 +1,23 @@ # This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven -# This workflow uses actions that are not certified by GitHub. -# They are provided by a third-party and are governed by -# separate terms of service, privacy policy, and support -# documentation. - -name: Java CI with Maven +name: Java Selenium Maven Tests on: push: - branches: [ "master" ] + branches: [ main ] pull_request: - branches: [ "master" ] + branches: [ main ] jobs: - build: - + test: runs-on: ubuntu-latest - steps: - uses: actions/checkout@v4 - - name: Set up JDK 17 + - name: Set up JDK uses: actions/setup-java@v4 with: - java-version: '17' - distribution: 'temurin' + java-version: 17 cache: maven - name: Build with Maven run: mvn -B package --file pom.xml - - # Optional: Uploads the full dependency graph to GitHub to improve the quality of Dependabot alerts this repository can receive - - name: Update dependency graph - uses: advanced-security/maven-dependency-submission-action@571e99aab1055c2e71a1e2309b9691de18d6b7d6 From b1b01ba5ac4bd13832a7bdf0b17a88511c2953e2 Mon Sep 17 00:00:00 2001 From: Adrian Ciuciui <31804204+AdrianCiuciui@users.noreply.github.com> Date: Sun, 13 Apr 2025 14:24:30 +0300 Subject: [PATCH 4/6] Update pom.xml --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 88f3a7f..463a228 100644 --- a/pom.xml +++ b/pom.xml @@ -21,7 +21,7 @@ org.seleniumhq.selenium selenium-java - 4.12.1 + 4.31.0 From 0649157db0ad1305f2a1afcfd596084ed6fbc371 Mon Sep 17 00:00:00 2001 From: Adrian Ciuciui <31804204+AdrianCiuciui@users.noreply.github.com> Date: Sun, 13 Apr 2025 16:05:35 +0300 Subject: [PATCH 5/6] Update maven.yml --- .github/workflows/maven.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 2872d8f..7b5ef76 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -5,9 +5,9 @@ name: Java Selenium Maven Tests on: push: - branches: [ main ] + branches: [ master ] pull_request: - branches: [ main ] + branches: [ master ] jobs: test: @@ -20,4 +20,4 @@ jobs: java-version: 17 cache: maven - name: Build with Maven - run: mvn -B package --file pom.xml + run: mvn test --file pom.xml From f0ce46b83fe1cf0b8b25bbccc7017822a0b99b86 Mon Sep 17 00:00:00 2001 From: Adrian Ciuciui <31804204+AdrianCiuciui@users.noreply.github.com> Date: Sun, 13 Apr 2025 16:10:01 +0300 Subject: [PATCH 6/6] Update maven.yml --- .github/workflows/maven.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 7b5ef76..f917c5b 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -18,6 +18,7 @@ jobs: uses: actions/setup-java@v4 with: java-version: 17 + distribution: 'temurin' cache: maven - name: Build with Maven run: mvn test --file pom.xml