Skip to content
Closed
Show file tree
Hide file tree
Changes from 5 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
30 changes: 18 additions & 12 deletions airflow-core/src/airflow/ui/src/pages/DagRuns.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ const runColumns = (translate: TFunction, dagId?: string): Array<ColumnDef<DAGRu
accessorKey: "dag_run_id",
cell: ({ row: { original } }: DagRunRow) => (
<Link asChild color="fg.info" fontWeight="bold">
<RouterLink to={`/dags/${original.dag_id}/runs/${original.dag_run_id}`}>
<RouterLink data-testid="run-id" to={`/dags/${original.dag_id}/runs/${original.dag_run_id}`}>
<TruncatedText text={original.dag_run_id} />
</RouterLink>
</Link>
Expand All @@ -104,7 +104,11 @@ const runColumns = (translate: TFunction, dagId?: string): Array<ColumnDef<DAGRu
row: {
original: { state },
},
}) => <StateBadge state={state}>{translate(`common:states.${state}`)}</StateBadge>,
}) => (
<Flex data-testid="run-state">
<StateBadge state={state}>{translate(`common:states.${state}`)}</StateBadge>
</Flex>
),
header: () => translate("state"),
},
{
Expand Down Expand Up @@ -243,16 +247,18 @@ export const DagRuns = () => {
return (
<>
<DagRunsFilters dagId={dagId} />
<DataTable
columns={columns}
data={data?.dag_runs ?? []}
errorMessage={<ErrorAlert error={error} />}
initialState={tableURLState}
isLoading={isLoading}
modelName={translate("common:dagRun_other")}
onStateChange={setTableURLState}
total={data?.total_entries}
/>
<div data-testid="dag-runs-table">
<DataTable
columns={columns}
data={data?.dag_runs ?? []}
errorMessage={<ErrorAlert error={error} />}
initialState={tableURLState}
isLoading={isLoading}
modelName={translate("common:dagRun_other")}
onStateChange={setTableURLState}
total={data?.total_entries}
/>
</div>
</>
);
};
121 changes: 118 additions & 3 deletions airflow-core/src/airflow/ui/tests/e2e/pages/DagsPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@
// Pagination elements
public readonly paginationNextButton: Locator;
public readonly paginationPrevButton: Locator;
// Runs tab elements
public readonly runsTab: Locator;
public readonly runsTable: Locator;

public readonly stateElement: Locator;
public readonly triggerButton: Locator;
Expand All @@ -48,6 +51,8 @@
this.stateElement = page.locator('*:has-text("State") + *').first();
this.paginationNextButton = page.locator('[data-testid="next"]');
this.paginationPrevButton = page.locator('[data-testid="prev"]');
this.runsTab = page.locator('a[href$="/runs"]');
this.runsTable = page.locator('[data-testid="dag-runs-table"]');
}

// URL builders for dynamic paths
Expand Down Expand Up @@ -75,6 +80,36 @@
await this.waitForDagList();
}

/**
* Click on a specific run to view details
*/
public async clickRun(runId: string): Promise<void> {
const runLink = this.page.locator(`a:has-text("${runId}")`).first();

await runLink.waitFor({ state: "visible" });
await runLink.click();
await this.waitForPageLoad();
}

/**
* Filter runs by state
*/
public async filterByState(state: string): Promise<void> {
// Click on the state filter
const stateFilter = this.page.locator('button:has-text("State")');

await stateFilter.waitFor({ state: "visible" });
await stateFilter.click();

// Select the specific state
const stateOption = this.page.locator(`[role="option"]:has-text("${state}")`);

await stateOption.waitFor({ state: "visible" });
await stateOption.click();

await this.waitForPageLoad();
}

/**
* Get all Dag names from the current page
*/
Expand All @@ -86,6 +121,34 @@
return texts.map((text) => text.trim()).filter((text) => text !== "");
}

/**
* Get run details from the runs table
*/
public async getRunDetails(): Promise<
Array<{
runId: string;
state: string;
}>
> {
const runRows = this.page.locator('[data-testid="dag-runs-table"] table tbody tr');

await runRows.first().waitFor({ state: "visible", timeout: 10_000 });

const runCount = await runRows.count();
const runs: Array<{ runId: string; state: string }> = [];

for (let i = 0; i < runCount; i++) {
const row = runRows.nth(i);

const runId = (await row.locator('[data-testid="run-id"]').textContent()) ?? "";
const state = (await row.locator('[data-testid="run-state"]').textContent()) ?? "";

runs.push({ runId: runId.trim(), state: state.trim() });
}

return runs;
}

/**
* Navigate to Dags list page
*/
Expand All @@ -100,6 +163,38 @@
await this.navigateTo(DagsPage.getDagDetailUrl(dagName));
}

