haseebmalik18 commented on code in PR #63559:
URL: https://github.com/apache/airflow/pull/63559#discussion_r2944223036


##########
airflow-core/src/airflow/ui/tests/e2e/pages/DagsPage.ts:
##########
@@ -52,26 +52,30 @@ export class DagsPage extends BasePage {
 
   public constructor(page: Page) {
     super(page);
-    this.triggerButton = page.locator('button[aria-label="Trigger 
Dag"]:has-text("Trigger")');
-    // Use .last() instead of .nth(1) — when the modal opens, the confirm 
button
-    // is the last "Trigger" button in the DOM regardless of whether the main
-    // page trigger button has visible text or is icon-only.
-    this.confirmButton = page.locator('button:has-text("Trigger")').last();
-    this.stateElement = page.locator('*:has-text("State") + *').first();
+    this.triggerButton = page.getByTestId("trigger-dag-button");
+    // Scoped to the dialog so we never accidentally click the page-level 
trigger.
+    this.confirmButton = page.getByRole("dialog").getByRole("button", { name: 
"Trigger" });
+    // Targets the value cell next to the "State" label on the run details 
page.
+    this.stateElement = page
+      .locator("tr")
+      .filter({ has: page.locator("td").filter({ hasText: /^State$/ }) })
+      .locator("td")
+      .nth(1);

Review Comment:
   Locator seems fragile, consider maybe adding a datatest-id to the component?



-- 
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]

Reply via email to