Skip to content

Improve Playwright test patterns in providers.spec.ts#64078

Open
hussain-s wants to merge 3 commits intoapache:mainfrom
hussain-s:issue-63431-providers-playwright-patterns
Open

Improve Playwright test patterns in providers.spec.ts#64078
hussain-s wants to merge 3 commits intoapache:mainfrom
hussain-s:issue-63431-providers-playwright-patterns

Conversation

@hussain-s
Copy link

Summary

Improve Playwright test patterns in providers.spec.ts and ProvidersPage.ts without changing test coverage or behavior.

What changed

  • replaced DOM-query based waiting with locator-based readiness checks
  • moved Admin menu navigation into the page object
  • replaced manual row-count and string assertions with web-first Playwright assertions
  • kept the existing providers test coverage intact

Validation

  • pnpm exec eslint tests/e2e/specs/providers.spec.ts tests/e2e/pages/ProvidersPage.ts
  • pnpm exec tsc --noEmit -p tsconfig.app.json
  • TEST_USERNAME=admin TEST_PASSWORD=admin AIRFLOW_UI_BASE_URL=http://localhost:28080 pnpm exec playwright test tests/e2e/specs/providers.spec.ts --project=chromium

Relates to #63431

@boring-cyborg
Copy link

boring-cyborg bot commented Mar 22, 2026

Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contributors' Guide (https://github.com/apache/airflow/blob/main/contributing-docs/README.rst)
Here are some useful points:

  • Pay attention to the quality of your code (ruff, mypy and type annotations). Our prek-hooks will help you with that.
  • In case of a new feature add useful documentation (in docstrings or in docs/ directory). Adding a new operator? Check this short guide Consider adding an example DAG that shows how users should use it.
  • Consider using Breeze environment for testing locally, it's a heavy docker but it ships with a working Airflow and a lot of integrations.
  • Be patient and persistent. It might take some time to get a review or get the final approval from Committers.
  • Please follow ASF Code of Conduct for all communication including (but not limited to) comments on Pull Requests, Mailing list and Slack.
  • Be sure to read the Airflow Coding style.
  • Always keep your Pull Requests rebased, otherwise your build might fail due to changes not related to your commits.
    Apache Airflow is a community-driven project and together we are making it better 🚀.
    In case of doubts contact the developers at:
    Mailing List: dev@airflow.apache.org
    Slack: https://s.apache.org/airflow-slack

@boring-cyborg boring-cyborg bot added the area:UI Related to UI/UX. For Frontend Developers. label Mar 22, 2026
);
public async waitForLoad(): Promise<void> {
await expect(this.table).toBeVisible({ timeout: 30_000 });
await expect(this.rows.first()).toBeVisible({ timeout: 30_000 });
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: The original waitForTableData() specifically checked for "tbody tr td a" links to distinguish real data from skeleton rows. In this line, the check would pass as soon as it identifies ,even before the real data loads.

Copy link
Author

@hussain-s hussain-s Mar 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. I tightened waitForLoad() so it now waits for the first provider link to be visible, not just the first row shell. That keeps the readiness check tied to real table content while staying locator-based.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! 👍

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.

2 participants