vatsrahul1001 commented on code in PR #59738:
URL: https://github.com/apache/airflow/pull/59738#discussion_r2675622407
##########
airflow-core/src/airflow/ui/tests/e2e/specs/backfill.spec.ts:
##########
@@ -194,3 +194,55 @@ test.describe("validate date range", () => {
await expect(backfillPage.backfillDateError).toBeVisible();
});
});
+
+test.describe("Backfill pause, resume, and cancel controls", () => {
+ test.describe.configure({ mode: "serial" });
+ test.setTimeout(180_000);
+
+ const testDagId = testConfig.testDag.id;
+ const controlFromDate = getPastDate(15);
+ const controlToDate = getPastDate(14);
+
+ let backfillPage: BackfillPage;
+
+ test.beforeEach(async ({ page }) => {
+ backfillPage = new BackfillPage(page);
+
+ // Cancel any existing backfill before creating a new one
+ await backfillPage.navigateToDagDetail(testDagId);
+ try {
+ await backfillPage.clickCancelButton();
+ } catch {
+ // No active backfill to cancel
+ }
Review Comment:
Instead of empty try catch should we check visibility before clicking.
```suggestion
test.beforeEach(async ({ page }) => {
backfillPage = new BackfillPage(page);
await backfillPage.navigateToDagDetail(testDagId);
// Cancel any existing backfill if visible
if (await backfillPage.cancelButton.isVisible()) {
await backfillPage.clickCancelButton();
}
```
##########
airflow-core/src/airflow/ui/tests/e2e/specs/backfill.spec.ts:
##########
@@ -194,3 +194,55 @@ test.describe("validate date range", () => {
await expect(backfillPage.backfillDateError).toBeVisible();
});
});
+
+test.describe("Backfill pause, resume, and cancel controls", () => {
+ test.describe.configure({ mode: "serial" });
+ test.setTimeout(180_000);
+
+ const testDagId = testConfig.testDag.id;
+ const controlFromDate = getPastDate(15);
+ const controlToDate = getPastDate(14);
+
+ let backfillPage: BackfillPage;
+
+ test.beforeEach(async ({ page }) => {
+ backfillPage = new BackfillPage(page);
+
+ // Cancel any existing backfill before creating a new one
+ await backfillPage.navigateToDagDetail(testDagId);
+ try {
+ await backfillPage.clickCancelButton();
+ } catch {
+ // No active backfill to cancel
+ }
+
+ await backfillPage.createBackfill(testDagId, {
+ fromDate: controlFromDate,
+ reprocessBehavior: "All Runs",
+ toDate: controlToDate,
+ });
+
+ await backfillPage.navigateToBackfillsTab(testDagId);
+ });
+
+ test.afterEach(async () => {
+ try {
+ await backfillPage.clickCancelButton();
+ } catch {
+ }
+ });
Review Comment:
```suggestion
test.afterEach(async () => {
// Cleanup: cancel backfill if still active
if (await backfillPage.cancelButton.isVisible()) {
await backfillPage.clickCancelButton();
}
});
```
##########
airflow-core/src/airflow/ui/tests/e2e/pages/BackfillPage.ts:
##########
@@ -80,6 +83,9 @@ export class BackfillPage extends BasePage {
this.backfillRunButton = page.locator('button:has-text("Run Backfill")');
this.backfillsTable = page.locator("table");
this.backfillDateError = page.locator('text="Start Date must be before the
End Date"');
+ this.backfillBanner = page.locator('div:has-text("Backfill in progress")');
Review Comment:
Looks like we are not using backfillBanner anywhere in tests
--
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]