Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,10 @@
}

public async getActionsTableRowCount(): Promise<number> {
const rows = this.page.locator("table tbody tr");
const rows = this.actionsTable.locator("tbody").getByRole("row");
const isTableVisible = await this.actionsTable.isVisible();

if (!isTableVisible) {
return 0;
}

return rows.count();
return isTableVisible ? rows.count() : 0;
}

public async isEmptyStateDisplayed(): Promise<boolean> {
Expand Down Expand Up @@ -77,13 +73,12 @@

await button.click();
await responsePromise;
await this.page.waitForTimeout(10_000);
}

private async clickOnTaskInGrid(dagRunId: string, taskId: string): Promise<void> {
const taskLocator = this.page.locator(`[id="grid-${dagRunId}-${taskId}"]`);
const taskLocator = this.page.getByTestId(`grid-${dagRunId}-${taskId}`);

await expect(taskLocator).toBeVisible({ timeout: 30_000 });
await expect(taskLocator).toBeVisible({ timeout: 5000 });
await taskLocator.click();
}

Expand All @@ -96,11 +91,11 @@
await requiredActionLink.click();

const buttonName = approve ? "Approve" : "Reject";
const actionButton = this.page.locator(`[data-testid="hitl-option-${buttonName}"]`);
const actionButton = this.page.getByTestId(`hitl-option-${buttonName}`);

await expect(actionButton).toBeVisible({ timeout: 10_000 });

const informationInput = this.page.locator("#element_information");
const informationInput = this.page.getByRole("textbox");

if (await informationInput.isVisible()) {
await informationInput.fill("Approved by test");
Expand All @@ -121,7 +116,7 @@
await expect(requiredActionLink).toBeVisible({ timeout: 30_000 });
await requiredActionLink.click();

const branchButton = this.page.locator('[data-testid="hitl-option-task_1"]');
const branchButton = this.page.getByTestId("hitl-option-task_1");

await expect(branchButton).toBeVisible({ timeout: 10_000 });
await this.clickButtonAndWaitForHITLResponse(branchButton);
Expand All @@ -138,7 +133,7 @@
await expect(requiredActionLink).toBeVisible({ timeout: 30_000 });
await requiredActionLink.click();

const informationInput = this.page.locator("#element_information");
const informationInput = this.page.getByRole("textbox");

await expect(informationInput).toBeVisible({ timeout: 10_000 });
await informationInput.fill("test");
Expand All @@ -160,7 +155,7 @@
await expect(requiredActionLink).toBeVisible({ timeout: 30_000 });
await requiredActionLink.click();

const multiSelectContainer = this.page.locator("#element_chosen_options").locator("..");
const multiSelectContainer = this.page.getByRole("combobox", { name: /select one or multiple values/i });

await expect(multiSelectContainer).toBeVisible({ timeout: 30_000 });
await multiSelectContainer.click();
Expand All @@ -186,9 +181,9 @@
await expect(requiredActionLink).toBeVisible({ timeout: 30_000 });
await requiredActionLink.click();

const optionButton = this.page.locator('[data-testid="hitl-option-option 1"]');
const optionButton = this.page.getByTestId("hitl-option-option 1");

await expect(optionButton).toBeVisible({ timeout: 10_000 });

Check failure on line 186 in airflow-core/src/airflow/ui/tests/e2e/pages/RequiredActionsPage.ts

View workflow job for this annotation

GitHub Actions / Additional PROD image tests / Firefox UI e2e tests with PROD image / Firefox UI e2e tests

[firefox] › tests/e2e/specs/requiredAction.spec.ts:43:3 › Verify Required Action page › Verify the actions list/table is displayed (or empty state if none)

1) [firefox] › tests/e2e/specs/requiredAction.spec.ts:43:3 › Verify Required Action page › Verify the actions list/table is displayed (or empty state if none) Error: expect(locator).toBeVisible() failed Locator: getByTestId('hitl-option-option 1') Expected: visible Timeout: 10000ms Error: element(s) not found Call log: - Expect "toBeVisible" with timeout 10000ms - waiting for getByTestId('hitl-option-option 1') at ../pages/RequiredActionsPage.ts:186 184 | const optionButton = this.page.getByTestId("hitl-option-option 1"); 185 | > 186 | await expect(optionButton).toBeVisible({ timeout: 10_000 }); | ^ 187 | await this.clickButtonAndWaitForHITLResponse(optionButton); 188 | 189 | await this.page.goto(`/dags/${dagId}/runs/${dagRunId}`); at RequiredActionsPage.handleWaitForOptionTask (/home/runner/work/airflow/airflow/airflow-core/src/airflow/ui/tests/e2e/pages/RequiredActionsPage.ts:186:32) at RequiredActionsPage.runHITLFlow (/home/runner/work/airflow/airflow/airflow-core/src/airflow/ui/tests/e2e/pages/RequiredActionsPage.ts:215:5) at RequiredActionsPage.runHITLFlowWithRejection (/home/runner/work/airflow/airflow/airflow-core/src/airflow/ui/tests/e2e/pages/RequiredActionsPage.ts:65:5) at /home/runner/work/airflow/airflow/airflow-core/src/airflow/ui/tests/e2e/specs/requiredAction.spec.ts:38:5
await this.clickButtonAndWaitForHITLResponse(optionButton);

