From c4d18f4145835db2843965f86d231cb662210efa Mon Sep 17 00:00:00 2001 From: Daria Domina Date: Sat, 15 Nov 2025 12:54:59 +0100 Subject: [PATCH 1/4] uncomment mobile projects --- playwright.config.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/playwright.config.ts b/playwright.config.ts index cd599c8..25728c9 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -50,14 +50,14 @@ export default defineConfig({ }, /* 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'] }, + }, + { + name: 'mobile-safari', + use: { ...devices['iPhone 12'] }, + }, /* Test against branded browsers. */ // { From fdec00529641ff5dfbdc06025c5636c253037a3a Mon Sep 17 00:00:00 2001 From: Daria Domina Date: Sat, 15 Nov 2025 13:00:46 +0100 Subject: [PATCH 2/4] add tags for projects --- playwright.config.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/playwright.config.ts b/playwright.config.ts index 25728c9..29dbc5d 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -37,26 +37,31 @@ 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'] }, + grep: /@mobile/, }, { name: 'mobile-safari', use: { ...devices['iPhone 12'] }, + grep: /@mobile/, }, /* Test against branded browsers. */ From 46e2fc8dbca8a9bd117398f6c3a72f2886230ea9 Mon Sep 17 00:00:00 2001 From: Daria Domina Date: Sat, 15 Nov 2025 13:34:02 +0100 Subject: [PATCH 3/4] assign tags to tests --- tests/example.spec.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/example.spec.ts b/tests/example.spec.ts index f0b0196..fefb4c9 100644 --- a/tests/example.spec.ts +++ b/tests/example.spec.ts @@ -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. From ab4258c31d92782fb0eb5090d6364e43e57f668f Mon Sep 17 00:00:00 2001 From: Daria Domina Date: Sat, 15 Nov 2025 13:36:26 +0100 Subject: [PATCH 4/4] add a daily regression run --- .github/workflows/run-daily-regression.yaml | 44 +++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 .github/workflows/run-daily-regression.yaml diff --git a/.github/workflows/run-daily-regression.yaml b/.github/workflows/run-daily-regression.yaml new file mode 100644 index 0000000..3c56cdf --- /dev/null +++ b/.github/workflows/run-daily-regression.yaml @@ -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 \ No newline at end of file