-
Notifications
You must be signed in to change notification settings - Fork 77
E2e reliability and performance #2201
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
samuelreichert
wants to merge
33
commits into
main
Choose a base branch
from
e2e-reliability-and-performance
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
33 commits
Select commit
Hold shift + click to select a range
7d8108c
feat(run-e2e): add shared fixtures and Mendix helpers for E2E tests
samuelreichert 3f9bb50
feat(run-e2e): harden playwright config with timeouts and screenshot …
samuelreichert 42ed57f
fix(turbo): update e2e task inputs from stale cypress refs to playwright
samuelreichert 8b663d9
feat(run-e2e): add playwright ESLint rules to prevent new flakiness
samuelreichert d79b684
feat(run-e2e): add codemod script to migrate specs to shared fixtures
samuelreichert fb8fc60
fix(e2e): replace all waitForTimeout with event-based waits
samuelreichert ec8f69c
refactor(e2e): migrate all specs to shared fixtures and helpers
samuelreichert 706e040
fix(e2e): remove per-test screenshot threshold and maxDiffPixels over…
samuelreichert d5fdd66
perf(e2e): parallelize nightly workflow with 4 matrix runners
samuelreichert 0c810db
feat(run-e2e): add smoke suite support via E2E_SUITE env var and @smo…
samuelreichert 82f5606
feat(run-e2e): add shared checkAccessibility helper
samuelreichert a28336f
fix(run-e2e): add exports field for fixtures and mendix-helpers
samuelreichert 2577145
fix(run-e2e): waitForMendixApp must wait for page render and network …
samuelreichert aa07714
fix(e2e): migrate remaining specs that codemod missed (expect,test or…
samuelreichert ba12f38
fix(run-e2e): worker-scoped session and waitForFunction timeout fix
samuelreichert df95fb4
fix(datagrid-web): eliminate race conditions in filter e2e tests
samuelreichert 3d6e304
fix(e2e): remove flaky patterns from video-player and checkbox-radio …
samuelreichert cc5c003
fix(run-e2e): remove networkidle from waitForMendixApp, add opt-in wa…
samuelreichert 2c55f27
chore(run-e2e): remove migrate-spec.mjs one-time migration script
samuelreichert cf624f0
fix(badge-button-web): remove racy nth(1) assertion in close page test
samuelreichert 50c48cb
fix(run-e2e): reduce local workers from 4 to 2
samuelreichert 8347948
docs(e2e): add Playwright test guidelines and update AGENTS.md
samuelreichert 8ea7158
test(e2e): update chromium-linux snapshots
samuelreichert b4b84ad
test(gallery-web): ensure text filter input has focus before screenshot
samuelreichert 6fde62a
test(line-chart-web): wait for Plotly render before screenshot to fix…
samuelreichert efdbf4f
test(e2e): update snapshots for badge button, slider, and tooltip com…
samuelreichert 870c15d
test(e2e): update SkipLink tests for focus context and visibility checks
samuelreichert 39de1a0
test(e2e): update DataGridDropDownFilter tests to target correct elem…
samuelreichert 8e6181f
test(e2e): enhance heatmap chart tests to verify additional elements …
samuelreichert c611e6d
test(e2e): fix skiplink visibility checks using getBoundingClientRect
samuelreichert 097dad6
test(e2e): use toBeInViewport and drop stale count assertion
samuelreichert 46cbdc3
test(e2e): enhance external video poster rendering checks and add scr…
samuelreichert b94cd28
test(e2e): fix race condition and locator iteration in number filter …
samuelreichert File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| /* eslint-disable no-undef */ | ||
| import { test as base, expect } from "@playwright/test"; | ||
|
|
||
| async function waitForMendixApp(page, timeout = 60_000) { | ||
| await page.waitForLoadState("domcontentloaded"); | ||
| await page.waitForFunction( | ||
| () => | ||
| Boolean(window.mx?.session) && | ||
| !document.querySelector(".mx-progress-indicator") && | ||
| document.querySelector(".mx-page") !== null, | ||
| undefined, | ||
| { timeout } | ||
| ); | ||
| } | ||
|
|
||
| export { expect }; | ||
|
|
||
| export const test = base.extend({ | ||
| mendixSession: [ | ||
| async ({ browser }, use) => { | ||
| const context = await browser.newContext(); | ||
| const page = await context.newPage(); | ||
| const originalGoto = page.goto.bind(page); | ||
| page.goto = async (url, options) => { | ||
| const response = await originalGoto(url, options); | ||
| await waitForMendixApp(page); | ||
| return response; | ||
| }; | ||
| await use({ context, page }); | ||
| await page.evaluate(() => window.mx?.session?.logout?.()).catch(() => {}); | ||
| await context.close(); | ||
| }, | ||
| { scope: "worker" } | ||
| ], | ||
| page: async ({ mendixSession }, use) => { | ||
| await use(mendixSession.page); | ||
| } | ||
| }); |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| /* eslint-disable no-undef */ | ||
| import { expect } from "@playwright/test"; | ||
|
|
||
| export async function waitForMendixApp(page, timeout = 60_000) { | ||
| await page.waitForLoadState("domcontentloaded"); | ||
| await page.waitForFunction( | ||
| () => | ||
| Boolean(window.mx?.session) && | ||
| !document.querySelector(".mx-progress-indicator") && | ||
| document.querySelector(".mx-page") !== null, | ||
| undefined, | ||
| { timeout } | ||
| ); | ||
| } | ||
|
|
||
| export async function waitForDataReady(page, timeout = 60_000) { | ||
| await waitForMendixApp(page, timeout); | ||
| await page.waitForLoadState("networkidle"); | ||
| } | ||
|
|
||
| export async function waitForWidget(page, mxName, timeout = 15_000) { | ||
| const locator = page.locator(`.mx-name-${mxName}`); | ||
| await expect(locator).toBeVisible({ timeout }); | ||
| return locator; | ||
| } | ||
|
|
||
| export async function waitForListData(page, mxName, minRows = 1, timeout = 15_000) { | ||
| const container = page.locator(`.mx-name-${mxName}`); | ||
| await expect(container).toBeVisible({ timeout }); | ||
| const rows = container.locator("[class*='item'], tr[class*='row'], [class*='gallery-item']"); | ||
| await expect(rows).toHaveCount(minRows, { timeout }); | ||
| return rows; | ||
| } | ||
|
|
||
| export async function safeLogout(page) { | ||
| await page.evaluate(() => window.mx?.session?.logout?.()).catch(() => {}); | ||
| } | ||
|
|
||
| export async function navigateToPage(page, path, timeout = 30_000) { | ||
| await page.goto(path); | ||
| await waitForMendixApp(page, timeout); | ||
| } | ||
|
|
||
| export async function checkAccessibility(page, selector, options = {}) { | ||
| const AxeBuilder = (await import("@axe-core/playwright")).default; | ||
| let builder = new AxeBuilder({ page }).withTags(options.tags || ["wcag21aa"]); | ||
| if (selector) { | ||
| builder = builder.include(selector); | ||
| } | ||
| if (options.exclude) { | ||
| for (const sel of [].concat(options.exclude)) { | ||
| builder = builder.exclude(sel); | ||
| } | ||
| } | ||
| const results = await builder.analyze(); | ||
| expect(results.violations).toEqual([]); | ||
| } |
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This feels like duplication, should we just point it out to the document
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed!