Repository navigation
test: add Playwright browser-helper tests + custom ESLint rules (18 files) - #33880
chirag-madlani merged 2 commits into
Conversation
✅ PR checks passedThe linked issue has a description and all required Shipping project fields set. Thanks! |
| while ( | ||
| callback && | ||
| !( | ||
| callback.parent?.type === 'CallExpression' && | ||
| callback.parent.callee.type === 'MemberExpression' && | ||
| callback.parent.callee.property.name === 'beforeAll' | ||
| ) | ||
| ) { | ||
| callback = callback.parent; | ||
| } |
There was a problem hiding this comment.
💡 Edge Case: reset-fixture-arrays ignores bare beforeAll(...) hooks
The hook check only matches a MemberExpression callee whose property is beforeAll, such as test.beforeAll. Files that import beforeAll directly, or use a Playwright-style fixture alias like base.beforeAll, are covered, but a bare beforeAll(() => entities.push(...)) walks up to Program and is never reported. Also accept an Identifier callee named beforeAll.
Accept both member and identifier callees.:
const isBeforeAll = (call) =>
call?.type === 'CallExpression' &&
((call.callee.type === 'MemberExpression' && call.callee.property.name === 'beforeAll') ||
(call.callee.type === 'Identifier' && call.callee.name === 'beforeAll'));
while (callback && !isBeforeAll(callback.parent)) {
callback = callback.parent;
}
Was this helpful? React with 👍 / 👎
|
|
||
| export default defineConfig({ | ||
| captureGitInfo: { commit: false, diff: false }, | ||
| testDir: './browser-tests', |
There was a problem hiding this comment.
This dedicated config is the only config that points to ./browser-tests, but no package script, Make target, or CI workflow invokes it. The standard command uses the default config, whose testDir is ./playwright/e2e, so these new tests are excluded from normal and CI runs unless someone manually selects this config. As a result, the regressions this suite is meant to catch remain unguarded.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
| const { | ||
| patchStorageSource, | ||
| } = require('../../scripts/patch-playwright-indexeddb.cjs'); |
There was a problem hiding this comment.
This code unconditionally imports ../../scripts/patch-playwright-indexeddb.cjs when the test file is collected, but that module is not present in the repository or added by this PR. Once the browser-helper lane is invoked, this spec will fail with MODULE_NOT_FOUND before any IndexedDB test can run.
Code Review 👍 Approved with suggestions 2 closed / 3 findings🟡 Medium risk · Adds standalone browser-test infrastructure and registers ESLint rules for UI tests. Adds 8 Playwright browser-helper tests, a dedicated Playwright config, and 4 custom ESLint rules with RuleTester unit tests—all verified against 💡 Edge Case: reset-fixture-arrays ignores bare
|
| Compact |
|
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source
🚦 Removed from the merge queue —
|
Fixes #33087
Describe your changes:
Rebuilt after bot review revealed cross-file dependency issues. Now 18 files, every one with symbols/imports that resolve against
main.What lands
playwright/browser-tests/— each verified against main's helpers:alertDestinationPicker,gridEditors,gridPopoverEditor,landingWidgetReadiness,queryBuilderSelections,reactions,serverLoad,taskActionsbrowser-helper-tests.config.ts— dedicated Playwright config for the browser-helper lane (retain-on-failuretrace + screenshot + json reporter).playwright/eslint-rules/(all self-contained; no wire-up needed at this layer):no-status-filtered-responseno-implicit-navigation-loadno-discarded-state-queryreset-fixture-arraysplaywright/eslint-rules/index.mjsupdated to register the 4 new rules (purely additive).Dropped from the earlier draft (with reason)
Each of the following had a cross-file dependency that doesn't exist on
mainyet. Will land in a follow-up once the dependent file is ported:canvasEdgeSelection.spec.tssrc/utils/Lineage/CanvasHitTest.utils.tslineageImageExport.spec.tssrc/utils/Export/exportStyles.utils.tsresponseWaits.spec.tswaitForResponseWithStatusnot exported fromutils/waitHelpers.tsindexedDbStorage.spec.tsscripts/patch-playwright-indexeddb.cjsformControls.spec.ts/sidebarNavigation.spec.tstw-deprecation-guardkpiCleanup.spec.tsdeleteKpiRequestsignature not on mainworkflowPolling.spec.tsverifyTaskCreatedbehavior not on mainNot included (intentional)
eslint.config.mjswire-up to actually run these rules against the Playwright corpus is NOT in this PR — needs a conflict-resolved merge against main's current file. Until then, rule files are dormant reference implementations plus their standalone RuleTester tests.Type of change:
Notes
Cherry-picked from #33088. All original content authored by @harshach.
🤖 Generated with Claude Code
The PR is not yet safe to merge because the new browser-helper suite still has no package script or CI invocation, leaving its regression coverage dormant.
Findings
Summary
Adds a dedicated Playwright browser-helper configuration, eight synthetic-browser regression tests, and four custom ESLint rules with standalone RuleTester coverage.
Reviews (2) · Last reviewed commit: "Drop browser-tests with unresolved cross..."