-
Notifications
You must be signed in to change notification settings - Fork 5
57 lines (54 loc) · 2.1 KB
/
playwright.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
name: Playwright Tests
on:
schedule:
- cron: '0 23 * * *'
pull_request:
branches: [ main, master ]
paths: ['Kiss.Bff.EndToEndTest/**']
workflow_dispatch:
jobs:
test:
timeout-minutes: 60
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./Kiss.Bff.EndToEndTest
steps:
- uses: actions/checkout@v4
- name: Setup dotnet
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- run: dotnet build
- name: Ensure browsers are installed
run: pwsh bin/Debug/net8.0/playwright.ps1 install --with-deps
- name: Run your tests
id: e2e
run: dotnet test --logger trx
env:
'TestSettings:TEST_USERNAME': ${{ secrets.PLAYWRIGHT_USERNAME }}
'TestSettings:TEST_PASSWORD': '${{ secrets.PLAYWRIGHT_PASSWORD }}'
'TestSettings:TEST_TOTP_SECRET': ${{ secrets.PLAYWRIGHT_TOTP_SECRET }}
'TestSettings:TEST_BASE_URL': ${{ secrets.PLAYWRIGHT_BASE_URL }}
- name: Create html file
if: ${{ failure() && steps.e2e.conclusion == 'failure' }}
run: |
cd bin/Debug/net8.0/playwright-traces
my_string=$(echo *.zip)
IFS=' ' read -ra my_array <<< "$my_string"
result='<!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>Playwright traces</title></head><body><ul>'
#Print the split string
for i in "${my_array[@]}"
do
result+="<li><a target=\"_blank\" href=\"https://trace.playwright.dev/?trace=https://klantinteractie-servicesysteem.github.io/KISS-frontend/$i\">$i</a></li>"
done
result+="</ul></body></html>"
echo "$result"
echo "$result" > index.html
- name: Deploy to GitHub Pages
if: ${{ failure() && steps.e2e.conclusion == 'failure' }}
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./Kiss.Bff.EndToEndTest/bin/Debug/net8.0/playwright-traces # directory of your reports
publish_branch: gh-pages/e2e # deploying to gh-pages branch