Fix: express (#38) #245
This file contains 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
name: demo.playwright | |
on: | |
workflow_dispatch: | |
pull_request: | |
branches: [main] | |
push: | |
branches: [main] | |
jobs: | |
accessibilityTests: | |
name: "accessibility tests" | |
timeout-minutes: 60 | |
runs-on: ubuntu-22.04 | |
container: mcr.microsoft.com/playwright:v1.35.1-focal | |
env: | |
TESTGROUP: accessibility | |
BASEURL: https://playwright.dev/docs/accessibility-testing # Playwright tests use this for baseURL | |
environment: | |
name: accessibility | |
url: https://testresults.marcusfelling.com/${{ env.TESTGROUP }} | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
ref: main | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: "18.x" | |
- name: Install dependencies | |
run: | | |
npm ci | |
- name: Run ${{ env.TESTGROUP }} Tests | |
continue-on-error: true | |
working-directory: ${{ env.TESTGROUP }} | |
run: | | |
npx playwright install | |
HOME=/root npx playwright test | |
- name: Upload HTML report as artifact. To troubleshoot failures, extract .zip and double-click index.html. | |
uses: actions/upload-artifact@v3 | |
if: always() | |
with: | |
name: ${{ env.TESTGROUP }} | |
path: | | |
playwright-report | |
androidTests: | |
name: "android tests" | |
if: ${{ false }} # disable for experimental | |
timeout-minutes: 60 | |
runs-on: macos-11 | |
env: | |
TESTGROUP: android | |
environment: | |
name: android | |
url: https://testresults.marcusfelling.com/${{ env.TESTGROUP }} | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
ref: main | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: "16.x" | |
- name: Install dependencies | |
run: | | |
npm ci | |
- name: run tests | |
uses: ReactiveCircus/[email protected] | |
with: | |
working-directory: android | |
api-level: 31 | |
target: "google_apis" | |
script: | | |
adb root | |
adb devices | |
npx playwright install android | |
HOME=/root npx playwright test | |
- name: Upload HTML report as artifact. To troubleshoot failures, extract .zip and double-click index.html. | |
uses: actions/upload-artifact@v3 | |
if: always() | |
with: | |
name: ${{ env.TESTGROUP }} | |
path: | | |
playwright-report | |
basicTests: | |
name: "basic tests" | |
timeout-minutes: 60 | |
runs-on: ubuntu-22.04 | |
container: mcr.microsoft.com/playwright:v1.35.1-focal | |
env: | |
TESTGROUP: basic | |
environment: | |
name: basic | |
url: https://testresults.marcusfelling.com/${{ env.TESTGROUP }} | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
ref: main | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: "18.x" | |
- name: Install dependencies | |
run: | | |
npm ci | |
- name: Run ${{ env.TESTGROUP }} Tests | |
continue-on-error: false | |
working-directory: ${{ env.TESTGROUP }} | |
run: | | |
npx playwright install | |
HOME=/root npx playwright test | |
- name: Upload HTML report as artifact. To troubleshoot failures, extract .zip and double-click index.html. | |
uses: actions/upload-artifact@v3 | |
if: always() | |
with: | |
name: ${{ env.TESTGROUP }} | |
path: playwright-report | |
chromeExtensionTests: | |
name: "chrome-extension tests" | |
timeout-minutes: 60 | |
runs-on: macos-11 | |
env: | |
TESTGROUP: chrome-extension | |
environment: | |
name: chrome-extension | |
url: https://testresults.marcusfelling.com/${{ env.TESTGROUP }} | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
ref: main | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: "18.x" | |
- name: Install dependencies | |
run: | | |
npm ci | |
npx playwright install | |
- name: Run ${{ env.TESTGROUP }} Tests | |
continue-on-error: false | |
working-directory: ${{ env.TESTGROUP }} | |
run: | | |
# Extensions only work in Chrome / Chromium in non-headless mode. | |
npx playwright test --headed --project=chromium | |
- name: Upload HTML report as artifact. To troubleshoot failures, extract .zip and double-click index.html. | |
uses: actions/upload-artifact@v3 | |
if: always() | |
with: | |
name: ${{ env.TESTGROUP }} | |
path: | | |
playwright-report | |
dragAndDropTests: | |
name: "drag-and-drop tests" | |
timeout-minutes: 60 | |
runs-on: ubuntu-22.04 | |
container: mcr.microsoft.com/playwright:v1.35.1-focal | |
env: | |
TESTGROUP: drag-and-drop | |
BASEURL: https://www.w3schools.com/html/html5_draganddrop.asp # Playwright tests use this for baseURL | |
environment: | |
name: drag-and-drop | |
url: https://testresults.marcusfelling.com/${{ env.TESTGROUP }} | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
ref: main | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: "18.x" | |
- name: Install dependencies | |
run: | | |
npm ci | |
- name: Run ${{ env.TESTGROUP }} Tests | |
continue-on-error: false | |
working-directory: ${{ env.TESTGROUP }} | |
run: | | |
npx playwright install | |
HOME=/root npx playwright test | |
- name: Upload HTML report as artifact. To troubleshoot failures, extract .zip and double-click index.html. | |
uses: actions/upload-artifact@v3 | |
if: always() | |
with: | |
name: ${{ env.TESTGROUP }} | |
path: | | |
playwright-report | |
electronTests: | |
name: "electron tests" | |
timeout-minutes: 60 | |
runs-on: macos-11 | |
env: | |
TESTGROUP: electron | |
environment: | |
name: electron | |
url: https://testresults.marcusfelling.com/${{ env.TESTGROUP }} | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
ref: main | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: "18.x" | |
- name: Install electron | |
working-directory: ${{ env.TESTGROUP }} | |
run: | | |
npm install -g electron --unsafe-perm=true --allow-root | |
- name: Install dependencies | |
working-directory: ${{ env.TESTGROUP }} | |
run: | | |
npm ci | |
- name: Run ${{ env.TESTGROUP }} Tests | |
continue-on-error: false | |
working-directory: ${{ env.TESTGROUP }} | |
run: | | |
npx playwright test | |
- name: Upload HTML report as artifact. To troubleshoot failures, extract .zip and double-click index.html. | |
uses: actions/upload-artifact@v3 | |
if: always() | |
with: | |
name: ${{ env.TESTGROUP }} | |
path: | | |
playwright-report | |
fixturesTests: | |
name: "fixtures tests" | |
timeout-minutes: 60 | |
runs-on: ubuntu-22.04 | |
container: mcr.microsoft.com/playwright:v1.35.1-focal | |
env: | |
TESTGROUP: fixtures | |
environment: | |
name: fixtures | |
url: https://testresults.marcusfelling.com/${{ env.TESTGROUP }} | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
ref: main | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: "18.x" | |
- name: Install dependencies | |
run: | | |
npm ci | |
- name: Run ${{ env.TESTGROUP }} Tests | |
continue-on-error: false | |
working-directory: ${{ env.TESTGROUP }} | |
run: | | |
HOME=/root npx playwright test test-fixture.spec.ts | |
- name: Upload HTML report as artifact. To troubleshoot failures, extract .zip and double-click index.html. | |
uses: actions/upload-artifact@v3 | |
if: always() | |
with: | |
name: ${{ env.TESTGROUP }} | |
path: | | |
playwright-report | |
githubAPITests: | |
name: "github-api tests" | |
timeout-minutes: 60 | |
runs-on: ubuntu-22.04 | |
container: mcr.microsoft.com/playwright:v1.35.1-focal | |
env: | |
TESTGROUP: github-api | |
GITHUB_USER: ${{ secrets.REPO_USER }} | |
API_TOKEN: ${{ secrets.API_TOKEN }} | |
BASEURL: https://api.github.com # Playwright tests use this for baseURL | |
environment: | |
name: github-api | |
url: https://testresults.marcusfelling.com/${{ env.TESTGROUP }} | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
ref: main | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: "18.x" | |
- name: Install dependencies | |
run: | | |
npm ci | |
- name: Run ${{ env.TESTGROUP }} Tests | |
continue-on-error: false | |
working-directory: ${{ env.TESTGROUP }} | |
run: | | |
HOME=/root npx playwright test | |
- name: Upload HTML report as artifact. To troubleshoot failures, extract .zip and double-click index.html. | |
uses: actions/upload-artifact@v3 | |
if: always() | |
with: | |
name: ${{ env.TESTGROUP }} | |
path: playwright-report | |
oauthTests: | |
name: "oauth tests" | |
timeout-minutes: 60 | |
if: ${{ false }} # disable for now for bot detection | |
runs-on: ubuntu-22.04 | |
container: mcr.microsoft.com/playwright:v1.35.1-focal | |
env: | |
TESTGROUP: oauth | |
BASEURL: https://courses.ultimateqa.com/users/sign_in # Playwright tests use this for baseURL | |
GMAIL_USER: ${{ secrets.GMAIL_USER }} | |
OUTLOOK_USER: ${{ secrets.OUTLOOK_USER }} | |
PW_PWD: ${{ secrets.PW_PWD }} | |
environment: | |
name: oauth | |
url: https://testresults.marcusfelling.com/${{ env.TESTGROUP }} | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
ref: main | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: "18.x" | |
- name: Install dependencies | |
run: | | |
npm ci | |
- name: Run ${{ env.TESTGROUP }} Tests | |
continue-on-error: false | |
working-directory: ${{ env.TESTGROUP }} | |
run: | | |
npx playwright install | |
HOME=/root npx playwright test | |
- name: Upload HTML report as artifact. To troubleshoot failures, extract .zip and double-click index.html. | |
uses: actions/upload-artifact@v3 | |
if: always() | |
with: | |
name: ${{ env.TESTGROUP }} | |
path: | | |
playwright-report | |
performanceTests: | |
name: "performance tests" | |
timeout-minutes: 60 | |
runs-on: ubuntu-22.04 | |
container: mcr.microsoft.com/playwright:v1.35.1-focal | |
env: | |
TESTGROUP: performance | |
BASEURL: https://fastestwebsite.net/ # Playwright tests use this for baseURL | |
environment: | |
name: performance | |
url: https://testresults.marcusfelling.com/${{ env.TESTGROUP }} | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
ref: main | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: "18.x" | |
- name: Install dependencies | |
run: | | |
npm ci | |
- name: Run ${{ env.TESTGROUP }} Tests | |
continue-on-error: false | |
working-directory: ${{ env.TESTGROUP }} | |
run: | | |
npx playwright install | |
HOME=/root npx playwright test | |
- name: Upload HTML report as artifact. To troubleshoot failures, extract .zip and double-click index.html. | |
uses: actions/upload-artifact@v3 | |
if: always() | |
with: | |
name: ${{ env.TESTGROUP }} | |
path: | | |
playwright-report | |
svgomgTests: | |
name: "svgomg tests" | |
timeout-minutes: 60 | |
runs-on: ubuntu-22.04 | |
container: mcr.microsoft.com/playwright:v1.35.1-focal | |
env: | |
TESTGROUP: svgomg | |
BASEURL: https://demo.playwright.dev/svgomg # Playwright tests use this for baseURL | |
environment: | |
name: svgomg | |
url: https://testresults.marcusfelling.com/${{ env.TESTGROUP }} | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
ref: main | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: "18.x" | |
- name: Install dependencies | |
run: | | |
npm ci | |
- name: Run ${{ env.TESTGROUP }} Tests | |
continue-on-error: false | |
working-directory: ${{ env.TESTGROUP }} | |
run: | | |
npx playwright install | |
HOME=/root npx playwright test | |
- name: Upload HTML report as artifact. To troubleshoot failures, extract .zip and double-click index.html. | |
uses: actions/upload-artifact@v3 | |
if: always() | |
with: | |
name: ${{ env.TESTGROUP }} | |
path: playwright-report | |
todomvcTests: | |
name: "todomvc tests" | |
timeout-minutes: 60 | |
runs-on: ubuntu-22.04 | |
container: mcr.microsoft.com/playwright:v1.35.1-focal | |
env: | |
TESTGROUP: todomvc | |
BASEURL: https://demo.playwright.dev/todomvc # Playwright tests use this for baseURL | |
environment: | |
name: todomvc | |
url: https://testresults.marcusfelling.com/${{ env.TESTGROUP }} | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
ref: main | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: "18.x" | |
- name: Install dependencies | |
run: | | |
npm ci | |
- name: Run ${{ env.TESTGROUP }} Tests | |
continue-on-error: false | |
working-directory: ${{ env.TESTGROUP }} | |
run: | | |
npx playwright install | |
HOME=/root npx playwright test | |
- name: Upload HTML report as artifact. To troubleshoot failures, extract .zip and double-click index.html. | |
uses: actions/upload-artifact@v3 | |
if: always() | |
with: | |
name: ${{ env.TESTGROUP }} | |
path: playwright-report | |
visualComparisonTests: | |
name: "visual-comparison tests" | |
timeout-minutes: 60 | |
runs-on: ubuntu-22.04 | |
container: mcr.microsoft.com/playwright:v1.35.1-focal | |
env: | |
TESTGROUP: visual-comparison | |
BASEURL: https://playwright.dev # Playwright tests use this for baseURL | |
environment: | |
name: visual-comparison | |
url: https://testresults.marcusfelling.com/${{ env.TESTGROUP }} | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
ref: main | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: "18.x" | |
- name: Install dependencies | |
run: | | |
npm ci | |
- name: Run ${{ env.TESTGROUP }} Tests | |
continue-on-error: false | |
working-directory: ${{ env.TESTGROUP }} | |
run: | | |
npx playwright install | |
HOME=/root npx playwright test | |
- name: Upload HTML report as artifact. To troubleshoot failures, extract .zip and double-click index.html. | |
uses: actions/upload-artifact@v3 | |
if: always() | |
with: | |
name: ${{ env.TESTGROUP }} | |
path: playwright-report | |
publishTestResults: | |
name: "Publish Test Results to to testresults.marcusfelling.com" | |
needs: | |
[ | |
accessibilityTests, | |
androidTests, | |
basicTests, | |
chromeExtensionTests, | |
dragAndDropTests, | |
electronTests, | |
fixturesTests, | |
githubAPITests, | |
oauthTests, | |
performanceTests, | |
svgomgTests, | |
todomvcTests, | |
visualComparisonTests, | |
] | |
runs-on: ubuntu-22.04 | |
if: always() | |
steps: | |
- name: Download artifacts | |
uses: actions/download-artifact@v2 | |
id: download | |
- name: Publish to GH Pages | |
if: always() | |
uses: peaceiris/[email protected] | |
with: | |
external_repository: MarcusFelling/demo.reports | |
publish_branch: main | |
personal_token: ${{ secrets.PERSONAL_TOKEN }} | |
publish_dir: ${{steps.download.outputs.download-path}} | |
keep_files: true | |
user_name: "github-actions[bot]" | |
user_email: "github-actions[bot]@users.noreply.github.com" |