choo121600 commented on code in PR #63113:
URL: https://github.com/apache/airflow/pull/63113#discussion_r2922181965
##########
airflow-core/src/airflow/ui/tests/e2e/pages/ConnectionsPage.ts:
##########
@@ -91,15 +93,23 @@ export class ConnectionsPage extends BasePage {
this.successAlert = page.locator('[data-scope="toast"][data-part="root"]');
// Delete confirmation dialog
- this.confirmDeleteButton =
page.locator('button:has-text("Delete")').first();
+ this.confirmDeleteButton = page.getByRole("button", { name: "Delete"
}).first();
this.rowsPerPageSelect = page.locator("select");
// Sorting and filtering
this.tableHeader = page.locator('[role="columnheader"]').first();
- this.connectionIdHeader = page.locator("th:has-text('Connection
ID')").first();
- this.connectionTypeHeader = page.locator('th:has-text("Connection
Type")').first();
- this.hostHeader = page.locator('th:has-text("Host")').first();
+ this.connectionIdHeader = page
Review Comment:
Could we try using `getByRole` here?
##########
airflow-core/src/airflow/ui/tests/e2e/pages/ConnectionsPage.ts:
##########
@@ -407,7 +415,7 @@ export class ConnectionsPage extends BasePage {
// Get count twice to ensure it's stable
const count1 = ids.length;
- await this.page.evaluate(() => new Promise((r) => setTimeout(r,
200)));
+ await this.page.waitForTimeout(200);
Review Comment:
Replacing `page.evaluate(() => new Promise((r) => setTimeout(r, 200)))` with
`page.waitForTimeout(200)` just swaps one anti-pattern for another.
According to the Playwright docs, waitForTimeout is recommended only for
debugging purposes.
It might be better to change the stability check itself to use a
locator-based approach.
##########
airflow-core/src/airflow/ui/tests/e2e/pages/ConnectionsPage.ts:
##########
Review Comment:
This part is a manual assertion without auto-retry.
Switching to web-first assertions aligns better with the goals of this PR :)
--
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]