Skip to content

Update to 1.38.0, accessibility, and visual comparison tests (#40) #270

Update to 1.38.0, accessibility, and visual comparison tests (#40)

Update to 1.38.0, accessibility, and visual comparison tests (#40) #270

Workflow file for this run

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:
image: mcr.microsoft.com/playwright:v1.38.0-jammy
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
cache: npm
cache-dependency-path: package-lock.json
- 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: 18
cache: npm
cache-dependency-path: package-lock.json
- 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:
image: mcr.microsoft.com/playwright:v1.38.0-jammy
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
cache: npm
cache-dependency-path: package-lock.json
- 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
cache: npm
cache-dependency-path: package-lock.json
- name: Install dependencies
run: npm ci
- name: Run ${{ env.TESTGROUP }} Tests
continue-on-error: false
working-directory: ${{ env.TESTGROUP }}
run: |
npx playwright install
# 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:
image: mcr.microsoft.com/playwright:v1.38.0-jammy
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
cache: npm
cache-dependency-path: package-lock.json
- 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
fixturesTests:
name: "fixtures tests"
timeout-minutes: 60
runs-on: ubuntu-22.04
container:
image: mcr.microsoft.com/playwright:v1.38.0-jammy
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
cache: npm
cache-dependency-path: package-lock.json
- 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 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:
image: mcr.microsoft.com/playwright:v1.38.0-jammy
env:
TESTGROUP: github-api
BASEURL: https://api.github.com # Playwright tests use this for baseURL
GITHUB_USER: ${{ secrets.REPO_USER }}
API_TOKEN: ${{ secrets.API_TOKEN }}
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
cache: npm
cache-dependency-path: package-lock.json
- 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
oauthTests:
name: "oauth tests"
timeout-minutes: 60
if: ${{ false }} # disable for now for bot detection
runs-on: ubuntu-22.04
container:
image: mcr.microsoft.com/playwright:v1.38.0-jammy
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
cache: npm
cache-dependency-path: package-lock.json
- 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:
image: mcr.microsoft.com/playwright:v1.38.0-jammy
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
cache: npm
cache-dependency-path: package-lock.json
- 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:
image: mcr.microsoft.com/playwright:v1.38.0-jammy
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
cache: npm
cache-dependency-path: package-lock.json
- 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:
image: mcr.microsoft.com/playwright:v1.38.0-jammy
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
cache: npm
cache-dependency-path: package-lock.json
- 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:
image: mcr.microsoft.com/playwright:v1.38.0-jammy
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
cache: npm
cache-dependency-path: package-lock.json
- 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 --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
publishTestResults:
name: "Publish Test Results to to testresults.marcusfelling.com"
needs:
[
accessibilityTests,
androidTests,
basicTests,
chromeExtensionTests,
dragAndDropTests,
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"