Run TestSuite For Web Browser #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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: Run TestSuite For Web Browser | |
on: | |
workflow_dispatch: | |
inputs: | |
web-browser: | |
description: 'select the Web Browser' | |
type: choice | |
options: | |
- "chrome" | |
- "safari" | |
default: 'chrome' | |
required: true | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up JDK 11 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '11' | |
distribution: 'temurin' | |
cache: maven | |
- uses: browser-actions/setup-chrome@latest | |
- run: chrome --version | |
- name: test with Maven | |
run: mvn clean test -Dplatform=web "-DreportTitle=Sample Web Automation Test Report" -Dbrowser=${{github.event.inputs.web-browser}} -DrunMode=cloud -DsuiteFile=testng.xml | |
- name: Check Automation report was generated | |
id: check_files | |
uses: andstor/file-existence-action@v2 | |
with: | |
files: "reports/test-suite-report.html" | |
- name: Upload test results | |
if: always() | |
uses: actions/upload-artifact@v3 | |
with: | |
name: test_execution_results | |
path: reports/ | |
- name: send summary report email | |
uses: dawidd6/action-send-mail@v3 | |
if: always() | |
with: | |
server_address: smtp.gmail.com | |
server_port: 465 | |
username: ${{ secrets.EMAIL_USERNAME }} | |
password: ${{ secrets.EMAIL_PASSWORD }} | |
subject: 'Web Automation Test Report - ${{ steps.date.outputs.time }}' | |
body: Build job of ${{github.repository}} completed successfully.Below is the Result summary. for Complete Details, Download the attached report. | |
html_body: file://target/surefire-reports/emailable-report.html | |
to: ${{ secrets.EMAIL_RECIPIENT_LIST }} | |
cc: ${{ secrets.EMAIL_CC_LIST }} | |
from: ${{ secrets.EMAIL_USERNAME }} | |
attachments: reports/test-suite-report.html |