Skip to content

Commit

Permalink
Merge pull request #21 from selenium3bymukesh/master
Browse files Browse the repository at this point in the history
Updated github action workflow
  • Loading branch information
Mukesh-50 authored Sep 16, 2023
2 parents e29a374 + bbf5c6c commit ca8db92
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 38 deletions.
24 changes: 14 additions & 10 deletions .github/workflows/mavennew.yml → .github/workflows/Dependent.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,15 @@ on:

jobs:
SeleniumLinux:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up JDK 8
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: 8.0.302+8
java-version: '11'
distribution: 'temurin'
- name: Test On Linux
run: mvn clean test -DBrowser=Chrome
Expand All @@ -26,22 +28,24 @@ jobs:
needs: SeleniumLinux
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 1.8
uses: actions/setup-java@v1
- uses: actions/checkout@v3
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: 1.8
java-version: '11'
distribution: 'temurin'
- name: Test with Windows
run: mvn clean test -DBrowser=Chrome

SeleniumMACOS:
needs: SeleniumWindow
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 1.8
uses: actions/setup-java@v1
- uses: actions/checkout@v3
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: 1.8
java-version: '11'
distribution: 'temurin'
- name: Test with MacOS
run: mvn clean test -DBrowser=Chrome
26 changes: 14 additions & 12 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,33 +15,35 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- name: Set up JDK 8
uses: actions/setup-java@v1
- uses: actions/checkout@v3
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: 8.0.302+8
java-version: '11'
distribution: 'temurin'
- name: Test On Linux
run: mvn clean test -DBrowser=Chrome

SeleniumWindow:
runs-on: windows-latest
steps:
- uses: actions/checkout@v1
- name: Set up JDK 1.8
uses: actions/setup-java@v1
- uses: actions/checkout@v3
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: 1.8
java-version: '11'
distribution: 'temurin'
- name: Test with Windows
run: mvn clean test -DBrowser=Chrome

SeleniumMACOS:
runs-on: macos-latest
steps:
- uses: actions/checkout@v1
- name: Set up JDK 1.8
uses: actions/setup-java@v1
- uses: actions/checkout@v3
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: 1.8
java-version: '11'
distribution: 'temurin'
- name: Test with MacOS
run: mvn clean test -DBrowser=Chrome
2 changes: 1 addition & 1 deletion .github/workflows/mavenschedule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:

steps:
- uses: actions/checkout@v3
- name: Set up JDK 8
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
Expand Down
16 changes: 4 additions & 12 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,32 +7,24 @@
<version>0.0.1-SNAPSHOT</version>

<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
</properties>

<dependencies>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>7.3.0</version>
<version>7.7.1</version>

</dependency>

<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>3.141.59</version>
<version>4.12.1</version>
</dependency>

<dependency>
<groupId>io.github.bonigarcia</groupId>
<artifactId>webdrivermanager</artifactId>
<version>4.3.1</version>
</dependency>



</dependencies>

<build>
Expand Down
3 changes: 0 additions & 3 deletions src/test/java/mavenforjenkins/UITest.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import org.testng.Assert;
import org.testng.annotations.Parameters;
import org.testng.annotations.Test;
import io.github.bonigarcia.wdm.WebDriverManager;

public class UITest
{
Expand All @@ -21,7 +20,6 @@ public void startBrowser(String browserName)

if(browserName.contains("Chrome"))
{
WebDriverManager.chromedriver().setup();
ChromeOptions opt=new ChromeOptions();
opt.addArguments("--headless");
opt.addArguments("--no-sandbox");
Expand All @@ -30,7 +28,6 @@ public void startBrowser(String browserName)
}
else if(browserName.contains("Edge"))
{
WebDriverManager.edgedriver().setup();
driver=new EdgeDriver();
}
driver.manage().window().maximize();
Expand Down

0 comments on commit ca8db92

Please sign in to comment.