Update selenium-java-ci.yml #13
This file contains hidden or 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
# GitHub Actions Workflow for Selenium Java Web UI Automation | |
# This GitHub Actions workflow is designed to build a Maven project and execute Selenium tests using the Chrome browser. | |
# The automation project utilizes TestNG, Selenium, Maven, and Java as its core technologies. | |
# For more details on building and testing Java projects with Maven using GitHub Actions, please refer to the official documentation: | |
# https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven | |
name: Selenium Java Web UI Automation CI | |
on: | |
push: | |
branches: | |
- '**' | |
pull_request: | |
branches: | |
- '**' | |
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' | |
- name: Set up Maven 3.6.3 | |
run: | | |
wget -q https://archive.apache.org/dist/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.tar.gz | |
tar -xzf apache-maven-3.6.3-bin.tar.gz | |
export PATH=$(pwd)/apache-maven-3.6.3/bin:$PATH | |
- name: Set up Chrome browser | |
uses: browser-actions/setup-chrome@latest | |
with: | |
chrome-version: 'latest' | |
test: | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Check build environment | |
run: | | |
echo "Java version:" | |
java -version | |
echo "Maven version:" | |
mvn -version | |
echo "Chrome version:" | |
google-chrome --version | |
- name: Execute smoke test suite | |
run: mvn clean test -Pheadless-chrome,qa,smoke-test | |
- name: Archive test reports | |
if: always() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: test-reports | |
path: reports |