Skip to content

Commit

Permalink
Merge pull request #5 from jdi-templates/issue-3250/make-all-template…
Browse files Browse the repository at this point in the history
…-repositories-actual

issue-3250: configured integration and minor refactoring
  • Loading branch information
n-ton4 authored Sep 13, 2021
2 parents 4d915d9 + e3acb43 commit 810318e
Show file tree
Hide file tree
Showing 10 changed files with 131 additions and 431 deletions.
86 changes: 86 additions & 0 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
# This workflow will build a Java project with Maven
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven

name: Java CI with Maven
env:
ALLURE_VERSION: "2.10.0"

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:
name: Tests on JDK
runs-on: ubuntu-18.04
strategy:
max-parallel: 1
fail-fast: false
matrix:
java: [ 8, 9, 10, 11, 12, 13, 14, 15 ] # doesn't work on 16

steps:
- uses: actions/checkout@v2
- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v1
with:
java-version: ${{ matrix.java }}
java-package: jdk

- name: Build with Maven
id: build
run: mvn install -DskipTests -ntp

- name: Start Selenoid
uses: n-ton4/selenoid-github-action@master
id: start-selenoid
if: github.event_name == 'pull_request' && success()
with:
version: 1.10.1
args: -limit 6
browsers: firefox:91.0
last-versions: 1

- name: Check Selenoid has been started
run: curl http://localhost:4444/status
if: github.event_name == 'pull_request' && success()

- name: Tests
id: ftests
timeout-minutes: 10
if: github.event_name == 'pull_request' && success()
run: mvn test -Pci -ntp

- name: Get Allure history
uses: actions/checkout@v2
id: allure-setup
continue-on-error: true
if: github.event_name == 'pull_request' && failure()
with:
ref: gh-pages
path: gh-pages

- name: Generate Allure report
uses: simple-elf/allure-report-action@master
if: github.event_name == 'pull_request' && always()
with:
allure_results: target/allure-results
allure_report: target/allure-report
allure_history: allure-history

- name: Upload Allure report
uses: actions/upload-artifact@master
if: github.event_name == 'pull_request' && failure()
with:
name: Allure report
path: target/allure-report

- name: Deploy Allure report to Github Pages
if: github.event_name == 'pull_request' && always()
uses: peaceiris/actions-gh-pages@v2
env:
PERSONAL_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PUBLISH_BRANCH: gh-pages
PUBLISH_DIR: allure-history
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- stage: compile
name: Compile jdi light saucelabs template
script:
- mvn install
- mvn install -DskipTests
after_failure:
- echo "Build was failed"
after_success:
Expand Down
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Before running JDI project in Sauce Lab, you need to set up Sauce Lab Credentials

#### Set Your Sauce Labs Credentials
1. Copy your Sauce Labs **username** and **accessKey** in the [User Settings](https://app.saucelabs.com/user-settings) section of the [Sauce Labs Dashboard](https://app.saucelabs.com/dashboard/builds).
1. Copy your Sauce Labs **username** and **accessKey** from the [User Settings](https://app.eu-central-1.saucelabs.com/user-settings).
2. Open a Terminal window (command prompt for Windows) and set your Sauce Labs Environment variables:
###### Mac OSX:
```
Expand Down Expand Up @@ -69,3 +69,8 @@ See your personal remote url: [here](https://app.saucelabs.com/user-settings) lo
Remote url should be different if you are from US.

And that it. Set Sauce Lab capabilities, set remote execution in test.properties and you can run test with Sauce Lab

#### Alternative way to run tests using CLI (you don't need to set env properties preliminary in your OS)

mvn -DUSERNAME=your_sauce_user_name -DACCESS_KEY=your_sauce_access_key -Dremote.type=sauce -Dremote.url=your_sauce_remote_url clean install
mvn allure:serve
52 changes: 30 additions & 22 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,38 @@

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<aspectj.version>1.9.1</aspectj.version>
<driver>chrome</driver>
<driver>firefox</driver>
<remote.type/>
<remote.url/>
<aspectj.version>1.9.6</aspectj.version>
<domain>https://jdi-testing.github.io/jdi-light/</domain>
<allure.testng>2.12.0</allure.testng>
<allure.maven>2.9</allure.maven>
<allure.testng>2.13.3</allure.testng>
<allure.maven>2.10.0</allure.maven>
<jetty.version>9.4.12.RC2</jetty.version>
<jdi.version>1.3.14</jdi.version>
<USERNAME/>
<ACCESS_KEY/>
</properties>

<profiles>
<profile>
<id>ci</id>
<activation>
<activeByDefault>false</activeByDefault>
</activation>
<properties>
<remote.type>selenoid</remote.type>
<remote.url>http://localhost:4444/wd/hub</remote.url>
</properties>
</profile>
</profiles>

<dependencies>
<!--JDI-->
<dependency>
<groupId>com.epam.jdi</groupId>
<artifactId>jdi-light-html</artifactId>
<version>RELEASE</version>
<version>${jdi.version}</version>
</dependency>

<!--Allure-->
Expand Down Expand Up @@ -57,26 +75,16 @@
<suiteXmlFiles>
<suiteXmlFile>src/test/resources/general.xml</suiteXmlFile>
</suiteXmlFiles>
<testFailureIgnore>true</testFailureIgnore>
<argLine>
-javaagent:"${settings.localRepository}/org/aspectj/aspectjweaver/${aspectj.version}/aspectjweaver-${aspectj.version}.jar"
</argLine>
<properties>
<property>
<name>listener</name>
<value>io.qameta.allure.testng.AllureTestNg</value>
</property>
</properties>
<systemProperties>
<property>
<name>allure.results.directory</name>
<value>${project.build.directory}/target/allure-results</value>
</property>
<property>
<name>allure.link.issue.pattern</name>
<value>https://example.org/issue/{}</value>
</property>
</systemProperties>
<systemPropertyVariables>
<allure.results.directory>${project.build.directory}/allure-results</allure.results.directory>
</systemPropertyVariables>
<environmentVariables>
<USERNAME>${USERNAME}</USERNAME>
<ACCESS_KEY>${ACCESS_KEY}</ACCESS_KEY>
</environmentVariables>
</configuration>
<dependencies>
<dependency>
Expand Down
Loading

0 comments on commit 810318e

Please sign in to comment.