Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions .github/workflows/run-daily-regression.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Daily run of P0 tests

on:
schedule:
- cron: '0 8 * * 1-5'
workflow_dispatch:

jobs:
run-daily-p0-tests:
timeout-minutes: 30
runs-on: ubuntu-latest
strategy:
matrix:
project: [chromium, firefox, webkit, mobile-chrome, mobile-safari]
fail-fast: false
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Node.js and Playwright
uses: ./.github/actions/setup-playwright

- name: List tests to run
id: list-tests
run: |
TEST_LIST=$(yarn playwright test --project=${{ matrix.project }} --grep @regression --list || echo '')
echo "has_tests=$([ -n "$TEST_LIST" ] && echo 'true' || echo 'false')" >> $GITHUB_OUTPUT

- name: Run tests
if: ${{ steps.list-tests.outputs.has_tests == 'true' }}
run: yarn playwright test --project=${{ matrix.project }} --grep @regression

- name: Set date variable
if: ${{ !cancelled() }}
id: date
run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT

- name: Upload test results
if: ${{ !cancelled() }}
uses: actions/upload-artifact@v4
with:
name: regression-tests-results-${{ steps.date.outputs.date }}-${{ matrix.project }}-${{ github.run_id }}-${{ github.run_attempt }}
path: playwright-report/
retention-days: 30
21 changes: 13 additions & 8 deletions playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,27 +37,32 @@ export default defineConfig({
{
name: 'chromium',
use: { ...devices['Desktop Chrome'] },
grep: /@desktop/,
},

{
name: 'firefox',
use: { ...devices['Desktop Firefox'] },
grep: /@desktop/,
},

{
name: 'webkit',
use: { ...devices['Desktop Safari'] },
grep: /@desktop/,
},

/* Test against mobile viewports. */
// {
// name: 'Mobile Chrome',
// use: { ...devices['Pixel 5'] },
// },
// {
// name: 'Mobile Safari',
// use: { ...devices['iPhone 12'] },
// },
{
name: 'mobile-chrome',
use: { ...devices['Pixel 5'] },
grep: /@mobile/,
},
{
name: 'mobile-safari',
use: { ...devices['iPhone 12'] },
grep: /@mobile/,
},

/* Test against branded browsers. */
// {
Expand Down
4 changes: 2 additions & 2 deletions tests/example.spec.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { test, expect } from '@playwright/test';

test('has title', { tag: ['@smoke', '@p0'] }, async ({ page }) => {
test('has title', { tag: ['@smoke', '@p0', '@regression', '@desktop'] }, async ({ page }) => {
await page.goto('https://playwright.dev/');

// Expect a title "to contain" a substring.
await expect(page).toHaveTitle(/Playwright/);
});

test('get started link', { tag: ['@smoke'] }, async ({ page }) => {
test('get started link', { tag: ['@smoke', '@regression', '@mobile'] }, async ({ page }) => {
await page.goto('https://playwright.dev/');

// Click the get started link.
Expand Down
Loading