Skip to content

Merge pull request #95 from ismail-elshafeiy/dependabot/maven/master/… #262

Merge pull request #95 from ismail-elshafeiy/dependabot/maven/master/…

Merge pull request #95 from ismail-elshafeiy/dependabot/maven/master/… #262

Workflow file for this run

# 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: CI Tests
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
browser:
name: Run Tests
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-22.04, windows-latest, macOS-12 ]
steps:
- uses: actions/checkout@v4
- name: Setup Node.js environment
uses: actions/setup-node@v3.6.0
with:
node-version: '16'
- name: Set up Selenium Grid with one hub and four Chrome nodes
if: runner.os == 'Linux'
run: docker-compose -f src/main/resources/docker-compose.yml up --scale chrome=4 --remove-orphans -d
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'zulu'
- name: Check running containers
if: runner.os == 'Linux'
run: docker ps
- name: Run tests on Linux/MacOS
if: runner.os != 'Windows'
continue-on-error: true
run: |
if [ "$RUNNER_OS" == "Linux" ]; then
mvn test -Dexecution.type="remote" -Dbrowser.type="Google Chrome" -Dtest="examples.gui.web.elementActions.**"
elif [ "$RUNNER_OS" == "macOS" ]; then
mvn test -Dexecution.type="Local Headless" -Dbrowser.type="Google Chrome" -Dtest="examples.gui.web.elementActions.**"
else
echo "$RUNNER_OS not supported"
exit 1
fi
- name: Run tests on Windows
if: runner.os == 'Windows'
continue-on-error: true
run: |
mvn test -Dexecution.type="remote" -Dbrowser.type="Mozilla Firefox" -Dtest="examples.gui.web.elementActions.**"
- name: Generate Allure report
run: mvn allure:report
- name: Copy patch file to allure-maven-plugin folder
run: cp src/main/resources/allow-file-access_open-report_chrome_windows.bat target/site/allure-maven-plugin
- name: Check files in the allure-maven-plugin folder
run: ls target/site/allure-maven-plugin
- name: Upload Allure Report
uses: actions/upload-artifact@v3
with:
name: Allure Report
path: "target/site/allure-maven-plugin"
- name: Upload Extent Report as Pipeline Artifact
if: always()
uses: actions/upload-artifact@v3
with:
name: ${{ runner.os }} - Desktop Browsers Tests Extent Report
path: "ExtentReport/ExtentReports.html"
- name: Upload Console Logs as Pipeline Artifact
if: always()
uses: actions/upload-artifact@v3
with:
name: ${{ runner.os }} - Desktop Browsers Tests Extent Report
path: "ConsoleLogs"
# - name: Get Allure history
# uses: actions/checkout@v4
# if: always()
# continue-on-error: true
# with:
# ref: gh-pages
# path: gh-pages
# - name: Generate Allure Report with history
# uses: simple-elf/allure-report-action@master
# if: always()
# id: allure-report
# with:
# allure_results: target/allure-results
# gh_pages: gh-pages
# allure_report: allure-report
# allure_history: allure-history
# subfolder: allure
# - name: Deploy Allure report to Github Pages
# uses: peaceiris/actions-gh-pages@v3.8.0
# with:
# personal_token: ${{ secrets.GITHUB_TOKEN }}
# publish_dir: allure-history/allure
# destination_dir: allure
# publish_branch: gh-pages
# - name: Post the link to the Allure report
# if: always()
# continue-on-error: true
# uses: Sibz/github-status-action@v1.1.5
# with:
# authToken: ${{secrets.GITHUB_TOKEN}}
# context: 'Allure Test Execution Report'
# state: 'success'
# sha: ${{ github.event.pull_request.head.sha }}
# target_url: https://github.com/ismailElshafeiy/TestAutomation_JAVA/allure/${{ github.run_number }}