Skip to content

Commit 91b26fc

Browse files
committed
Add Playwright e2e suite for backend module, List module and ext:form
Adds an end-to-end test suite (modeled on hauptsacheNet/typo3-mcp-server) that drives a real TYPO3 backend with Playwright and verifies the three user-facing surfaces across TYPO3 12.4, 13.4 and 14.3: - ext:form integration: the validated sender-address dropdown is injected into the form editor and the form can be saved - the validation backend module lists sender addresses and revalidates them - the List module lists and creates Mail Sender Address records Build/runTests.sh sets up an SQLite-backed TYPO3 instance (seeded sender address and form definition), serves it via the PHP built-in web server and runs the Playwright specs in Build/tests/playwright/. It can pin a TYPO3 version with -t and falls back to a host runner when Docker is unavailable. The Tests workflow runs the e2e suite across all three supported versions. https://claude.ai/code/session_01DaMNs9bAk3ofegnToxwF7X
1 parent f5f7302 commit 91b26fc

19 files changed

Lines changed: 850 additions & 0 deletions

.github/workflows/tests.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,50 @@ jobs:
4646

4747
- name: Run functional test suite
4848
run: composer test
49+
50+
e2e-tests:
51+
runs-on: ubuntu-latest
52+
53+
strategy:
54+
fail-fast: false
55+
matrix:
56+
typo3-version: ['12.4', '13.4', '14.3']
57+
58+
name: E2E TYPO3 ${{ matrix.typo3-version }}
59+
60+
steps:
61+
- name: Check out repository
62+
uses: actions/checkout@v4
63+
64+
- name: Set up PHP
65+
uses: shivammathur/setup-php@v2
66+
with:
67+
php-version: '8.3'
68+
extensions: sqlite3, pdo_sqlite, intl
69+
coverage: none
70+
71+
- name: Set up Node.js
72+
uses: actions/setup-node@v4
73+
with:
74+
node-version: '22'
75+
cache: 'npm'
76+
cache-dependency-path: Build/package-lock.json
77+
78+
- name: Install Playwright (npm + browser with system deps)
79+
working-directory: Build
80+
run: |
81+
npm ci
82+
npx playwright install --with-deps chromium
83+
84+
- name: Run E2E test suite
85+
run: bash Build/runTests.sh -s e2e -t ${{ matrix.typo3-version }} --no-docker
86+
87+
- name: Upload Playwright report
88+
if: failure()
89+
uses: actions/upload-artifact@v4
90+
with:
91+
name: playwright-report-typo3-${{ matrix.typo3-version }}
92+
path: |
93+
Build/playwright-report
94+
Build/test-results
95+
retention-days: 7

Build/.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Playwright / Node artifacts
2+
/node_modules
3+
/playwright-report
4+
/test-results

Build/.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
22

Build/package-lock.json

Lines changed: 78 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Build/package.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"private": true,
3+
"engines": {
4+
"node": ">=22.18.0 <23.0.0"
5+
},
6+
"devDependencies": {
7+
"@playwright/test": "1.52.0"
8+
},
9+
"scripts": {
10+
"playwright:install": "playwright install",
11+
"playwright:run": "playwright test",
12+
"playwright:open": "playwright test --ui",
13+
"playwright:report": "playwright show-report"
14+
}
15+
}

Build/playwright.config.ts

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
import { defineConfig } from '@playwright/test';
2+
import config from './tests/playwright/config';
3+
4+
export default defineConfig({
5+
testDir: './tests/playwright',
6+
timeout: 60000,
7+
expect: { timeout: 15000 },
8+
fullyParallel: false,
9+
forbidOnly: !!process.env.CI,
10+
retries: process.env.CI ? 2 : 0,
11+
workers: 1,
12+
reporter: [['list'], ['html', { outputFolder: './playwright-report', open: 'never' }]],
13+
outputDir: './test-results',
14+
15+
use: {
16+
baseURL: config.baseUrl,
17+
ignoreHTTPSErrors: true,
18+
viewport: { width: 1600, height: 1200 },
19+
trace: 'on-first-retry',
20+
screenshot: 'only-on-failure',
21+
video: 'retain-on-failure',
22+
},
23+
24+
projects: [
25+
{
26+
name: 'login setup',
27+
testMatch: /helper\/login\.setup\.ts/,
28+
},
29+
{
30+
name: 'e2e',
31+
testMatch: /e2e\/.*\.spec\.ts/,
32+
dependencies: ['login setup'],
33+
use: {
34+
storageState: './tests/playwright/.auth/login.json',
35+
},
36+
},
37+
],
38+
});

0 commit comments

Comments
 (0)