Playwright tests #35
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: Playwright tests | |
on: | |
pull_request: | |
branches: [ staging, main, master ] | |
types: | |
- opened | |
- synchronize | |
paths: | |
- '.github/workflows/playwright.yml' | |
- 'src/**' | |
- 'tests/playwright/**' | |
- 'package.json' | |
schedule: | |
- cron: '0 6 1,11,21 * *' | |
workflow_dispatch: | |
jobs: | |
test: | |
timeout-minutes: 15 | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: lts/* | |
- name: Publish extension to dist folder | |
run: | | |
npm ci | |
npm i grunt -g | |
grunt playwright | |
- name: Install test dependencies | |
run: npm ci | |
working-directory: tests/playwright | |
- name: Install playwright browser (chromium) | |
run: npx playwright install --with-deps chromium | |
working-directory: tests/playwright | |
- name: Run playwright tests | |
run: npx playwright test | |
working-directory: tests/playwright | |
- uses: actions/upload-artifact@v4 | |
if: always() | |
with: | |
name: playwright-report | |
path: tests/playwright/playwright-report/ | |
retention-days: 30 | |
create-issue-if-tests-fail: | |
needs: test | |
runs-on: ubuntu-latest | |
if: always() && needs.test.result == 'failure' | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Create issue | |
uses: dacbd/create-issue-action@main | |
with: | |
token: ${{ github.token }} | |
title: | | |
Playwright tests failed | |
assignees: ${{ github.repository_owner }} | |
labels: bug, failed-tests | |
body: | | |
## Failure Report: | |
> [!IMPORTANT] | |
> Details on failed run: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} | |
- Author: trossr32 | |
- Branch: `${{ github.ref }}` | |
- Commit: ${{ github.sha }} | |
- Workflow Path: `${{ github.workflow_ref }}` | |
- [ ] **Task**: Review failed tests and fix the issue(s). |