vatsrahul1001 commented on code in PR #60122:
URL: https://github.com/apache/airflow/pull/60122#discussion_r2727328399


##########
airflow-core/src/airflow/ui/tests/e2e/pages/EventsPage.ts:
##########
@@ -152,6 +224,78 @@ export class EventsPage extends BasePage {
     await this.waitForTableLoad();
   }
 
+  public async navigateToPaginatedEventsPage(limit: number = 5): Promise<void> 
{
+    await this.page.goto(`/events?offset=0&limit=${limit}`, {
+      timeout: 30_000,
+      waitUntil: "domcontentloaded",
+    });
+    await this.waitForTableLoad();
+  }
+
+  public async setFilterValue(filterLabel: string, value: string): 
Promise<void> {
+    const filterPill = this.getFilterPill(filterLabel);
+
+    if ((await filterPill.count()) > 0) {
+      await filterPill.click();
+    }
+
+    // Wait for input to appear and fill it
+    const filterInput = this.page.locator(`input[placeholder*="${filterLabel}" 
i], input`).last();
+
+    await filterInput.waitFor({ state: "visible", timeout: 5000 });
+    await filterInput.fill(value);
+    await filterInput.press("Enter");
+    await this.waitForTableLoad();
+  }
+
+  public async verifyLogEntriesWithData(): Promise<void> {
+    const rows = await this.getEventLogRows();
+
+    if (rows.length === 0) {
+      throw new Error("No log entries found");
+    }
+
+    const [firstRow] = rows;
+
+    if (!firstRow) {
+      throw new Error("First row is undefined");
+    }
+
+    const whenCell = await this.getCellByColumnName(firstRow, "When");
+    const eventCell = await this.getCellByColumnName(firstRow, "Event");
+    const userCell = await this.getCellByColumnName(firstRow, "User");
+
+    const whenText = await whenCell.textContent();
+    const eventText = await eventCell.textContent();
+    const userText = await userCell.textContent();
+
+    if (

Review Comment:
   We can use this 
   expect(whenText?.trim()).toBeTruthy();



##########
airflow-core/src/airflow/ui/tests/e2e/pages/EventsPage.ts:
##########
@@ -48,6 +55,29 @@ export class EventsPage extends BasePage {
     return `/dags/${dagId}/events`;
   }
 
+  public async addFilter(filterName: string): Promise<void> {
+    const filterButton = this.page.locator('button:has-text("Filter")');
+
+    await filterButton.click();
+
+    const filterMenu = this.page.locator('[role="menu"][data-state="open"]');
+
+    await filterMenu.waitFor({ state: "visible", timeout: 5000 });
+
+    const menuItem = 
filterMenu.locator(`[role="menuitem"]:has-text("${filterName}")`);
+
+    await menuItem.click();
+    await this.page.waitForTimeout(300);

Review Comment:
   Could use explicit wait



##########
airflow-core/src/airflow/ui/tests/e2e/pages/EventsPage.ts:
##########
@@ -21,8 +21,10 @@ import { BasePage } from "tests/e2e/pages/BasePage";
 
 export class EventsPage extends BasePage {
   public readonly eventColumn: Locator;

Review Comment:
   These are defined but not directly used:
   eventColumn, extraColumn, ownerColumn, whenColumn
   clickColumnHeader() (only clickColumnToSort() is used)
   
   Consider removing if not needed.



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