await this.page.goto(`/dags/${dagId}/runs/${dagRunId}`);
Expand Down Expand Up @@ -256,7 +251,7 @@
const detailsPanel = this.page.locator("#details-panel");
const stateBadge = detailsPanel.getByTestId("state-badge").first();

await expect(stateBadge).toContainText(expectedState, { timeout: 60_000 });
await expect(stateBadge).toContainText(expectedState, { timeout: 5000 });
}).toPass({ timeout: 180_000 });
}

Expand All @@ -272,7 +267,7 @@
const detailsPanel = this.page.locator("#details-panel");
const stateBadge = detailsPanel.getByTestId("state-badge").first();

await expect(stateBadge).toContainText(options.expectedState, { timeout: 60_000 });
await expect(stateBadge).toContainText(options.expectedState, { timeout: 5000 });
}).toPass({ timeout: options.timeout ?? 120_000 });
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,25 +45,14 @@ test.describe("Verify Required Action page", () => {

await browsePage.navigateToRequiredActionsPage();

const isTableVisible = await browsePage.isTableDisplayed();
const isEmptyStateVisible = await browsePage.isEmptyStateDisplayed();

expect(isTableVisible || isEmptyStateVisible).toBe(true);

if (isTableVisible) {
await expect(browsePage.actionsTable).toBeVisible();

const dagIdHeader = page.locator('th:has-text("Dag ID")');
const taskIdHeader = page.locator('th:has-text("Task ID")');
const dagRunIdHeader = page.locator('th:has-text("Dag Run ID")');
const responseCreatedHeader = page.locator('th:has-text("Response created at")');
const responseReceivedHeader = page.locator('th:has-text("Response received at")');

await expect(dagIdHeader).toBeVisible();
await expect(taskIdHeader).toBeVisible();
await expect(dagRunIdHeader).toBeVisible();
await expect(responseCreatedHeader).toBeVisible();
await expect(responseReceivedHeader).toBeVisible();
await expect(browsePage.actionsTable.or(browsePage.emptyStateMessage)).toBeVisible();

if (await browsePage.actionsTable.isVisible()) {
await expect(page.locator("th").filter({ hasText: "Dag ID" })).toBeVisible();
await expect(page.locator("th").filter({ hasText: "Task ID" })).toBeVisible();
await expect(page.locator("th").filter({ hasText: "Dag Run ID" })).toBeVisible();
await expect(page.locator("th").filter({ hasText: "Response created at" })).toBeVisible();
await expect(page.locator("th").filter({ hasText: "Response received at" })).toBeVisible();
} else {
await expect(browsePage.emptyStateMessage).toBeVisible();
}
Expand Down
Loading