Open-source event management and ticket selling platform — perfect for concerts, conferences, and everything in between 🎟️ If you find this project helpful, please consider giving us a star ⭐️
PHP attendize-alternativedoor-managementevent-check-inevent-managementevent-registrationevent-ticketingeventbrite-alternativeeventslaravelopen-sourcephpreactself-hostedsell-ticketssell-tickets-onlineticket-sellingticketing-systemtickettailor-alternativetito-alternative
Feature: e2e fixes (#1324)
Dave Earleya2a0649a2f29
diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.ymlindex 014e16950..61bf65a05 100644--- a/.github/workflows/e2e.yml+++ b/.github/workflows/e2e.yml@@ -45,6 +45,10 @@ jobs:runs-on: ubuntu-latesttimeout-minutes: 30+ permissions:+ contents: read+ pull-requests: write+strategy:fail-fast: falsematrix: ${{ fromJSON(needs.plan.outputs.matrix) }}@@ -98,6 +102,42 @@ jobs:- name: Run E2E suiterun: ./e2e/run-e2e.sh -- ${{ matrix.pw_args }}+ - name: Write job summary+ if: ${{ !cancelled() }}+ env:+ SHARD_NAME: ${{ matrix.name }}+ run: node e2e/scripts/github-summary.mjs e2e/test-results/results.json | tee e2e-summary.md >> "$GITHUB_STEP_SUMMARY"++ - name: Comment summary on PR+ if: ${{ !cancelled() && github.event_name == 'pull_request' }}+ uses: actions/github-script@v7+ env:+ SHARD_NAME: ${{ matrix.name }}+ with:+ script: |+ const fs = require('fs');+ const marker = `<!-- e2e-summary-${process.env.SHARD_NAME} -->`;+ const runUrl = `${context.serverUrl}/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}`;+ const summary = fs.existsSync('e2e-summary.md')+ ? fs.readFileSync('e2e-summary.md', 'utf8')+ : '⚠️ No summary was generated — check the "Write job summary" step logs.';+ const body = `${marker}\n${summary}\n\n[View run](${runUrl})`.slice(0, 65000);+ try {+ const comments = await github.paginate(github.rest.issues.listComments, {+ ...context.repo,+ issue_number: context.issue.number,+ per_page: 100,+ });+ const existing = comments.find((c) => c.body?.includes(marker));+ if (existing) {+ await github.rest.issues.updateComment({ ...context.repo, comment_id: existing.id, body });+ } else {+ await github.rest.issues.createComment({ ...context.repo, issue_number: context.issue.number, body });+ }+ } catch (error) {+ core.warning(`Could not post PR comment (fork PRs have a read-only token): ${error.message}`);+ }+- name: Collect stack logs on failureif: failure()run: docker compose -f "$COMPOSE_FILE" logs --no-color > e2e/compose-logs.txtdiff --git a/e2e/playwright.config.ts b/e2e/playwright.config.tsindex 996ccbe2f..05a006196 100644--- a/e2e/playwright.config.ts+++ b/e2e/playwright.config.ts@@ -15,7 +15,7 @@ export default defineConfig({timeout: 60_000,expect: { timeout: 15_000 },reporter: isCI- ? [['github'], ['html', { open: 'never' }], ['list']]+ ? [['github'], ['html', { open: 'never' }], ['json', { outputFile: 'test-results/results.json' }], ['list']]: [['html', { open: 'on-failure' }], ['list']],use: {baseURL,diff --git a/e2e/scripts/github-summary.mjs b/e2e/scripts/github-summary.mjsnew file mode 100644index 000000000..13f476fa3--- /dev/null+++ b/e2e/scripts/github-summary.mjs@@ -0,0 +1,94 @@+#!/usr/bin/env node+import { readFileSync } from 'node:fs';++const reportPath = process.argv[2] ?? 'test-results/results.json';+const shardName = process.env.SHARD_NAME ?? 'e2e';++const stripAnsi = (text) => text.replace(/\u001b\[[0-9;]*m/g, '');++const truncate = (text, max = 2000) =>+ text.length > max ? `${text.slice(0, max)}\n… (truncated)` : text;++let report;+try {+ report = JSON.parse(readFileSync(reportPath, 'utf8'));+} catch {+ console.log(`## 🎭 E2E · ${shardName}\n`);+ console.log('> ⚠️ No test report was produced — the stack likely failed to start before Playwright ran. Check the "Run E2E suite" step logs.');+ process.exit(0);+}++const failures = [];+const flaky = [];++const walk = (suite, path) => {+ for (const spec of suite.specs ?? []) {+ const title = [...path, spec.title].filter(Boolean).join(' › ');+ const statuses = (spec.tests ?? []).map((t) => t.status);+ if (statuses.includes('unexpected')) {+ const results = (spec.tests ?? []).flatMap((t) => t.results ?? []);+ const error = results.map((r) => r.error?.message).filter(Boolean).at(-1) ?? '';+ failures.push({ title, file: spec.file, line: spec.line, error: truncate(stripAnsi(error)) });+ } else if (statuses.includes('flaky')) {+ flaky.push({ title, file: spec.file });+ }+ }+ for (const child of suite.suites ?? []) {+ walk(child, [...path, child.title]);+ }+};++for (const suite of report.suites ?? []) {+ walk(suite, []);+}++const stats = report.stats ?? {};+const passed = stats.expected ?? 0;+const failed = stats.unexpected ?? 0;+const flakyCount = stats.flaky ?? 0;+const skipped = stats.skipped ?? 0;+const minutes = Math.floor((stats.duration ?? 0) / 60000);+const seconds = Math.round(((stats.duration ?? 0) % 60000) / 1000);++const globalErrors = (report.errors ?? []).map((e) => truncate(stripAnsi(e.message ?? '')));+const ranNothing = passed + failed + flakyCount + skipped === 0;+const broken = globalErrors.length > 0 || ranNothing;++const icon = failed > 0 || broken ? '❌' : flakyCount > 0 ? '⚠️' : '✅';++console.log(`## ${icon} E2E · ${shardName}\n`);+console.log('| ✅ Passed | ❌ Failed | ⚠️ Flaky | ⏭️ Skipped | ⏱️ Duration |');+console.log('|---:|---:|---:|---:|---:|');+console.log(`| ${passed} | ${failed} | ${flakyCount} | ${skipped} | ${minutes}m ${seconds}s |`);++if (ranNothing) {+ console.log('\n> ⚠️ The run ended before any test finished — check the "Run E2E suite" step logs.');+}++if (globalErrors.length > 0) {+ console.log('\n### Errors outside tests\n');+ for (const message of globalErrors) {+ console.log('```');+ console.log(message);+ console.log('```');+ }+}++if (failures.length > 0) {+ console.log('\n### Failures\n');+ for (const failure of failures) {+ console.log(`<details><summary>❌ <code>${failure.file}:${failure.line}</code> — ${failure.title}</summary>\n`);+ console.log('```');+ console.log(failure.error || 'No error message captured.');+ console.log('```');+ console.log('</details>\n');+ }+ console.log('> Full traces, videos and screenshots are in the `playwright-report` artifact below.');+}++if (flaky.length > 0) {+ console.log('\n### Flaky (passed on retry)\n');+ for (const test of flaky) {+ console.log(`- ⚠️ \`${test.file}\` — ${test.title}`);+ }+}diff --git a/frontend/src/components/forms/ProductForm/ProductPreview.tsx b/frontend/src/components/forms/ProductForm/ProductPreview.tsxindex 2dbff7d76..a4b7c6d46 100644--- a/frontend/src/components/forms/ProductForm/ProductPreview.tsx+++ b/frontend/src/components/forms/ProductForm/ProductPreview.tsx@@ -8,6 +8,7 @@ import {Event, Product} from "../../../types.ts";import {useGetEventSettings} from "../../../queries/useGetEventSettings.ts";import {useGetTaxesAndFees} from "../../../queries/useGetTaxesAndFees.ts";import {nowInTimezone} from "../../../utilites/dates.ts";+import {computeThemeVariables, validateThemeSettings} from "../../../utilites/themeUtils.ts";import {buildPreviewEvent} from "./buildPreviewEvent.ts";import {computeVisibilityStatus} from "./visibilityStatus.ts";import SelectProducts from "../../routes/product-widget/SelectProducts";@@ -61,6 +62,12 @@ export const ProductPreview = ({form, event}: ProductPreviewProps) => {);}, [event, debouncedValues, taxesAndFees, eventSettings]);+ const themeSettings = useMemo(+ () => validateThemeSettings((eventSettings ?? event?.settings)?.homepage_theme_settings),+ [eventSettings, event],+ );+ const themeVariables = useMemo(() => computeThemeVariables(themeSettings), [themeSettings]);+if (!event || !previewEvent) {return null;}@@ -82,7 +89,10 @@ export const ProductPreview = ({form, event}: ProductPreviewProps) => {showPoweredBy={false}colors={{background: '#ffffff',+ primary: themeSettings.accent,primaryText: '#1a1a1a',+ secondary: themeSettings.accent,+ secondaryText: themeVariables['--theme-accent-contrast'],}}/></div>