feat: add Playwright E2E test suite#435
Draft
victorfrye wants to merge 5 commits into
Draft
Conversation
- Add tests/ project with package.json, playwright.config.ts, tsconfig.json - Cover app load, graveyard corpse count (175), shell footer/FABs, cookie consent flows, and analytics tags - Three browser projects: Edge, Chrome, Safari - Dynamic corpse count via fs.readFileSync from corpses.json Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Threads migrated their canonical domain from threads.net to threads.com. Updated the link in socials.tsx and the corresponding test assertion. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Add data-testid='headstone' to Card in headstone.tsx for reliable count
- Add data-testid='scroll-fab' to ScrollFab button
- Add data-testid='cookie-fab' to CookieFab button
- Fix graveyard spec: use [data-testid=headstone] selector (Card renders as
role=group not article); remove brittle networkidle wait
- Fix consent spec: replace addInitScript in beforeEach with test.use
storageState for reliable cross-browser storage isolation; use exact button
text ('Accept all', 'Reject unnecessary'); increase dialog timeout to 10s
- Fix shell spec: use [data-testid=scroll-fab] instead of computed style check
- Fix playwright.config.ts: drop channel requirements for Edge/Chrome,
set workers=4, increase timeout to 60s
- Update AGENTS.md: document Playwright setup and correct Card DOM rendering
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
| let gtmRequestFired = false; | ||
|
|
||
| page.on('request', (request) => { | ||
| if (request.url().includes('googletagmanager.com')) { |
| let clarityRequestFired = false; | ||
|
|
||
| page.on('request', (request) => { | ||
| if (request.url().includes('clarity.ms') || request.url().includes('c.bing.com')) { |
|
Azure Static Web Apps: Your stage site is ready! Visit it here: https://zealous-plant-083d54e10-435.centralus.5.azurestaticapps.net |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a comprehensive Playwright TypeScript E2E test suite covering all nine functional scenarios for microsoftgraveyard.com, fixes the Threads URL bug, and wires E2E tests into CI.
Changes
New:
tests/— Playwright E2E project at repo rootplaywright.config.ts— Edge, Chrome, Safari; configurablePLAYWRIGHT_BASE_URL; 4 workers; 60s timeout; retries in CIe2e/app.spec.ts— App loads, title, main element visiblee2e/graveyard.spec.ts— All 175 corpse cards rendered (readscorpses.jsondynamically)e2e/shell.spec.ts— Footer, byline, copyright year, GitHub/Threads links, scroll FABe2e/consent.spec.ts— Cookie dialog, accept/reject localStorage values, cookie FAB opens managere2e/analytics.spec.ts— GA4 script tags + network requests, Clarity initialization + network requestsFix: Threads social URL (
threads.net→threads.com)src/WebClient/app/shell/socials.tsx— corrected URLsrc/WebClient/app/shell/socials.test.tsx— updated assertionSource:
data-testidattributes for reliable E2E selectionheadstone.tsx—data-testid="headstone"on Cardscroll-fab.tsx—data-testid="scroll-fab"on scroll FAB buttonprivacy/cookies/fab.tsx—data-testid="cookie-fab"on cookie FAB buttonCI:
.github/workflows/azure-swa.ymloutputstobuild_and_deployexposingstatic_web_app_urle2e_testsjob running after deploy using the SWA URL asPLAYWRIGHT_BASE_URLplaywright-report/artifact on failureDocs:
AGENTS.mdrole="group", not<article>)Test Results
60/60 tests passing locally across Edge, Chrome, and Safari (37.8s)
Notes
test.use({ storageState })for reliable cross-browser storage isolationrole="group"in the DOM, not<article>