justinpark commented on code in PR #43487:
URL: https://github.com/apache/superset/pull/43487#discussion_r3920576184


##########
superset-frontend/playwright/pages/DashboardV2Page.ts:
##########
@@ -115,15 +114,21 @@ export class DashboardV2Page {
   }
 
   /**
-   * Switches back to the "Building blocks" palette tab. Placing (or
-   * selecting) a block switches the editor panel to Properties, so a test
-   * that places one block via `placeBlockByClick` and then wants to drag a
-   * second one from the palette needs this in between.
+   * Switches back to the "Widgets" palette tab. Placing (or selecting) a
+   * block switches the editor panel to Properties, so a test that places
+   * one block via `placeBlockByClick` and then wants to drag a second one
+   * from the palette needs this in between.
+   *
+   * A plain `text=Widgets` locator is unsafe here: on a branch (or any
+   * other page state) where the word "Widgets" happens to appear
+   * elsewhere too — e.g. a dev-mode badge showing the current git branch
+   * name — it resolves to more than one element and Playwright refuses to
+   * click ambiguously. Scoping to the actual `tab` role, which only the
+   * real palette tab has, avoids that regardless of what else is on the
+   * page.
    */
   async showPalette(): Promise<void> {
-    await this.page
-      .locator(DashboardV2Page.SELECTORS.BUILDING_BLOCKS_TAB)
-      .click();
+    await this.page.getByRole('tab', { name: 'Widgets', exact: true }).click();

Review Comment:
   Good catch — fixed in 0e2155e6d4: scoped the locator to 
[data-test="editor-panel"] (the rail the palette's own Tabs live in) before 
calling getByRole('tab', { name: 'Widgets', exact: true })



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to