/**
* Navigate to the Runs tab for a specific DAG
*/
public async navigateToRunsTab(dagName: string): Promise<void> {
await this.navigateToDagDetail(dagName);
await this.runsTab.waitFor({ state: "visible" });
await this.runsTab.click();
await this.waitForPageLoad();

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

View workflow job for this annotation

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

[webkit] › tests/e2e/specs/dags-list.spec.ts:142:3 › Dag Runs Tab › should filter runs by state

4) [webkit] › tests/e2e/specs/dags-list.spec.ts:142:3 › Dag Runs Tab › should filter runs by state TypeError: this.waitForPageLoad is not a function at ../pages/DagsPage.ts:173 171 | await this.runsTab.waitFor({ state: "visible" }); 172 | await this.runsTab.click(); > 173 | await this.waitForPageLoad(); | ^ 174 | } 175 | 176 | /** at DagsPage.navigateToRunsTab (/home/runner/work/airflow/airflow/airflow-core/src/airflow/ui/tests/e2e/pages/DagsPage.ts:173:16) at /home/runner/work/airflow/airflow/airflow-core/src/airflow/ui/tests/e2e/specs/dags-list.spec.ts:143:5

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

View workflow job for this annotation

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

[webkit] › tests/e2e/specs/dags-list.spec.ts:127:3 › Dag Runs Tab › should click run and navigate to details page

3) [webkit] › tests/e2e/specs/dags-list.spec.ts:127:3 › Dag Runs Tab › should click run and navigate to details page Retry #2 ─────────────────────────────────────────────────────────────────────────────────────── TypeError: this.waitForPageLoad is not a function at ../pages/DagsPage.ts:173 171 | await this.runsTab.waitFor({ state: "visible" }); 172 | await this.runsTab.click(); > 173 | await this.waitForPageLoad(); | ^ 174 | } 175 | 176 | /** at DagsPage.navigateToRunsTab (/home/runner/work/airflow/airflow/airflow-core/src/airflow/ui/tests/e2e/pages/DagsPage.ts:173:16) at /home/runner/work/airflow/airflow/airflow-core/src/airflow/ui/tests/e2e/specs/dags-list.spec.ts:128:5

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

View workflow job for this annotation

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

[webkit] › tests/e2e/specs/dags-list.spec.ts:127:3 › Dag Runs Tab › should click run and navigate to details page

3) [webkit] › tests/e2e/specs/dags-list.spec.ts:127:3 › Dag Runs Tab › should click run and navigate to details page Retry #1 ─────────────────────────────────────────────────────────────────────────────────────── TypeError: this.waitForPageLoad is not a function at ../pages/DagsPage.ts:173 171 | await this.runsTab.waitFor({ state: "visible" }); 172 | await this.runsTab.click(); > 173 | await this.waitForPageLoad(); | ^ 174 | } 175 | 176 | /** at DagsPage.navigateToRunsTab (/home/runner/work/airflow/airflow/airflow-core/src/airflow/ui/tests/e2e/pages/DagsPage.ts:173:16) at /home/runner/work/airflow/airflow/airflow-core/src/airflow/ui/tests/e2e/specs/dags-list.spec.ts:128:5

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

View workflow job for this annotation

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

[webkit] › tests/e2e/specs/dags-list.spec.ts:127:3 › Dag Runs Tab › should click run and navigate to details page

3) [webkit] › tests/e2e/specs/dags-list.spec.ts:127:3 › Dag Runs Tab › should click run and navigate to details page TypeError: this.waitForPageLoad is not a function at ../pages/DagsPage.ts:173 171 | await this.runsTab.waitFor({ state: "visible" }); 172 | await this.runsTab.click(); > 173 | await this.waitForPageLoad(); | ^ 174 | } 175 | 176 | /** at DagsPage.navigateToRunsTab (/home/runner/work/airflow/airflow/airflow-core/src/airflow/ui/tests/e2e/pages/DagsPage.ts:173:16) at /home/runner/work/airflow/airflow/airflow-core/src/airflow/ui/tests/e2e/specs/dags-list.spec.ts:128:5

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

View workflow job for this annotation

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

[webkit] › tests/e2e/specs/dags-list.spec.ts:113:3 › Dag Runs Tab › should verify run details are displayed correctly

2) [webkit] › tests/e2e/specs/dags-list.spec.ts:113:3 › Dag Runs Tab › should verify run details are displayed correctly Retry #2 ─────────────────────────────────────────────────────────────────────────────────────── TypeError: this.waitForPageLoad is not a function at ../pages/DagsPage.ts:173 171 | await this.runsTab.waitFor({ state: "visible" }); 172 | await this.runsTab.click(); > 173 | await this.waitForPageLoad(); | ^ 174 | } 175 | 176 | /** at DagsPage.navigateToRunsTab (/home/runner/work/airflow/airflow/airflow-core/src/airflow/ui/tests/e2e/pages/DagsPage.ts:173:16) at /home/runner/work/airflow/airflow/airflow-core/src/airflow/ui/tests/e2e/specs/dags-list.spec.ts:114:5

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

View workflow job for this annotation

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

[webkit] › tests/e2e/specs/dags-list.spec.ts:113:3 › Dag Runs Tab › should verify run details are displayed correctly

2) [webkit] › tests/e2e/specs/dags-list.spec.ts:113:3 › Dag Runs Tab › should verify run details are displayed correctly Retry #1 ─────────────────────────────────────────────────────────────────────────────────────── TypeError: this.waitForPageLoad is not a function at ../pages/DagsPage.ts:173 171 | await this.runsTab.waitFor({ state: "visible" }); 172 | await this.runsTab.click(); > 173 | await this.waitForPageLoad(); | ^ 174 | } 175 | 176 | /** at DagsPage.navigateToRunsTab (/home/runner/work/airflow/airflow/airflow-core/src/airflow/ui/tests/e2e/pages/DagsPage.ts:173:16) at /home/runner/work/airflow/airflow/airflow-core/src/airflow/ui/tests/e2e/specs/dags-list.spec.ts:114:5

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

View workflow job for this annotation

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

[webkit] › tests/e2e/specs/dags-list.spec.ts:113:3 › Dag Runs Tab › should verify run details are displayed correctly

2) [webkit] › tests/e2e/specs/dags-list.spec.ts:113:3 › Dag Runs Tab › should verify run details are displayed correctly TypeError: this.waitForPageLoad is not a function at ../pages/DagsPage.ts:173 171 | await this.runsTab.waitFor({ state: "visible" }); 172 | await this.runsTab.click(); > 173 | await this.waitForPageLoad(); | ^ 174 | } 175 | 176 | /** at DagsPage.navigateToRunsTab (/home/runner/work/airflow/airflow/airflow-core/src/airflow/ui/tests/e2e/pages/DagsPage.ts:173:16) at /home/runner/work/airflow/airflow/airflow-core/src/airflow/ui/tests/e2e/specs/dags-list.spec.ts:114:5

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

View workflow job for this annotation

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

[webkit] › tests/e2e/specs/dags-list.spec.ts:101:3 › Dag Runs Tab › should navigate to Runs tab and display correctly

1) [webkit] › tests/e2e/specs/dags-list.spec.ts:101:3 › Dag Runs Tab › should navigate to Runs tab and display correctly Retry #2 ─────────────────────────────────────────────────────────────────────────────────────── TypeError: this.waitForPageLoad is not a function at ../pages/DagsPage.ts:173 171 | await this.runsTab.waitFor({ state: "visible" }); 172 | await this.runsTab.click(); > 173 | await this.waitForPageLoad(); | ^ 174 | } 175 | 176 | /** at DagsPage.navigateToRunsTab (/home/runner/work/airflow/airflow/airflow-core/src/airflow/ui/tests/e2e/pages/DagsPage.ts:173:16) at /home/runner/work/airflow/airflow/airflow-core/src/airflow/ui/tests/e2e/specs/dags-list.spec.ts:102:5

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

View workflow job for this annotation

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

[webkit] › tests/e2e/specs/dags-list.spec.ts:101:3 › Dag Runs Tab › should navigate to Runs tab and display correctly

1) [webkit] › tests/e2e/specs/dags-list.spec.ts:101:3 › Dag Runs Tab › should navigate to Runs tab and display correctly Retry #1 ─────────────────────────────────────────────────────────────────────────────────────── TypeError: this.waitForPageLoad is not a function at ../pages/DagsPage.ts:173 171 | await this.runsTab.waitFor({ state: "visible" }); 172 | await this.runsTab.click(); > 173 | await this.waitForPageLoad(); | ^ 174 | } 175 | 176 | /** at DagsPage.navigateToRunsTab (/home/runner/work/airflow/airflow/airflow-core/src/airflow/ui/tests/e2e/pages/DagsPage.ts:173:16) at /home/runner/work/airflow/airflow/airflow-core/src/airflow/ui/tests/e2e/specs/dags-list.spec.ts:102:5

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

View workflow job for this annotation

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

[webkit] › tests/e2e/specs/dags-list.spec.ts:101:3 › Dag Runs Tab › should navigate to Runs tab and display correctly

1) [webkit] › tests/e2e/specs/dags-list.spec.ts:101:3 › Dag Runs Tab › should navigate to Runs tab and display correctly TypeError: this.waitForPageLoad is not a function at ../pages/DagsPage.ts:173 171 | await this.runsTab.waitFor({ state: "visible" }); 172 | await this.runsTab.click(); > 173 | await this.waitForPageLoad(); | ^ 174 | } 175 | 176 | /** at DagsPage.navigateToRunsTab (/home/runner/work/airflow/airflow/airflow-core/src/airflow/ui/tests/e2e/pages/DagsPage.ts:173:16) at /home/runner/work/airflow/airflow/airflow-core/src/airflow/ui/tests/e2e/specs/dags-list.spec.ts:102:5

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

View workflow job for this annotation

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

[chromium] › tests/e2e/specs/dags-list.spec.ts:142:3 › Dag Runs Tab › should filter runs by state

4) [chromium] › tests/e2e/specs/dags-list.spec.ts:142:3 › Dag Runs Tab › should filter runs by state TypeError: this.waitForPageLoad is not a function at ../pages/DagsPage.ts:173 171 | await this.runsTab.waitFor({ state: "visible" }); 172 | await this.runsTab.click(); > 173 | await this.waitForPageLoad(); | ^ 174 | } 175 | 176 | /** at DagsPage.navigateToRunsTab (/home/runner/work/airflow/airflow/airflow-core/src/airflow/ui/tests/e2e/pages/DagsPage.ts:173:16) at /home/runner/work/airflow/airflow/airflow-core/src/airflow/ui/tests/e2e/specs/dags-list.spec.ts:143:5

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

View workflow job for this annotation

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

[chromium] › tests/e2e/specs/dags-list.spec.ts:127:3 › Dag Runs Tab › should click run and navigate to details page

3) [chromium] › tests/e2e/specs/dags-list.spec.ts:127:3 › Dag Runs Tab › should click run and navigate to details page Retry #2 ─────────────────────────────────────────────────────────────────────────────────────── TypeError: this.waitForPageLoad is not a function at ../pages/DagsPage.ts:173 171 | await this.runsTab.waitFor({ state: "visible" }); 172 | await this.runsTab.click(); > 173 | await this.waitForPageLoad(); | ^ 174 | } 175 | 176 | /** at DagsPage.navigateToRunsTab (/home/runner/work/airflow/airflow/airflow-core/src/airflow/ui/tests/e2e/pages/DagsPage.ts:173:16) at /home/runner/work/airflow/airflow/airflow-core/src/airflow/ui/tests/e2e/specs/dags-list.spec.ts:128:5

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

View workflow job for this annotation

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

[chromium] › tests/e2e/specs/dags-list.spec.ts:127:3 › Dag Runs Tab › should click run and navigate to details page

3) [chromium] › tests/e2e/specs/dags-list.spec.ts:127:3 › Dag Runs Tab › should click run and navigate to details page Retry #1 ─────────────────────────────────────────────────────────────────────────────────────── TypeError: this.waitForPageLoad is not a function at ../pages/DagsPage.ts:173 171 | await this.runsTab.waitFor({ state: "visible" }); 172 | await this.runsTab.click(); > 173 | await this.waitForPageLoad(); | ^ 174 | } 175 | 176 | /** at DagsPage.navigateToRunsTab (/home/runner/work/airflow/airflow/airflow-core/src/airflow/ui/tests/e2e/pages/DagsPage.ts:173:16) at /home/runner/work/airflow/airflow/airflow-core/src/airflow/ui/tests/e2e/specs/dags-list.spec.ts:128:5

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

View workflow job for this annotation

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

[chromium] › tests/e2e/specs/dags-list.spec.ts:127:3 › Dag Runs Tab › should click run and navigate to details page

3) [chromium] › tests/e2e/specs/dags-list.spec.ts:127:3 › Dag Runs Tab › should click run and navigate to details page TypeError: this.waitForPageLoad is not a function at ../pages/DagsPage.ts:173 171 | await this.runsTab.waitFor({ state: "visible" }); 172 | await this.runsTab.click(); > 173 | await this.waitForPageLoad(); | ^ 174 | } 175 | 176 | /** at DagsPage.navigateToRunsTab (/home/runner/work/airflow/airflow/airflow-core/src/airflow/ui/tests/e2e/pages/DagsPage.ts:173:16) at /home/runner/work/airflow/airflow/airflow-core/src/airflow/ui/tests/e2e/specs/dags-list.spec.ts:128:5

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

View workflow job for this annotation

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

[chromium] › tests/e2e/specs/dags-list.spec.ts:113:3 › Dag Runs Tab › should verify run details are displayed correctly

2) [chromium] › tests/e2e/specs/dags-list.spec.ts:113:3 › Dag Runs Tab › should verify run details are displayed correctly Retry #2 ─────────────────────────────────────────────────────────────────────────────────────── TypeError: this.waitForPageLoad is not a function at ../pages/DagsPage.ts:173 171 | await this.runsTab.waitFor({ state: "visible" }); 172 | await this.runsTab.click(); > 173 | await this.waitForPageLoad(); | ^ 174 | } 175 | 176 | /** at DagsPage.navigateToRunsTab (/home/runner/work/airflow/airflow/airflow-core/src/airflow/ui/tests/e2e/pages/DagsPage.ts:173:16) at /home/runner/work/airflow/airflow/airflow-core/src/airflow/ui/tests/e2e/specs/dags-list.spec.ts:114:5

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

View workflow job for this annotation

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

[chromium] › tests/e2e/specs/dags-list.spec.ts:113:3 › Dag Runs Tab › should verify run details are displayed correctly

2) [chromium] › tests/e2e/specs/dags-list.spec.ts:113:3 › Dag Runs Tab › should verify run details are displayed correctly Retry #1 ─────────────────────────────────────────────────────────────────────────────────────── TypeError: this.waitForPageLoad is not a function at ../pages/DagsPage.ts:173 171 | await this.runsTab.waitFor({ state: "visible" }); 172 | await this.runsTab.click(); > 173 | await this.waitForPageLoad(); | ^ 174 | } 175 | 176 | /** at DagsPage.navigateToRunsTab (/home/runner/work/airflow/airflow/airflow-core/src/airflow/ui/tests/e2e/pages/DagsPage.ts:173:16) at /home/runner/work/airflow/airflow/airflow-core/src/airflow/ui/tests/e2e/specs/dags-list.spec.ts:114:5

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

View workflow job for this annotation

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

[chromium] › tests/e2e/specs/dags-list.spec.ts:113:3 › Dag Runs Tab › should verify run details are displayed correctly

2) [chromium] › tests/e2e/specs/dags-list.spec.ts:113:3 › Dag Runs Tab › should verify run details are displayed correctly TypeError: this.waitForPageLoad is not a function at ../pages/DagsPage.ts:173 171 | await this.runsTab.waitFor({ state: "visible" }); 172 | await this.runsTab.click(); > 173 | await this.waitForPageLoad(); | ^ 174 | } 175 | 176 | /** at DagsPage.navigateToRunsTab (/home/runner/work/airflow/airflow/airflow-core/src/airflow/ui/tests/e2e/pages/DagsPage.ts:173:16) at /home/runner/work/airflow/airflow/airflow-core/src/airflow/ui/tests/e2e/specs/dags-list.spec.ts:114:5

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

View workflow job for this annotation

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

[chromium] › tests/e2e/specs/dags-list.spec.ts:101:3 › Dag Runs Tab › should navigate to Runs tab and display correctly

1) [chromium] › tests/e2e/specs/dags-list.spec.ts:101:3 › Dag Runs Tab › should navigate to Runs tab and display correctly Retry #2 ─────────────────────────────────────────────────────────────────────────────────────── TypeError: this.waitForPageLoad is not a function at ../pages/DagsPage.ts:173 171 | await this.runsTab.waitFor({ state: "visible" }); 172 | await this.runsTab.click(); > 173 | await this.waitForPageLoad(); | ^ 174 | } 175 | 176 | /** at DagsPage.navigateToRunsTab (/home/runner/work/airflow/airflow/airflow-core/src/airflow/ui/tests/e2e/pages/DagsPage.ts:173:16) at /home/runner/work/airflow/airflow/airflow-core/src/airflow/ui/tests/e2e/specs/dags-list.spec.ts:102:5

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

View workflow job for this annotation

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

[chromium] › tests/e2e/specs/dags-list.spec.ts:101:3 › Dag Runs Tab › should navigate to Runs tab and display correctly

1) [chromium] › tests/e2e/specs/dags-list.spec.ts:101:3 › Dag Runs Tab › should navigate to Runs tab and display correctly Retry #1 ─────────────────────────────────────────────────────────────────────────────────────── TypeError: this.waitForPageLoad is not a function at ../pages/DagsPage.ts:173 171 | await this.runsTab.waitFor({ state: "visible" }); 172 | await this.runsTab.click(); > 173 | await this.waitForPageLoad(); | ^ 174 | } 175 | 176 | /** at DagsPage.navigateToRunsTab (/home/runner/work/airflow/airflow/airflow-core/src/airflow/ui/tests/e2e/pages/DagsPage.ts:173:16) at /home/runner/work/airflow/airflow/airflow-core/src/airflow/ui/tests/e2e/specs/dags-list.spec.ts:102:5

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

View workflow job for this annotation

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

[chromium] › tests/e2e/specs/dags-list.spec.ts:101:3 › Dag Runs Tab › should navigate to Runs tab and display correctly

1) [chromium] › tests/e2e/specs/dags-list.spec.ts:101:3 › Dag Runs Tab › should navigate to Runs tab and display correctly TypeError: this.waitForPageLoad is not a function at ../pages/DagsPage.ts:173 171 | await this.runsTab.waitFor({ state: "visible" }); 172 | await this.runsTab.click(); > 173 | await this.waitForPageLoad(); | ^ 174 | } 175 | 176 | /** at DagsPage.navigateToRunsTab (/home/runner/work/airflow/airflow/airflow-core/src/airflow/ui/tests/e2e/pages/DagsPage.ts:173:16) at /home/runner/work/airflow/airflow/airflow-core/src/airflow/ui/tests/e2e/specs/dags-list.spec.ts:102:5

Check failure on line 173 in airflow-core/src/airflow/ui/tests/e2e/pages/DagsPage.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/dags-list.spec.ts:113:3 › Dag Runs Tab › should verify run details are displayed correctly

3) [firefox] › tests/e2e/specs/dags-list.spec.ts:113:3 › Dag Runs Tab › should verify run details are displayed correctly Retry #1 ─────────────────────────────────────────────────────────────────────────────────────── TypeError: this.waitForPageLoad is not a function at ../pages/DagsPage.ts:173 171 | await this.runsTab.waitFor({ state: "visible" }); 172 | await this.runsTab.click(); > 173 | await this.waitForPageLoad(); | ^ 174 | } 175 | 176 | /** at DagsPage.navigateToRunsTab (/home/runner/work/airflow/airflow/airflow-core/src/airflow/ui/tests/e2e/pages/DagsPage.ts:173:16) at /home/runner/work/airflow/airflow/airflow-core/src/airflow/ui/tests/e2e/specs/dags-list.spec.ts:114:5

Check failure on line 173 in airflow-core/src/airflow/ui/tests/e2e/pages/DagsPage.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/dags-list.spec.ts:113:3 › Dag Runs Tab › should verify run details are displayed correctly

3) [firefox] › tests/e2e/specs/dags-list.spec.ts:113:3 › Dag Runs Tab › should verify run details are displayed correctly TypeError: this.waitForPageLoad is not a function at ../pages/DagsPage.ts:173 171 | await this.runsTab.waitFor({ state: "visible" }); 172 | await this.runsTab.click(); > 173 | await this.waitForPageLoad(); | ^ 174 | } 175 | 176 | /** at DagsPage.navigateToRunsTab (/home/runner/work/airflow/airflow/airflow-core/src/airflow/ui/tests/e2e/pages/DagsPage.ts:173:16) at /home/runner/work/airflow/airflow/airflow-core/src/airflow/ui/tests/e2e/specs/dags-list.spec.ts:114:5

Check failure on line 173 in airflow-core/src/airflow/ui/tests/e2e/pages/DagsPage.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/dags-list.spec.ts:101:3 › Dag Runs Tab › should navigate to Runs tab and display correctly

2) [firefox] › tests/e2e/specs/dags-list.spec.ts:101:3 › Dag Runs Tab › should navigate to Runs tab and display correctly Retry #2 ─────────────────────────────────────────────────────────────────────────────────────── TypeError: this.waitForPageLoad is not a function at ../pages/DagsPage.ts:173 171 | await this.runsTab.waitFor({ state: "visible" }); 172 | await this.runsTab.click(); > 173 | await this.waitForPageLoad(); | ^ 174 | } 175 | 176 | /** at DagsPage.navigateToRunsTab (/home/runner/work/airflow/airflow/airflow-core/src/airflow/ui/tests/e2e/pages/DagsPage.ts:173:16) at /home/runner/work/airflow/airflow/airflow-core/src/airflow/ui/tests/e2e/specs/dags-list.spec.ts:102:5

Check failure on line 173 in airflow-core/src/airflow/ui/tests/e2e/pages/DagsPage.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/dags-list.spec.ts:101:3 › Dag Runs Tab › should navigate to Runs tab and display correctly

2) [firefox] › tests/e2e/specs/dags-list.spec.ts:101:3 › Dag Runs Tab › should navigate to Runs tab and display correctly Retry #1 ─────────────────────────────────────────────────────────────────────────────────────── TypeError: this.waitForPageLoad is not a function at ../pages/DagsPage.ts:173 171 | await this.runsTab.waitFor({ state: "visible" }); 172 | await this.runsTab.click(); > 173 | await this.waitForPageLoad(); | ^ 174 | } 175 | 176 | /** at DagsPage.navigateToRunsTab (/home/runner/work/airflow/airflow/airflow-core/src/airflow/ui/tests/e2e/pages/DagsPage.ts:173:16) at /home/runner/work/airflow/airflow/airflow-core/src/airflow/ui/tests/e2e/specs/dags-list.spec.ts:102:5

Check failure on line 173 in airflow-core/src/airflow/ui/tests/e2e/pages/DagsPage.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/dags-list.spec.ts:101:3 › Dag Runs Tab › should navigate to Runs tab and display correctly

2) [firefox] › tests/e2e/specs/dags-list.spec.ts:101:3 › Dag Runs Tab › should navigate to Runs tab and display correctly TypeError: this.waitForPageLoad is not a function at ../pages/DagsPage.ts:173 171 | await this.runsTab.waitFor({ state: "visible" }); 172 | await this.runsTab.click(); > 173 | await this.waitForPageLoad(); | ^ 174 | } 175 | 176 | /** at DagsPage.navigateToRunsTab (/home/runner/work/airflow/airflow/airflow-core/src/airflow/ui/tests/e2e/pages/DagsPage.ts:173:16) at /home/runner/work/airflow/airflow/airflow-core/src/airflow/ui/tests/e2e/specs/dags-list.spec.ts:102:5
}

/**
* Search for dag runs by run ID pattern
*/
public async searchRun(searchTerm: string): Promise<void> {
Comment thread
Sahil-Shadwal marked this conversation as resolved.
// Find the run ID pattern input field
const searchInput = this.page.locator('input[placeholder*="Run ID"]').or(
this.page.locator('input[name="runIdPattern"]'),
);

await searchInput.waitFor({ state: "visible" });
await searchInput.fill(searchTerm);

// Wait for the search to take effect
await this.page.waitForResponse(
(response) =>
response.url().includes("dagRuns") &&
response.request().method() === "GET" &&
response.status() === 200,
);
await this.waitForPageLoad();
}

