choo121600 commented on code in PR #59374:
URL: https://github.com/apache/airflow/pull/59374#discussion_r2640461243


##########
airflow-core/src/airflow/ui/tests/e2e/pages/DagsPage.ts:
##########
@@ -75,16 +122,133 @@ export class DagsPage extends BasePage {
     await this.waitForPageLoad();
   }
 
+  /**
+   * Click sort select (only works in card view)
+   */
+  public async clickSortSelect(): Promise<void> {
+    await this.sortSelect.click();
+  }
+
+  /**
+   * Filter Dags by status
+   */
+  public async filterByStatus(
+    status: "failed" | "needs_review" | "queued" | "running" | "success",
+  ): Promise<void> {
+    const filterMap = {
+      failed: this.failedFilter,
+      needs_review: this.needsReviewFilter,
+      queued: this.queuedFilter,
+      running: this.runningFilter,
+      success: this.successFilter,
+    };
+
+    await filterMap[status].click();
+    await this.waitForPageLoad();
+  }
+
+  /**
+   * Get all Dag links from the list
+   */
+  public async getDagLinks(): Promise<Array<string>> {
+    // Select all links that point to specific DAGs (href starts with /dags/)
+    const links = await this.page.locator('a[href^="/dags/"]').all();
+    const hrefs: Array<string> = [];
+
+    for (const link of links) {
+      const href = await link.getAttribute("href");
+
+      // Only include links that match /dags/{dag_id} pattern (not /dags or 
/dags/{id}/runs/...)
+      if (href !== null && href !== "" && /^\/dags\/[^/]+$/.exec(href) !== 
null) {
+        hrefs.push(href);
+      }
+    }
+
+    return hrefs;
+  }
+
   /**
    * Get all Dag names from the current page
    */
   public async getDagNames(): Promise<Array<string>> {
-    const dagLinks = this.page.locator('[data-testid="dag-id"]');
+    // Select all DAG links using href pattern
+    const dagLinks = this.page.locator('a[href^="/dags/"]');
+
+    // Wait for page to load - check for either DAG links or "No Dag found" 
message

Review Comment:
   Please change the parts labeled “DAG” to “Dag.”
   We’ve agreed to use “Dag” instead of “DAG” going forward :)
   Also, please update any other occurrences to use “Dag” as well.



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