Skip to content

Commit b39f5a2

Browse files
frano-mclaude
andcommitted
fix: update e2e card locator to use MuiPaper ancestor and CardActionArea (#4741)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 7b1e253 commit b39f5a2

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

e2e/anvil/anvil-dataset.spec.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,8 @@ describe("Dataset", () => {
176176
*/
177177
async function clickCard(page: Page, headingText: string): Promise<void> {
178178
await getHeadingWithText(page, headingText)
179-
.locator("xpath=ancestor::a")
179+
.locator("xpath=ancestor::*[contains(@class,'MuiPaper-root')]")
180+
.locator(".MuiCardActionArea-root")
180181
.click();
181182
}
182183

e2e/testFunctions.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1199,7 +1199,9 @@ export async function testPaginationContent(
11991199
* @returns - Playwright locator object for the card with the given heading text.
12001200
*/
12011201
function getCard(page: Page, headingText: string): Locator {
1202-
return getHeadingWithText(page, headingText).locator("xpath=ancestor::a");
1202+
return getHeadingWithText(page, headingText)
1203+
.locator("xpath=ancestor::*[contains(@class,'MuiPaper-root')]")
1204+
.locator(".MuiCardActionArea-root");
12031205
}
12041206

12051207
/**

0 commit comments

Comments
 (0)