/**
* Trigger a Dag run
*/
Expand All @@ -112,9 +207,6 @@
return dagRunId;
}

/**
* Navigate to details tab and verify Dag details are displayed correctly
*/
public async verifyDagDetails(dagName: string): Promise<void> {
await this.navigateToDagDetail(dagName);

Expand Down Expand Up @@ -185,6 +277,29 @@
throw new Error(`Dag run did not complete within 5 minutes: ${dagRunId}`);
}

/**
* Verify we're on the run details page
*/
public async verifyRunDetailsPage(runId: string): Promise<void> {
// Wait for the page to load
await this.waitForPageLoad();

// Verify URL contains the run ID
await expect(this.page).toHaveURL(new RegExp(`/runs/${runId}`));
}

/**
* Verify the Runs tab is displayed correctly
*/
public async verifyRunsTabDisplayed(): Promise<void> {
// Verify the runs table is present
await expect(this.runsTable).toBeVisible();

// Verify pagination controls are visible
await expect(this.paginationNextButton).toBeVisible();
await expect(this.paginationPrevButton).toBeVisible();
}

private async getCurrentDagRunStatus(): Promise<string> {
try {
const statusText = await this.stateElement.textContent().catch(() => "");
Expand Down Expand Up @@ -255,7 +370,7 @@
* Wait for DAG list to be rendered
*/
private async waitForDagList(): Promise<void> {
await expect(this.page.locator('[data-testid="dag-id"]').first()).toBeVisible({

Check failure on line 373 in airflow-core/src/airflow/ui/tests/e2e/pages/DagsPage.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/dags-list.spec.ts:30:3 › Dags Pagination › should verify pagination works on the Dags list page

1) [firefox] › tests/e2e/specs/dags-list.spec.ts:30:3 › Dags Pagination › should verify pagination works on the Dags list page Error: expect(locator).toBeVisible() failed Locator: locator('[data-testid="dag-id"]').first() Expected: visible Timeout: 10000ms Error: element(s) not found Call log: - Expect "toBeVisible" with timeout 10000ms - waiting for locator('[data-testid="dag-id"]').first() at ../pages/DagsPage.ts:373 371 | */ 372 | private async waitForDagList(): Promise<void> { > 373 | await expect(this.page.locator('[data-testid="dag-id"]').first()).toBeVisible({ | ^ 374 | timeout: 10_000, 375 | }); 376 | } at DagsPage.waitForDagList (/home/runner/work/airflow/airflow/airflow-core/src/airflow/ui/tests/e2e/pages/DagsPage.ts:373:71) at DagsPage.getDagNames (/home/runner/work/airflow/airflow/airflow-core/src/airflow/ui/tests/e2e/pages/DagsPage.ts:117:16) at /home/runner/work/airflow/airflow/airflow-core/src/airflow/ui/tests/e2e/specs/dags-list.spec.ts:36:44
timeout: 10_000,
});
}
Expand Down
139 changes: 139 additions & 0 deletions airflow-core/src/airflow/ui/tests/e2e/specs/dags-list.spec.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
/*!
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
Expand Down Expand Up @@ -84,3 +84,142 @@
await dagsPage.verifyDagDetails(testDagId);
});
});
Comment thread
Sahil-Shadwal marked this conversation as resolved.
Outdated

/*
* Dag Runs Tab E2E Tests
*/
test.describe("Dag Runs Tab", () => {
let dagsPage: DagsPage;

const testDagId = testConfig.testDag.id;

test.beforeEach(async ({ page }) => {
Comment thread
Sahil-Shadwal marked this conversation as resolved.
Outdated
dagsPage = new DagsPage(page);
await dagsPage.triggerDag(testDagId);
});

test("should navigate to Runs tab and display correctly", async () => {
Comment thread
Sahil-Shadwal marked this conversation as resolved.
Outdated
await dagsPage.navigateToRunsTab(testDagId);

// Verify runs table is displayed
await dagsPage.verifyRunsTabDisplayed();

// Verify we can see run details
const runs = await dagsPage.getRunDetails();

expect(runs.length).toBeGreaterThan(0);
});

test("should verify run details are displayed correctly", async () => {
Comment thread
Sahil-Shadwal marked this conversation as resolved.
Outdated
await dagsPage.navigateToRunsTab(testDagId);

const runs = await dagsPage.getRunDetails();

expect(runs.length).toBeGreaterThan(0);
Comment thread
Sahil-Shadwal marked this conversation as resolved.
Outdated

// Verify first run has required fields
const [firstRun] = runs;

expect(firstRun.runId).toBeTruthy();
expect(firstRun.state).toBeTruthy();
});

test("should click run and navigate to details page", async () => {
Comment thread
Sahil-Shadwal marked this conversation as resolved.
Outdated
await dagsPage.navigateToRunsTab(testDagId);

const runs = await dagsPage.getRunDetails();

expect(runs.length).toBeGreaterThan(0);

const [firstRun] = runs;

await dagsPage.clickRun(firstRun.runId);

// Verify we're on the run details page
await dagsPage.verifyRunDetailsPage(firstRun.runId);
});

test("should filter runs by state", async () => {
Comment thread
Sahil-Shadwal marked this conversation as resolved.
Outdated
await dagsPage.navigateToRunsTab(testDagId);

const runs = await dagsPage.getRunDetails();

expect(runs.length).toBeGreaterThan(0);

const [firstRun] = runs;

if (firstRun === undefined) {
throw new Error("No runs found");
}

const targetState = firstRun.state;

await dagsPage.filterByState(targetState);

const filteredRuns = await dagsPage.getRunDetails();

expect(filteredRuns.length).toBeGreaterThan(0);
expect(filteredRuns.every((run) => run.state === targetState)).toBeTruthy();
});

test("should search runs", async () => {
Comment thread
Sahil-Shadwal marked this conversation as resolved.
Outdated
await dagsPage.navigateToRunsTab(testDagId);

const runs = await dagsPage.getRunDetails();

expect(runs.length).toBeGreaterThan(0);

const [firstRun] = runs;

if (firstRun === undefined) {
throw new Error("No runs found");
}

const targetRunId = firstRun.runId;

await dagsPage.searchRun(targetRunId);

const searchedRuns = await dagsPage.getRunDetails();

expect(searchedRuns.length).toBeGreaterThan(0);
const [firstSearchedRun] = searchedRuns;

if (firstSearchedRun === undefined) {
throw new Error("No searched runs found");
}

expect(firstSearchedRun.runId).toContain(targetRunId);
});

test("should verify pagination works on the Runs tab", async () => {
Comment thread
Sahil-Shadwal marked this conversation as resolved.
Outdated
await dagsPage.navigateToRunsTab(testDagId);

await expect(dagsPage.paginationNextButton).toBeVisible();
await expect(dagsPage.paginationPrevButton).toBeVisible();

const initialRuns = await dagsPage.getRunDetails();

expect(initialRuns.length).toBeGreaterThan(0);

// Check if next button is enabled (has more than one page)
const isNextEnabled = await dagsPage.paginationNextButton.isEnabled();

if (!isNextEnabled) {
Comment thread
Sahil-Shadwal marked this conversation as resolved.
Outdated
test.skip(true, "Pagination skipped because not enough runs");
}

await dagsPage.clickNextPage();

const runsAfterNext = await dagsPage.getRunDetails();

expect(runsAfterNext.length).toBeGreaterThan(0);
// Verify we got different runs
expect(runsAfterNext[0].runId).not.toEqual(initialRuns[0].runId);

await dagsPage.clickPrevPage();

const runsAfterPrev = await dagsPage.getRunDetails();

expect(runsAfterPrev[0].runId).toEqual(initialRuns[0].runId);
});
});
Loading