choo121600 commented on code in PR #59738:
URL: https://github.com/apache/airflow/pull/59738#discussion_r2646110382


##########
airflow-core/src/airflow/ui/tests/e2e/pages/BackfillPage.ts:
##########
@@ -0,0 +1,104 @@
+/*!
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+import type { Locator, Page } from "@playwright/test";
+import { BasePage } from "tests/e2e/pages/BasePage";
+
+export class BackfillPage extends BasePage {
+  public readonly backfillBanner: Locator;
+  public readonly backfillsTab: Locator;
+  public readonly cancelButton: Locator;
+  public readonly pauseButton: Locator;
+  public readonly triggerButton: Locator;
+
+  public constructor(page: Page) {
+    super(page);
+    this.backfillBanner = page.locator('div:has-text("Backfill in progress")');
+    this.backfillsTab = page.locator('a[href*="/backfills"]');
+    this.cancelButton = page.locator('button[aria-label*="ancel"]');
+    this.pauseButton = page.locator('button[aria-label*="ause"]');
+    this.triggerButton = page.locator('button[aria-label="Trigger 
Dag"]:has-text("Trigger")');
+  }
+
+  public static getDagDetailUrl(dagName: string): string {
+    return `/dags/${dagName}`;
+  }
+
+  public async clickCancelButton(): Promise<void> {
+    await this.cancelButton.waitFor({ state: "visible", timeout: 10_000 });

Review Comment:
   ```suggestion
       await expect(this.cancelButton).toBeVisible({ timeout: 10_000 });
   ```



##########
airflow-core/src/airflow/ui/tests/e2e/pages/BackfillPage.ts:
##########
@@ -0,0 +1,104 @@
+/*!
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+import type { Locator, Page } from "@playwright/test";
+import { BasePage } from "tests/e2e/pages/BasePage";
+
+export class BackfillPage extends BasePage {
+  public readonly backfillBanner: Locator;
+  public readonly backfillsTab: Locator;
+  public readonly cancelButton: Locator;
+  public readonly pauseButton: Locator;
+  public readonly triggerButton: Locator;
+
+  public constructor(page: Page) {
+    super(page);
+    this.backfillBanner = page.locator('div:has-text("Backfill in progress")');
+    this.backfillsTab = page.locator('a[href*="/backfills"]');
+    this.cancelButton = page.locator('button[aria-label*="ancel"]');
+    this.pauseButton = page.locator('button[aria-label*="ause"]');
+    this.triggerButton = page.locator('button[aria-label="Trigger 
Dag"]:has-text("Trigger")');
+  }
+
+  public static getDagDetailUrl(dagName: string): string {
+    return `/dags/${dagName}`;
+  }
+
+  public async clickCancelButton(): Promise<void> {
+    await this.cancelButton.waitFor({ state: "visible", timeout: 10_000 });
+    await this.cancelButton.click();
+    await this.page.waitForTimeout(1000);
+  }
+
+  public async clickPauseButton(): Promise<void> {
+    await this.pauseButton.waitFor({ state: "visible", timeout: 10_000 });
+    await this.pauseButton.click();
+    await this.page.waitForTimeout(1000);
+  }
+
+  public async createBackfill(dagName: string): Promise<void> {
+    await this.navigateTo(BackfillPage.getDagDetailUrl(dagName));
+
+    await this.triggerButton.waitFor({ state: "visible", timeout: 10_000 });
+    await this.triggerButton.click();
+
+    await this.page.waitForTimeout(1000);
+
+    const dialog = this.page.locator('[role="dialog"]');
+    const backfillRadio = dialog.locator('label:has-text("Backfill")');
+
+    await backfillRadio.waitFor({ state: "visible", timeout: 10_000 });
+    await backfillRadio.click();
+
+    const fromDateInput = dialog.locator('input[name="from_date"]');
+    const toDateInput = dialog.locator('input[name="to_date"]');
+
+    await fromDateInput.fill("2024-01-01T00:00");
+    await toDateInput.fill("2024-01-02T00:00");
+
+    await this.page.waitForTimeout(2000);
+
+    const runButton = dialog.locator('button:has-text("Run Backfill")');
+
+    await runButton.click({ force: true });
+
+    await this.page.waitForTimeout(2000);
+  }
+
+  public async isBackfillPaused(): Promise<boolean> {
+    await this.pauseButton.waitFor({ state: "visible", timeout: 10_000 });

Review Comment:
   same



##########
airflow-core/src/airflow/ui/tests/e2e/pages/BackfillPage.ts:
##########
@@ -0,0 +1,104 @@
+/*!
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+import type { Locator, Page } from "@playwright/test";
+import { BasePage } from "tests/e2e/pages/BasePage";
+
+export class BackfillPage extends BasePage {
+  public readonly backfillBanner: Locator;
+  public readonly backfillsTab: Locator;
+  public readonly cancelButton: Locator;
+  public readonly pauseButton: Locator;
+  public readonly triggerButton: Locator;
+
+  public constructor(page: Page) {
+    super(page);
+    this.backfillBanner = page.locator('div:has-text("Backfill in progress")');
+    this.backfillsTab = page.locator('a[href*="/backfills"]');
+    this.cancelButton = page.locator('button[aria-label*="ancel"]');
+    this.pauseButton = page.locator('button[aria-label*="ause"]');
+    this.triggerButton = page.locator('button[aria-label="Trigger 
Dag"]:has-text("Trigger")');
+  }
+
+  public static getDagDetailUrl(dagName: string): string {
+    return `/dags/${dagName}`;
+  }
+
+  public async clickCancelButton(): Promise<void> {
+    await this.cancelButton.waitFor({ state: "visible", timeout: 10_000 });
+    await this.cancelButton.click();
+    await this.page.waitForTimeout(1000);
+  }
+
+  public async clickPauseButton(): Promise<void> {
+    await this.pauseButton.waitFor({ state: "visible", timeout: 10_000 });
+    await this.pauseButton.click();
+    await this.page.waitForTimeout(1000);
+  }
+
+  public async createBackfill(dagName: string): Promise<void> {
+    await this.navigateTo(BackfillPage.getDagDetailUrl(dagName));
+
+    await this.triggerButton.waitFor({ state: "visible", timeout: 10_000 });
+    await this.triggerButton.click();
+
+    await this.page.waitForTimeout(1000);
+
+    const dialog = this.page.locator('[role="dialog"]');
+    const backfillRadio = dialog.locator('label:has-text("Backfill")');
+
+    await backfillRadio.waitFor({ state: "visible", timeout: 10_000 });

Review Comment:
   same



##########
airflow-core/src/airflow/ui/tests/e2e/pages/BackfillPage.ts:
##########
@@ -0,0 +1,104 @@
+/*!
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+import type { Locator, Page } from "@playwright/test";
+import { BasePage } from "tests/e2e/pages/BasePage";
+
+export class BackfillPage extends BasePage {
+  public readonly backfillBanner: Locator;
+  public readonly backfillsTab: Locator;
+  public readonly cancelButton: Locator;
+  public readonly pauseButton: Locator;
+  public readonly triggerButton: Locator;
+
+  public constructor(page: Page) {
+    super(page);
+    this.backfillBanner = page.locator('div:has-text("Backfill in progress")');
+    this.backfillsTab = page.locator('a[href*="/backfills"]');
+    this.cancelButton = page.locator('button[aria-label*="ancel"]');
+    this.pauseButton = page.locator('button[aria-label*="ause"]');
+    this.triggerButton = page.locator('button[aria-label="Trigger 
Dag"]:has-text("Trigger")');
+  }
+
+  public static getDagDetailUrl(dagName: string): string {
+    return `/dags/${dagName}`;
+  }
+
+  public async clickCancelButton(): Promise<void> {
+    await this.cancelButton.waitFor({ state: "visible", timeout: 10_000 });
+    await this.cancelButton.click();
+    await this.page.waitForTimeout(1000);
+  }
+
+  public async clickPauseButton(): Promise<void> {
+    await this.pauseButton.waitFor({ state: "visible", timeout: 10_000 });
+    await this.pauseButton.click();
+    await this.page.waitForTimeout(1000);
+  }
+
+  public async createBackfill(dagName: string): Promise<void> {
+    await this.navigateTo(BackfillPage.getDagDetailUrl(dagName));
+
+    await this.triggerButton.waitFor({ state: "visible", timeout: 10_000 });

Review Comment:
   this part



##########
airflow-core/src/airflow/ui/tests/e2e/pages/BackfillPage.ts:
##########
@@ -0,0 +1,104 @@
+/*!
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+import type { Locator, Page } from "@playwright/test";
+import { BasePage } from "tests/e2e/pages/BasePage";
+
+export class BackfillPage extends BasePage {
+  public readonly backfillBanner: Locator;
+  public readonly backfillsTab: Locator;
+  public readonly cancelButton: Locator;
+  public readonly pauseButton: Locator;
+  public readonly triggerButton: Locator;
+
+  public constructor(page: Page) {
+    super(page);
+    this.backfillBanner = page.locator('div:has-text("Backfill in progress")');
+    this.backfillsTab = page.locator('a[href*="/backfills"]');
+    this.cancelButton = page.locator('button[aria-label*="ancel"]');
+    this.pauseButton = page.locator('button[aria-label*="ause"]');
+    this.triggerButton = page.locator('button[aria-label="Trigger 
Dag"]:has-text("Trigger")');
+  }
+
+  public static getDagDetailUrl(dagName: string): string {
+    return `/dags/${dagName}`;
+  }
+
+  public async clickCancelButton(): Promise<void> {
+    await this.cancelButton.waitFor({ state: "visible", timeout: 10_000 });
+    await this.cancelButton.click();
+    await this.page.waitForTimeout(1000);
+  }
+
+  public async clickPauseButton(): Promise<void> {
+    await this.pauseButton.waitFor({ state: "visible", timeout: 10_000 });
+    await this.pauseButton.click();
+    await this.page.waitForTimeout(1000);
+  }
+
+  public async createBackfill(dagName: string): Promise<void> {
+    await this.navigateTo(BackfillPage.getDagDetailUrl(dagName));
+
+    await this.triggerButton.waitFor({ state: "visible", timeout: 10_000 });
+    await this.triggerButton.click();
+
+    await this.page.waitForTimeout(1000);
+
+    const dialog = this.page.locator('[role="dialog"]');
+    const backfillRadio = dialog.locator('label:has-text("Backfill")');
+
+    await backfillRadio.waitFor({ state: "visible", timeout: 10_000 });
+    await backfillRadio.click();
+
+    const fromDateInput = dialog.locator('input[name="from_date"]');
+    const toDateInput = dialog.locator('input[name="to_date"]');
+
+    await fromDateInput.fill("2024-01-01T00:00");
+    await toDateInput.fill("2024-01-02T00:00");
+
+    await this.page.waitForTimeout(2000);
+
+    const runButton = dialog.locator('button:has-text("Run Backfill")');
+
+    await runButton.click({ force: true });
+
+    await this.page.waitForTimeout(2000);
+  }
+
+  public async isBackfillPaused(): Promise<boolean> {
+    await this.pauseButton.waitFor({ state: "visible", timeout: 10_000 });
+    const ariaLabel = await this.pauseButton.getAttribute("aria-label");
+
+    return Boolean(ariaLabel?.toLowerCase().includes("unpause"));
+  }
+
+  public async navigateToBackfillsTab(dagName: string): Promise<void> {
+    await this.navigateTo(BackfillPage.getDagDetailUrl(dagName));
+    await this.backfillsTab.waitFor({ state: "visible", timeout: 10_000 });

Review Comment:
   same



##########
airflow-core/src/airflow/ui/tests/e2e/pages/BackfillPage.ts:
##########
@@ -0,0 +1,104 @@
+/*!
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+import type { Locator, Page } from "@playwright/test";
+import { BasePage } from "tests/e2e/pages/BasePage";
+
+export class BackfillPage extends BasePage {
+  public readonly backfillBanner: Locator;
+  public readonly backfillsTab: Locator;
+  public readonly cancelButton: Locator;
+  public readonly pauseButton: Locator;
+  public readonly triggerButton: Locator;
+
+  public constructor(page: Page) {
+    super(page);
+    this.backfillBanner = page.locator('div:has-text("Backfill in progress")');
+    this.backfillsTab = page.locator('a[href*="/backfills"]');
+    this.cancelButton = page.locator('button[aria-label*="ancel"]');
+    this.pauseButton = page.locator('button[aria-label*="ause"]');
+    this.triggerButton = page.locator('button[aria-label="Trigger 
Dag"]:has-text("Trigger")');
+  }
+
+  public static getDagDetailUrl(dagName: string): string {
+    return `/dags/${dagName}`;
+  }
+
+  public async clickCancelButton(): Promise<void> {
+    await this.cancelButton.waitFor({ state: "visible", timeout: 10_000 });
+    await this.cancelButton.click();
+    await this.page.waitForTimeout(1000);
+  }
+
+  public async clickPauseButton(): Promise<void> {
+    await this.pauseButton.waitFor({ state: "visible", timeout: 10_000 });
+    await this.pauseButton.click();
+    await this.page.waitForTimeout(1000);
+  }
+
+  public async createBackfill(dagName: string): Promise<void> {
+    await this.navigateTo(BackfillPage.getDagDetailUrl(dagName));
+
+    await this.triggerButton.waitFor({ state: "visible", timeout: 10_000 });
+    await this.triggerButton.click();
+
+    await this.page.waitForTimeout(1000);
+
+    const dialog = this.page.locator('[role="dialog"]');
+    const backfillRadio = dialog.locator('label:has-text("Backfill")');
+
+    await backfillRadio.waitFor({ state: "visible", timeout: 10_000 });
+    await backfillRadio.click();
+
+    const fromDateInput = dialog.locator('input[name="from_date"]');
+    const toDateInput = dialog.locator('input[name="to_date"]');
+
+    await fromDateInput.fill("2024-01-01T00:00");
+    await toDateInput.fill("2024-01-02T00:00");
+
+    await this.page.waitForTimeout(2000);
+
+    const runButton = dialog.locator('button:has-text("Run Backfill")');
+
+    await runButton.click({ force: true });
+
+    await this.page.waitForTimeout(2000);
+  }
+
+  public async isBackfillPaused(): Promise<boolean> {
+    await this.pauseButton.waitFor({ state: "visible", timeout: 10_000 });
+    const ariaLabel = await this.pauseButton.getAttribute("aria-label");
+
+    return Boolean(ariaLabel?.toLowerCase().includes("unpause"));
+  }
+
+  public async navigateToBackfillsTab(dagName: string): Promise<void> {
+    await this.navigateTo(BackfillPage.getDagDetailUrl(dagName));
+    await this.backfillsTab.waitFor({ state: "visible", timeout: 10_000 });
+    await this.backfillsTab.click();
+    await this.waitForPageLoad();
+  }
+
+  public async navigateToDagDetail(dagName: string): Promise<void> {
+    await this.navigateTo(BackfillPage.getDagDetailUrl(dagName));
+  }
+
+  public async waitForBackfillCompletion(timeout: number = 30_000): 
Promise<void> {
+    await this.backfillBanner.waitFor({ state: "hidden", timeout });

Review Comment:
   same



##########
airflow-core/src/airflow/ui/tests/e2e/pages/BackfillPage.ts:
##########
@@ -0,0 +1,104 @@
+/*!
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+import type { Locator, Page } from "@playwright/test";
+import { BasePage } from "tests/e2e/pages/BasePage";
+
+export class BackfillPage extends BasePage {
+  public readonly backfillBanner: Locator;
+  public readonly backfillsTab: Locator;
+  public readonly cancelButton: Locator;
+  public readonly pauseButton: Locator;
+  public readonly triggerButton: Locator;
+
+  public constructor(page: Page) {
+    super(page);
+    this.backfillBanner = page.locator('div:has-text("Backfill in progress")');
+    this.backfillsTab = page.locator('a[href*="/backfills"]');
+    this.cancelButton = page.locator('button[aria-label*="ancel"]');
+    this.pauseButton = page.locator('button[aria-label*="ause"]');
+    this.triggerButton = page.locator('button[aria-label="Trigger 
Dag"]:has-text("Trigger")');
+  }
+
+  public static getDagDetailUrl(dagName: string): string {
+    return `/dags/${dagName}`;
+  }
+
+  public async clickCancelButton(): Promise<void> {
+    await this.cancelButton.waitFor({ state: "visible", timeout: 10_000 });
+    await this.cancelButton.click();
+    await this.page.waitForTimeout(1000);
+  }
+
+  public async clickPauseButton(): Promise<void> {
+    await this.pauseButton.waitFor({ state: "visible", timeout: 10_000 });

Review Comment:
   this



##########
airflow-core/src/airflow/ui/tests/e2e/pages/BackfillPage.ts:
##########
@@ -0,0 +1,104 @@
+/*!
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+import type { Locator, Page } from "@playwright/test";
+import { BasePage } from "tests/e2e/pages/BasePage";
+
+export class BackfillPage extends BasePage {
+  public readonly backfillBanner: Locator;
+  public readonly backfillsTab: Locator;
+  public readonly cancelButton: Locator;
+  public readonly pauseButton: Locator;
+  public readonly triggerButton: Locator;
+
+  public constructor(page: Page) {
+    super(page);
+    this.backfillBanner = page.locator('div:has-text("Backfill in progress")');
+    this.backfillsTab = page.locator('a[href*="/backfills"]');
+    this.cancelButton = page.locator('button[aria-label*="ancel"]');
+    this.pauseButton = page.locator('button[aria-label*="ause"]');
+    this.triggerButton = page.locator('button[aria-label="Trigger 
Dag"]:has-text("Trigger")');
+  }
+
+  public static getDagDetailUrl(dagName: string): string {
+    return `/dags/${dagName}`;
+  }
+
+  public async clickCancelButton(): Promise<void> {
+    await this.cancelButton.waitFor({ state: "visible", timeout: 10_000 });

Review Comment:
   This can be updated accordingly.
   Please update the remaining parts.



-- 
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]

Reply via email to