Skip to content

Add README

Add README #2

name: Test & Report

Check failure on line 1 in .github/workflows/playwright-tests.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/playwright-tests.yml

Invalid workflow file

(Line: 31, Col: 9): There's not enough info to determine what you meant. Add one of these properties: run, shell, uses, with, working-directory
on:
workflow_dispatch:
inputs:
testSuite:
description: "Which tests to run"
type: choice
required: true
default: smoke
options:
- smoke
- regression
- LoginPage
- SecureArea
permissions:
contents: write
pages: write
id-token: write
jobs:
test_chromium:
name: Run tests (Chromium)
runs-on: ubuntu-latest
env:
BROWSER: chromium
steps:
- name: Checkout
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: "10.0.x"
- name: Restore
run: dotnet restore Tests.csproj
- name: Build
run: dotnet build Tests.csproj --configuration Release --no-restore
- name: Install Playwright browsers
run: pwsh bin/Release/net10.0/playwright.ps1 install --with-deps
- name: Run tests (Chromium)
env:
TEST_SUITE: ${{ github.event.inputs.testSuite }}
run: |
if [ "$TEST_SUITE" = "smoke" ]; then
FILTER='TestCategory=smoke'
elif [ "$TEST_SUITE" = "regression" ]; then
FILTER=''
elif [ "$TEST_SUITE" = "LoginPage" ]; then
FILTER='FullyQualifiedName~LoginPageTests'
elif [ "$TEST_SUITE" = "SecureArea" ]; then
FILTER='FullyQualifiedName~SecureAreaTests'
else
FILTER=''
fi
if [ -z "$FILTER" ]; then
dotnet test Tests.csproj --configuration Release
else
dotnet test Tests.csproj --configuration Release --filter "$FILTER"
fi
- name: Upload Allure results (Chromium)
if: always()
uses: actions/upload-artifact@v4
with:
name: allure-results-chromium
path: "**/allure-results"
if-no-files-found: ignore
test_firefox:
name: Run tests (Firefox)
runs-on: ubuntu-latest
env:
BROWSER: firefox
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: "10.0.x"
- name: Restore
run: dotnet restore Tests.csproj
- name: Build
run: dotnet build Tests.csproj --configuration Release --no-restore
- name: Install Playwright browsers
run: pwsh bin/Release/net10.0/playwright.ps1 install --with-deps
- name: Run tests (Firefox)
env:
TEST_SUITE: ${{ github.event.inputs.testSuite }}
run: |
if [ "$TEST_SUITE" = "smoke" ]; then
FILTER='TestCategory=smoke'
elif [ "$TEST_SUITE" = "regression" ]; then
FILTER=''
elif [ "$TEST_SUITE" = "LoginPage" ]; then
FILTER='FullyQualifiedName~LoginPageTests'
elif [ "$TEST_SUITE" = "SecureArea" ]; then
FILTER='FullyQualifiedName~SecureAreaTests'
else
FILTER=''
fi
if [ -z "$FILTER" ]; then
dotnet test Tests.csproj --configuration Release
else
dotnet test Tests.csproj --configuration Release --filter "$FILTER"
fi
- name: Upload Allure results (Firefox)
if: always()
uses: actions/upload-artifact@v4
with:
name: allure-results-firefox
path: "**/allure-results"
if-no-files-found: ignore
test_webkit:
name: Run tests (WebKit)
runs-on: ubuntu-latest
env:
BROWSER: webkit
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: "10.0.x"
- name: Restore
run: dotnet restore Tests.csproj
- name: Build
run: dotnet build Tests.csproj --configuration Release --no-restore
- name: Install Playwright browsers
run: pwsh bin/Release/net10.0/playwright.ps1 install --with-deps
- name: Run tests (WebKit)
env:
TEST_SUITE: ${{ github.event.inputs.testSuite }}
run: |
if [ "$TEST_SUITE" = "smoke" ]; then
FILTER='TestCategory=smoke'
elif [ "$TEST_SUITE" = "regression" ]; then
FILTER=''
elif [ "$TEST_SUITE" = "LoginPage" ]; then
FILTER='FullyQualifiedName~LoginPageTests'
elif [ "$TEST_SUITE" = "SecureArea" ]; then
FILTER='FullyQualifiedName~SecureAreaTests'
else
FILTER=''
fi
if [ -z "$FILTER" ]; then
dotnet test Tests.csproj --configuration Release
else
dotnet test Tests.csproj --configuration Release --filter "$FILTER"
fi
- name: Upload Allure results (WebKit)
if: always()
uses: actions/upload-artifact@v4
with:
name: allure-results-webkit
path: "**/allure-results"
if-no-files-found: ignore
report:
name: Generate & Publish Allure report
runs-on: ubuntu-latest
needs:
- test_chromium
- test_firefox
- test_webkit
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download Allure results
uses: actions/download-artifact@v4
with:
path: ./allure-results
- name: Generate Allure report
uses: simple-elf/allure-report-action@v1.7
with:
allure_results: ./allure-results
allure_report: ./allure-report
keep_reports: 20
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Upload GitHub Pages artifact
uses: actions/upload-pages-artifact@v3
with:
path: ./allure-report
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4