Repository: apache/airflow
File: airflow-core/src/airflow/ui/tests/e2e/specs/dag-tasks.spec.ts (TypeScript)

Code before:
  const testDagId = testConfig.testDag.id;
  
  test.beforeAll(async ({ browser }) => {
    test.setTimeout(5 * 60 * 1000);
    
    const context = await browser.newContext({ storageState: AUTH_FILE });
    const page = await context.newPage();
    const dagPage = new DagsPage(page);
    await dagPage.triggerDag(testDagId);
    await dagPage.verifyDagRunStatus(testDagId, "success");
    
    await context.close();
  });
  test("should navigate to tasks tab and show list", async ({ page }) => {
    const dagPage = new DagsPage(page);

    await dagPage.navigateToDagTasks(DAG_ID);

    await expect(dagPage.tasksTab).toHaveAttribute("class", "active");
    await expect(dagPage.taskCards.first()).toBeVisible();
  });

  test("should search tasks by name", async ({ page }) => {
    const dagPage = new DagsPage(page);

    await dagPage.navigateToDagTasks(DAG_ID);

    await dagPage.searchBox.fill("runme_0");

    // Wait for filter to apply
    await expect(dagPage.taskCards).toHaveCount(1);
    await expect(dagPage.taskCards).toContainText("runme_0");
  });

  test("should filter tasks by operator", async ({ page }) => {
    const dagPage = new DagsPage(page);

    await dagPage.navigateToDagTasks(DAG_ID);

    await dagPage.filterByOperator("BashOperator");

    await expect(dagPage.taskCards.first()).toBeVisible();
    await expect(dagPage.taskCards.first()).toContainText("BashOperator");
  });

  test("should filter tasks by trigger rule", async ({ page }) => {
    const dagPage = new DagsPage(page);

    await dagPage.navigateToDagTasks(DAG_ID);

    await dagPage.filterByTriggerRule("all_success");

Review comment (suggestion):
```suggestion
    await dagPage.navigateToDagTasks(testDagId);
```

Code after:

  test.beforeAll(async ({ browser }) => {
    test.setTimeout(7 * 60 * 1000);

    const context = await browser.newContext({ storageState: AUTH_FILE });
    const page = await context.newPage();
    const dagPage = new DagsPage(page);

    const dagRunId = await dagPage.triggerDag(testDagId);

    await dagPage.verifyDagRunStatus(testDagId, dagRunId);

    await context.close();
  });
  test("verify tasks tab displays task list", async ({ page }) => {
    const dagPage = new DagsPage(page);

    await dagPage.navigateToDagTasks(testDagId);

    await expect(page).toHaveURL(/\/tasks$/);
    await expect(dagPage.taskCards.first()).toBeVisible();

    const firstCard = dagPage.taskCards.first();

    await expect(firstCard.locator("a").first()).toBeVisible();
    await expect(firstCard).toContainText("Operator");
    await expect(firstCard).toContainText("Trigger Rule");
    await expect(firstCard).toContainText("Last Instance");
  });

  test("verify search tasks by name", async ({ page }) => {
    const dagPage = new DagsPage(page);

    await dagPage.navigateToDagTasks(testDagId);

    const firstTaskLink = dagPage.taskCards.first().locator("a").first();
    const taskName = await firstTaskLink.textContent();

    if (taskName === null) {
      throw new Error("Task name not found");
    }

    await dagPage.searchBox.fill(taskName);

    await expect.poll(() => dagPage.taskCards.count(), { timeout: 20_000 }).toBe(1);
    await expect(dagPage.taskCards).toContainText(taskName);
  });

  test("verify filter tasks by operator dropdown", async ({ page }) => {
    const dagPage = new DagsPage(page);