Skip to content

Commit 1dfb09c

Browse files
sadpandajoeclaude
andcommitted
fix(playwright): fix EditDatasetModal Tabs compatibility + getTab docs
EditDatasetModal passed getByRole('tablist') to Tabs, but the nav getter expects the .ant-tabs wrapper — clicking tabs would silently fail. Changed to pass .ant-tabs locator scoped to the dialog. Also documented getTab substring matching behavior and strict mode safety net for ambiguous names. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 09b13ba commit 1dfb09c

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

superset-frontend/playwright/components/core/Tabs.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,10 @@ export class Tabs {
6969

7070
/**
7171
* Gets a tab button by name, scoped to this component's nav bar.
72+
* Uses substring matching (hasText) because tab button text includes
73+
* icon text (e.g. "Untitled Query 1 circle-solid"). Pass specific
74+
* enough text to avoid ambiguity — Playwright strict mode will catch
75+
* collisions (e.g. "Query 1" matching "Query 10").
7276
* @param tabName - The name/label of the tab
7377
*/
7478
getTab(tabName: string): Locator {

superset-frontend/playwright/components/modals/EditDatasetModal.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,11 @@ export class EditDatasetModal extends Modal {
4040
// Use getByRole with specific name to target Edit Dataset dialog
4141
// The dialog has aria-labelledby that resolves to "edit Edit Dataset"
4242
this.specificLocator = page.getByRole('dialog', { name: /edit.*dataset/i });
43-
// Scope tabs to modal's tablist to avoid matching tablists elsewhere on page
44-
this.tabs = new Tabs(page, this.specificLocator.getByRole('tablist'));
43+
// Scope tabs to modal dialog so nav getter finds .ant-tabs-nav as descendant
44+
this.tabs = new Tabs(
45+
page,
46+
this.specificLocator.locator('.ant-tabs').first(),
47+
);
4548
}
4649

4750
/**

0 commit comments

Comments
 (0)