Skip to content
Closed
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
53 changes: 53 additions & 0 deletions .github/workflows/e2e-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: E2E Tests

on:
push:
branches: [master]
pull_request:
branches: [master]
workflow_dispatch:

jobs:
e2e-tests:
runs-on: ubuntu-latest
timeout-minutes: 30

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "22.18.0"
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Build extension for testing
run: npm run build:test

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

- name: Run E2E tests
run: npm run test:e2e
env:
CI: true

- name: Upload test results
if: always()
uses: actions/upload-artifact@v4
with:
name: playwright-report
path: playwright-report/
retention-days: 7

- name: Upload test artifacts
if: failure()
uses: actions/upload-artifact@v4
with:
name: test-results
path: test-results/
retention-days: 7
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[![Lint and Format](https://github.com/thinktwiceco/thinktwice-plugin/actions/workflows/lint-and-format.yml/badge.svg)](https://github.com/thinktwiceco/thinktwice-plugin/actions/workflows/lint-and-format.yml)
[![E2E Tests](https://github.com/thinktwiceco/thinktwice-plugin/actions/workflows/e2e-tests.yml/badge.svg)](https://github.com/thinktwiceco/thinktwice-plugin/actions/workflows/e2e-tests.yml)

# ThinkTwice 🤔

Expand Down
6 changes: 4 additions & 2 deletions playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@ import { defineConfig, devices } from "@playwright/test"

export default defineConfig({
testDir: "./tests/e2e",
timeout: 60000, // 60 seconds per test to handle CI environments
timeout: 90000, // Increased for CI environments
fullyParallel: false,
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 2 : 0,
workers: 1, // Extensions often require a single worker for persistent context
reporter: "html",
reporter: process.env.CI ? [["html"], ["github"]] : "html",
use: {
trace: "on-first-retry",
screenshot: "only-on-failure",
video: "retain-on-failure",
viewport: { width: 1280, height: 720 }
},
projects: [
Expand Down
Loading