Shrividya commented on code in PR #64078:
URL: https://github.com/apache/airflow/pull/64078#discussion_r2976517737


##########
airflow-core/src/airflow/ui/tests/e2e/pages/ProvidersPage.ts:
##########
@@ -16,70 +16,55 @@
  * specific language governing permissions and limitations
  * under the License.
  */
+import { expect } from "@playwright/test";
 import type { Locator, Page } from "@playwright/test";
 
 import { BasePage } from "./BasePage";
 
 export class ProvidersPage extends BasePage {
+  public readonly adminMenuButton: Locator;
   public readonly heading: Locator;
+  public readonly providersMenuItem: Locator;
   public readonly rows: Locator;
   public readonly table: Locator;
 
   public constructor(page: Page) {
     super(page);
 
+    this.adminMenuButton = page.getByRole("button", { name: /^admin$/i });
     this.heading = page.getByRole("heading", { name: /^providers$/i });
+    this.providersMenuItem = page.getByRole("menuitem", { name: /^providers$/i 
});
     this.table = page.getByTestId("table-list");
     this.rows = this.table.locator("tbody tr").filter({
       has: page.locator("td"),
     });
   }
 
-  public async getRowCount(): Promise<number> {
-    return this.rows.count();
-  }
-
-  public async getRowDetails(index: number) {
-    const row = this.rows.nth(index);
-    const cells = row.locator("td");
-
-    const pkg = await cells.nth(0).locator("a").textContent();
-    const ver = await cells.nth(1).textContent();
-    const desc = await cells.nth(2).textContent();
-
-    return {
-      description: (desc ?? "").trim(),
-      packageName: (pkg ?? "").trim(),
-      version: (ver ?? "").trim(),
-    };
+  public descriptionCellAt(index: number): Locator {
+    return this.rows.nth(index).locator("td").nth(2);
   }
 
   public async navigate(): Promise<void> {
     await this.navigateTo("/providers");
   }
 
-  public async waitForLoad(): Promise<void> {
-    await this.table.waitFor({ state: "visible", timeout: 30_000 });
-    await this.waitForTableData();
+  public async navigateFromAdminMenu(): Promise<void> {
+    await this.navigateTo("/");
+    await this.adminMenuButton.click();
+    await expect(this.providersMenuItem).toBeVisible();
+    await this.providersMenuItem.click();
   }
 
-  private async waitForTableData(): Promise<void> {
-    // Wait for actual data links to appear (not skeleton loaders)
-    await this.page.waitForFunction(
-      () => {
-        const table = document.querySelector('[data-testid="table-list"]');
-
-        if (!table) {
-          return false;
-        }
+  public packageLinkAt(index: number): Locator {
+    return this.rows.nth(index).locator("td").nth(0).getByRole("link");
+  }
 
-        // Check for actual links in tbody (real data, not skeleton)
-        const links = table.querySelectorAll("tbody tr td a");
+  public versionCellAt(index: number): Locator {
+    return this.rows.nth(index).locator("td").nth(1);
+  }
 
-        return links.length > 0;
-      },
-      undefined,
-      { timeout: 30_000 },
-    );
+  public async waitForLoad(): Promise<void> {
+    await expect(this.table).toBeVisible({ timeout: 30_000 });
+    await expect(this.rows.first()).toBeVisible({ timeout: 30_000 });

Review Comment:
   LGTM! 👍 



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