choo121600 commented on code in PR #63474:
URL: https://github.com/apache/airflow/pull/63474#discussion_r2968960081
##########
airflow-core/src/airflow/ui/tests/e2e/specs/providers.spec.ts:
##########
@@ -47,24 +47,23 @@ test.describe("Providers Page", () => {
await providers.waitForLoad();
// Assert Providers page loaded
await expect(providers.heading).toBeVisible();
- expect(await providers.getRowCount()).toBeGreaterThan(0);
+ await expect(providers.rows.first()).toBeVisible();
});
test("Verify the providers list displays", async () => {
await expect(providers.table).toBeVisible();
});
test("Verify package name, version, and description are not blank", async ()
=> {
- const count = await providers.getRowCount();
-
- expect(count).toBeGreaterThan(0);
+ await expect(providers.rows.first()).toBeVisible();
for (let i = 0; i < 2; i++) {
- const { description, packageName, version } = await
providers.getRowDetails(i);
+ const row = providers.rows.nth(i);
+ const cells = row.locator("td");
- expect(packageName).not.toEqual("");
- expect(version).not.toEqual("");
- expect(description).not.toEqual("");
+ await expect(cells.nth(0).locator("a")).not.toBeEmpty();
+ await expect(cells.nth(1)).not.toBeEmpty();
+ await expect(cells.nth(2)).not.toBeEmpty();
Review Comment:
Could you explain why you removed `const { description, packageName, version
} = await providers.getRowDetails(i);` in this part and made this change?
##########
airflow-core/src/airflow/ui/tests/e2e/pages/ProvidersPage.ts:
##########
@@ -39,47 +39,13 @@ export class ProvidersPage extends BasePage {
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 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();
- }
-
- 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;
- }
-
- // Check for actual links in tbody (real data, not skeleton)
- const links = table.querySelectorAll("tbody tr td a");
-
- return links.length > 0;
- },
- undefined,
- { timeout: 30_000 },
- );
+ await this.table.locator("tbody tr").first().waitFor({ state: "visible",
timeout: 30_000 });
+ await this.table.locator("tbody tr td a").first().waitFor({ state:
"visible", timeout: 30_000 });
Review Comment:
Do you think there’s a better approach than using `.waitFor()` here?
--
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]