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


##########
airflow-core/src/airflow/ui/tests/e2e/specs/dags-list.spec.ts:
##########
@@ -84,3 +83,179 @@ test.describe("Dag Details Tab", () => {
     await dagsPage.verifyDagDetails(testDagId);
   });
 });
+
+test.describe("Dags List Display", () => {
+  let dagsPage: DagsPage;
+
+  test.beforeEach(({ page }) => {
+    dagsPage = new DagsPage(page);
+  });
+
+  test("should display Dags list after successful login", async () => {
+    await dagsPage.navigate();
+    await dagsPage.verifyDagsListVisible();
+
+    const dagsCount = await dagsPage.getDagsCount();
+
+    expect(dagsCount).toBeGreaterThan(0);
+  });
+
+  test("should display Dag links correctly", async () => {
+    await dagsPage.navigate();
+    await dagsPage.verifyDagsListVisible();
+
+    const dagLinks = await dagsPage.getDagLinks();
+
+    expect(dagLinks.length).toBeGreaterThan(0);
+
+    for (const link of dagLinks) {
+      expect(link).toMatch(/\/dags\/.+/);
+    }
+  });
+
+  test("should display test Dag in the list", async () => {
+    const testDagId = testConfig.testDag.id;
+
+    await dagsPage.navigate();
+    await dagsPage.verifyDagsListVisible();
+
+    const dagExists = await dagsPage.verifyDagExists(testDagId);
+
+    expect(dagExists).toBe(true);
+  });
+});
+
+test.describe("Dags View Toggle", () => {
+  let dagsPage: DagsPage;
+
+  test.beforeEach(({ page }) => {
+    dagsPage = new DagsPage(page);
+  });
+
+  test("should toggle between card view and table view", async () => {
+    await dagsPage.navigate();
+    await dagsPage.verifyDagsListVisible();
+
+    await dagsPage.switchToCardView();
+
+    const cardViewVisible = await dagsPage.verifyCardViewVisible();
+
+    expect(cardViewVisible).toBe(true);
+
+    const cardViewDagsCount = await dagsPage.getDagsCount();
+
+    expect(cardViewDagsCount).toBeGreaterThan(0);
+
+    await dagsPage.switchToTableView();
+
+    const tableViewVisible = await dagsPage.verifyTableViewVisible();
+
+    expect(tableViewVisible).toBe(true);
+
+    const tableViewDagsCount = await dagsPage.getDagsCount();
+
+    expect(tableViewDagsCount).toBeGreaterThan(0);
+  });
+});
+
+test.describe("Dags Search", () => {
+  let dagsPage: DagsPage;
+
+  const testDagId = testConfig.testDag.id;
+
+  test.beforeEach(({ page }) => {
+    dagsPage = new DagsPage(page);
+  });
+
+  test("should search for a Dag by name", async () => {
+    await dagsPage.navigate();
+    await dagsPage.verifyDagsListVisible();
+
+    const initialCount = await dagsPage.getDagsCount();
+
+    expect(initialCount).toBeGreaterThan(0);
+
+    await dagsPage.searchDag(testDagId);
+
+    const dagExists = await dagsPage.verifyDagExists(testDagId);
+
+    expect(dagExists).toBe(true);
+
+    await dagsPage.clearSearch();
+
+    await dagsPage.verifyDagsListVisible();
+    const finalCount = await dagsPage.getDagsCount();
+
+    expect(finalCount).toBe(initialCount);

Review Comment:
   It seems like the count of DAGs did not revert to the original count. 
Likely, clearing the search isn't resetting the filter/UI state fully. I would 
find the solution to the problem then push an update to address the issues.



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