Skip to content

Commit 319952a

Browse files
fix(e2e): restore card scoping and catalog import assertions
Revert application-provider to per-card DOM selectors that avoid strict mode on shared article headings, and stop expecting undefined from registerExistingComponent which returns a boolean. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 305167f commit 319952a

3 files changed

Lines changed: 18 additions & 18 deletions

File tree

e2e-tests/oxlint.config.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,14 @@ export default defineConfig({
6868
],
6969
},
7070
overrides: [
71+
{
72+
// Application-provider cards are nested divs inside one article; role-based
73+
// locators alone match multiple counters/buttons (strict mode failures in CI).
74+
files: ["playwright/e2e/plugins/application-provider.spec.ts"],
75+
rules: {
76+
"playwright/no-raw-locators": "off",
77+
},
78+
},
7179
{
7280
files: ["playwright/e2e/auth-providers/**/*.spec.ts"],
7381
rules: {

e2e-tests/playwright/e2e/plugins/application-provider.spec.ts

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -30,17 +30,15 @@ test.describe("Test ApplicationProvider", () => {
3030
// Verify Context one cards are visible
3131
await uiHelper.verifyTextinCard("Context one", "Context one");
3232

33-
// Find all card containers within main article that contain "Context one"
33+
// Find card containers within main article that contain "Context one"
3434
const contextOneCards = page
35+
.getByRole("main")
3536
.getByRole("article")
37+
.locator("> div > div")
3638
.filter({ hasText: "Context one" });
3739

3840
// Click increment on the first Context one card
39-
await contextOneCards
40-
.first()
41-
.getByRole("button", { name: "+" })
42-
.first()
43-
.click();
41+
await contextOneCards.first().getByRole("button", { name: "+" }).click();
4442

4543
// Verify both Context one cards show count of 1 (shared state)
4644
await expect(
@@ -53,17 +51,15 @@ test.describe("Test ApplicationProvider", () => {
5351
// Verify Context two cards are visible
5452
await uiHelper.verifyTextinCard("Context two", "Context two");
5553

56-
// Find all card containers that contain "Context two"
54+
// Find card containers that contain "Context two"
5755
const contextTwoCards = page
56+
.getByRole("main")
5857
.getByRole("article")
58+
.locator("> div > div")
5959
.filter({ hasText: "Context two" });
6060

6161
// Click increment on the first Context two card
62-
await contextTwoCards
63-
.first()
64-
.getByRole("button", { name: "+" })
65-
.first()
66-
.click();
62+
await contextTwoCards.first().getByRole("button", { name: "+" }).click();
6763

6864
// Verify both Context two cards show count of 1 (shared state)
6965
await expect(

e2e-tests/playwright/e2e/plugins/scaffolder-backend-module-annotator/annotator.spec.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,15 +53,11 @@ test.describe.serial("Test Scaffolder Backend Module Annotator", () => {
5353
await uiHelper.openSidebar("Catalog");
5454
await uiHelper.verifyText("Name");
5555

56-
await expect(
57-
runAccessibilityTests(page, testInfo),
58-
).resolves.toBeUndefined();
56+
await runAccessibilityTests(page, testInfo);
5957

6058
await uiHelper.clickButton("Self-service");
6159
await uiHelper.clickButton("Import an existing Git repository");
62-
await expect(
63-
catalogImport.registerExistingComponent(template, false),
64-
).resolves.toBeUndefined();
60+
await catalogImport.registerExistingComponent(template, false);
6561
});
6662

6763
test("Scaffold a component using the annotator template", async () => {

0 commit comments

Comments
 (0)