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
49 changes: 49 additions & 0 deletions .github/workflows/e2e-staging.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Staging E2E Tests

# Runs only on direct pushes to main (i.e. after a PR is merged).
# Not triggered on pull_request to avoid running against staging on every PR.
on:
push:
branches:
- main
paths:
- 'frontend/**'

jobs:
e2e-staging:
name: Playwright — Staging
runs-on: ubuntu-latest

defaults:
run:
working-directory: frontend

steps:
- uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: frontend/package-lock.json

- name: Install dependencies
run: npm ci

- name: Install Playwright browsers
run: npx playwright install --with-deps chromium

- name: Run staging E2E suite
run: npx playwright test --project=staging
env:
STAGING_URL: ${{ secrets.STAGING_URL }}
CI: 'true'

- name: Upload Playwright report
if: always()
uses: actions/upload-artifact@v4
with:
name: playwright-staging-report
path: frontend/playwright-report/
retention-days: 14
22 changes: 22 additions & 0 deletions frontend/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,29 +25,51 @@ export default defineConfig({
video: 'retain-on-failure',
},
projects: [
// ------------------------------------------------------------------
// Local / PR projects (default)
// ------------------------------------------------------------------
{
name: 'chromium',
use: { ...devices['Desktop Chrome'] },
testIgnore: isStaging ? '**' : undefined,
},
{
name: 'firefox',
use: { ...devices['Desktop Firefox'] },
testIgnore: isStaging ? '**' : undefined,
},
{
name: 'webkit',
use: { ...devices['Desktop Safari'] },
testIgnore: isStaging ? '**' : undefined,
},
{
name: 'mobile-chrome',
use: { ...devices['Pixel 5'] },
testIgnore: isStaging ? '**' : undefined,
},
{
name: 'mobile-safari',
use: { ...devices['iPhone 12'] },
testIgnore: isStaging ? '**' : undefined,
},
{
name: 'tablet',
use: { ...devices['iPad Pro'] },
testIgnore: isStaging ? '**' : undefined,
},

// ------------------------------------------------------------------
// Staging project — activated when STAGING_URL is set.
// Runs against a real API; no local web server is started.
// ------------------------------------------------------------------
{
name: 'staging',
use: {
...devices['Desktop Chrome'],
baseURL: process.env.STAGING_URL,
},
testIgnore: isStaging ? undefined : '**',
},
// Staging project: runs only the market-creation spec against the staging URL.
// Activated when BASE_URL points to staging (or STAGING=true).
Expand Down
Loading