Skip to content

Merge pull request #86 from ERNI-Academy/feature/allure-report #5

Merge pull request #86 from ERNI-Academy/feature/allure-report

Merge pull request #86 from ERNI-Academy/feature/allure-report #5

Workflow file for this run

name: Run-web-tests
on:
workflow_call:
inputs:
driver_type:
required: true
type: string
test_results_path:
required: true
type: string
environment:
required: true
type: string
jobs:
web-tests:
strategy:
matrix:
os: ${{fromJson(inputs.environment)}}
browser: ${{fromJson(inputs.driver_type)}}
fail-fast: false
name: Run WEB (${{ matrix.browser }}) tests - ${{ matrix.os }}
runs-on: ${{ matrix.os }}
steps:
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.x
- uses: LexisNexis-Public-GHA/sbs-action-download-artifact@v2.13.1
with:
workflow: CI.yml
name: testing-artifact-selenium-web
- name: Run git init
run: git init
- name: Get Driver path by browser
run: |
switch ( "${{ matrix.browser }}".ToLower() )
{
"chrome" { $driverPathRaw = "$env:CHROMEWEBDRIVER" }
"firefox" { $driverPathRaw = "$env:GeckoWebDriver" }
"edge" { $driverPathRaw = "$env:EdgeWebDriver" }
"internetexplorer" { $driverPathRaw = "$env:IEWebDriver" }
}
echo "driverPathRaw=$driverPathRaw" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf-8 -Append
shell: pwsh
- name: config replacement
uses: microsoft/variable-substitution@v1
with:
files: '.\TestConfiguration.Web.json'
env:
Configurations.0.Capabilities.0.Path: ${{ env.driverPathRaw }}
Configurations.0.Capabilities.0.Driver: ${{ matrix.browser }}
Configurations.1.Capabilities.0.Driver: ${{ matrix.browser }}
Configurations.1.Capabilities.0.Path: ${{ env.driverPathRaw }}
Configurations.1.Capabilities.1.Driver: ${{ matrix.browser }}
Configurations.1.Capabilities.1.Path: ${{ env.driverPathRaw }}
Configurations.1.Capabilities.2.Driver: ${{ matrix.browser }}
Configurations.1.Capabilities.2.Path: ${{ env.driverPathRaw }}
TestResultPath: ${{ inputs.test_results_path }}
- name: Read configuration
id: config_file
uses: juliangruber/read-file-action@v1
with:
path: '.\TestConfiguration.Web.json'
- name: Echo configuration.json
run: echo "${{ steps.config_file.outputs.content }}"
- name: Run tests
run: dotnet test TestWare.Samples.Selenium.Web.dll --logger "trx;LogFileName=results.trx" --results-directory "${{ inputs.test_results_path }}"
- name: Archive WEB (${{ matrix.browser }}) screenshots
if: always()
uses: actions/upload-artifact@v2
with:
name: web-${{ matrix.browser }}-screenshots
path: |
${{ inputs.test_results_path }}
- name: Archive Testing artifacts - Allure
uses: actions/upload-artifact@v2

Check failure on line 79 in .github/workflows/Run_web_tests.yml

GitHub Actions / .github/workflows/Run_web_tests.yml

Invalid workflow file

You have an error in your yaml syntax on line 79
with:
name: allure-results-web
path: '.\allure-results'
- name: Test Report
uses: dorny/test-reporter@v1
if: success() || failure()
with:
name: Report - WEB (${{ matrix.browser }} - ${{ matrix.os }})
path: ${{ inputs.test_results_path }}/results.trx
reporter: dotnet-trx
allure-results:
uses: ./.github/workflows/Allure_Report.yml
with:
artifact_name: 'allure-results-web'
workflow: 'Run_web_tests.yml'