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
10 changes: 8 additions & 2 deletions packages/matrix/scripts/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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/"
Expand All @@ -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'
18 changes: 18 additions & 0 deletions packages/matrix/tests/fixtures.ts
Original file line number Diff line number Diff line change
@@ -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);
Expand Down
Loading