diff --git a/packages/matrix/scripts/test.sh b/packages/matrix/scripts/test.sh index df4e29fb9b2..e0ca78709d5 100755 --- a/packages/matrix/scripts/test.sh +++ b/packages/matrix/scripts/test.sh @@ -5,7 +5,13 @@ echo "running tests: ${1}" # this and narrows `testMatch` to the spec files bin-packed onto this shard; # Playwright's own `--shard` is not used because it balances test count rather # than test cost. See packages/matrix/support/shard-spec-files.ts. -MATRIX_TEST_SHARD="${1:-}" +# THROWAWAY VERIFICATION: every shard runs only the email screenshot tests, +# repeated, one worker, no retries. The template job has nothing to run. +if [ -n "${MATRIX_SYNAPSE_TEMPLATE:-}" ]; then + echo "verification run: skipping template job" + exit 0 +fi +MATRIX_TEST_SHARD="" export MATRIX_TEST_SHARD BASE_REALM="https-get://localhost:4201/base/" @@ -20,4 +26,4 @@ BASE_REALM_READY="$BASE_REALM$READY_PATH" WAIT_ON_TIMEOUT=600000 START_SERVER_AND_TEST_INSECURE=1 start-server-and-test \ 'pnpm run wait' \ "$BASE_REALM_READY" \ - 'pnpm playwright test' + 'pnpm playwright test tests/profile.spec.ts:90 tests/forgot-password.spec.ts:27 tests/registration-with-token.spec.ts:51 --repeat-each=5 --retries=0 --workers=1' diff --git a/packages/matrix/tests/fixtures.ts b/packages/matrix/tests/fixtures.ts index 792c2daffce..182ee64be99 100644 --- a/packages/matrix/tests/fixtures.ts +++ b/packages/matrix/tests/fixtures.ts @@ -1,7 +1,25 @@ import { test as base, expect } from '@playwright/test'; +import type { BrowserContext } from '@playwright/test'; import { setRealmRedirects } from '../helpers/index.ts'; +// THROWAWAY VERIFICATION: hold the Poppins 700 stylesheet the email templates +// load, as in the CI failure where it had no response at screenshot time. +async function stallEmailFontStylesheet(context: BrowserContext) { + await context.route( + 'https://fonts.googleapis.com/css2?family=Poppins:wght@700', + async (route) => { + console.log('stalling Poppins 700 stylesheet for 8000ms'); + await new Promise((r) => setTimeout(r, 8000)); + await route.continue(); + }, + ); +} + export const test = base.extend({ + context: async ({ context }, use) => { + await stallEmailFontStylesheet(context); + await use(context); + }, page: async ({ page }, use) => { await setRealmRedirects(page); await use(page);