Skip to content

feat: Add E2E tests for Task Instances page#60514

Merged
vatsrahul1001 merged 9 commits intoapache:mainfrom
lin121291:ui/e2e-task-instances-tests
Feb 5, 2026
Merged

feat: Add E2E tests for Task Instances page#60514
vatsrahul1001 merged 9 commits intoapache:mainfrom
lin121291:ui/e2e-task-instances-tests

Conversation

@lin121291
Copy link
Contributor

What change does this PR introduce?

Adds end-to-end (E2E) tests for the Task Instances page (/task_instances) to improve test coverage of the UI.

What does this PR do?

New Files:

  • airflow-core/src/airflow/ui/tests/e2e/pages/TaskInstancesPage.ts - Page Object Model for Task Instances page
  • airflow-core/src/airflow/ui/tests/e2e/specs/task-instances.spec.ts - Test specifications

Related Issues

Closes #59357

@boring-cyborg boring-cyborg bot added the area:UI Related to UI/UX. For Frontend Developers. label Jan 14, 2026
- Use URL parameters (?task_state=) instead of UI interactions for filtering
- Simplify pagination verification using semantic button selectors
- Replace regex-based text parsing with Playwright's getByRole()
- Use or() pattern for cleaner conditional logic
@vatsrahul1001
Copy link
Contributor

Thanks, @lin121291 for implementing review comments. I suggest resolving comments after you are done. I will review this soon

@vatsrahul1001
Copy link
Contributor

vatsrahul1001 commented Jan 26, 2026

Pagination needs to follow the established pattern from PR #59400:

The current implementation differs from our merged pagination tests. Please reference:

  1. Use [data-testid="next/prev"] buttons instead of page numbers:
    // Current (incorrect)
    const page2Button = this.page.getByRole("button", { name: /page 2|^2$/ });

// Reference pattern (from DagsPage.ts)
this.paginationNextButton = page.locator('[data-testid="next"]');
this.paginationPrevButton = page.locator('[data-testid="prev"]');2. Remove if (hasPage2) conditional - beforeAll ensures data exists, pagination should work.

  1. Verify data actually changed using expect.poll():
    // Reference from dags-list.spec.ts
    const initialData = await dagsPage.getDagNames();
    await dagsPage.clickNextPage();
    const dataAfterNext = await dagsPage.getDagNames();
    expect(dataAfterNext).not.toEqual(initialData); // Verifies data changed!See: Feat e2e test for Dags pagination #59400

Address review feedback from PR apache#59400:
- Use data-testid selectors instead of page numbers
- Remove conditional checks for pagination
- Verify data actually changes with expect.poll()
@lin121291
Copy link
Contributor Author

@vatsrahul1001 Fixed! Now following the DagsPage pattern from PR #59400:

  • Using data-testid="next/prev" selectors
  • Removed conditional pagination checks
  • Verifying data changes with `expect.poll()

Thanks !!

@vatsrahul1001 vatsrahul1001 merged commit 8f3ae04 into apache:main Feb 5, 2026
78 checks passed
@vatsrahul1001
Copy link
Contributor

@vatsrahul1001 Fixed! Now following the DagsPage pattern from PR #59400:

  • Using data-testid="next/prev" selectors
  • Removed conditional pagination checks
  • Verifying data changes with `expect.poll()

Thanks !!

Nice!

Alok-kumar-priyadarshi pushed a commit to Alok-kumar-priyadarshi/airflow that referenced this pull request Feb 5, 2026
* feat: Add E2E tests for Task Instances page

Co-authored-by: Rahul Vats <[email protected]>
jhgoebbert pushed a commit to jhgoebbert/airflow_Owen-CH-Leung that referenced this pull request Feb 8, 2026
* feat: Add E2E tests for Task Instances page

Co-authored-by: Rahul Vats <[email protected]>
Ratasa143 pushed a commit to Ratasa143/airflow that referenced this pull request Feb 15, 2026
* feat: Add E2E tests for Task Instances page

Co-authored-by: Rahul Vats <[email protected]>
choo121600 pushed a commit to choo121600/airflow that referenced this pull request Feb 22, 2026
* feat: Add E2E tests for Task Instances page

Co-authored-by: Rahul Vats <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:UI Related to UI/UX. For Frontend Developers.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

UI E2E Test || TASKS-001: Verify all task instances display

2 participants