Code refactored by adding a functional interface for closing the driver #4
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 Gauge Selenium Java Web UI Automation | |
# This GitHub Actions workflow is designed to build a Maven project and execute Gauge Selenium tests using the Chrome browser. | |
# The automation project utilizes Gauge, 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: Gauge Selenium Java Web UI Automation CI | |
on: | |
push: | |
branches: | |
- '**' | |
pull_request: | |
branches: | |
- '**' | |
jobs: | |
test: | |
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: Install Gauge using CURL | |
run: npm install -g @getgauge/cli | |
- name: Install Gauge-Java plugin | |
run: gauge install java --version 0.10.3 | |
- name: Set up Chrome browser | |
uses: browser-actions/setup-chrome@latest | |
with: | |
chrome-version: 'latest' | |
- name: Check build environment | |
run: | | |
echo "Java version:" | |
java -version | |
echo "Maven version:" | |
mvn -version | |
echo "Chrome version:" | |
google-chrome --version | |
echo "Gauge version:" | |
gauge -v | |
- name: Execute regression test suite | |
run: mvn test-compile gauge:execute -DspecsDir="specs" -Denv="dev" | |
- name: Archive test reports | |
if: always() | |
uses: actions/upload-artifact@v3 | |
with: | |
name: test-reports | |
path: reports |