Skip to content

Run Playwright Website Tests & Swap Slots if successful #179

Run Playwright Website Tests & Swap Slots if successful

Run Playwright Website Tests & Swap Slots if successful #179

name: Run Playwright Website Tests
on:
workflow_run:
workflows: ["Deploy Website"]
types:
- completed
workflow_dispatch:
env:
WORKING_DIRECTORY: tests/web/Jordnaer.E2E.Tests
jobs:
playwright:
runs-on: ubuntu-latest
container:
image: mcr.microsoft.com/playwright/dotnet:v1.42.0-jammy
options: --user 1001
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up dotnet
uses: actions/setup-dotnet@v4
with:
dotnet-version: "8.x"
- name: Test
# Dependabot cannot access secrets, so we disable this step for Dependabot
if: github.actor != 'dependabot[bot]' && github.actor != 'dependabot-preview[bot]'
run: >
dotnet test "${{ env.WORKING_DIRECTORY }}"
--logger "GitHubActions;summary.includePassedTests=true;summary.includeSkippedTests=true"
--filter Category!=ManualTest
env:
ConnectionStrings__AppConfig: ${{ secrets.AZURE_APP_CONFIGURATION_CONNECTION_STRING }}
- name: Upload Screenshots
if: always()
uses: actions/upload-artifact@v4
with:
name: screenshots
path: "${{ env.WORKING_DIRECTORY }}/bin/Debug/screenshots"