Skip to content

Improve Playwright test patterns in xcoms page object #63966#65645

Merged
choo121600 merged 4 commits into
apache:mainfrom
haseebmalik18:improve-xcoms-e2e-patterns
Apr 24, 2026
Merged

Improve Playwright test patterns in xcoms page object #63966#65645
choo121600 merged 4 commits into
apache:mainfrom
haseebmalik18:improve-xcoms-e2e-patterns

Conversation

@haseebmalik18

Copy link
Copy Markdown
Contributor

Improve Playwright test patterns in XComsPage.ts to align with best practices.

  • Replace page.locator('[data-testid="..."]') with page.getByTestId()
  • Replace locator('[role="..."]') with getByRole()
  • Replace CSS filter({ hasText }) on th with getByRole("columnheader", { name })
  • Replace locator("input") with getByRole("textbox")
  • Replace manual assertions (expect(count).toBeGreaterThan(0)) with web-first assertions (await expect(rows).not.toHaveCount(0))
  • Replace textContent() manual checks with not.toHaveText("")
  • Replace page.evaluate()-style DOM queries with locator-based .or() chains
  • Extract reusable tableRows locator to reduce repetition

closes: #63966

@boring-cyborg boring-cyborg Bot added the area:UI Related to UI/UX. For Frontend Developers. label Apr 21, 2026
@potiuk potiuk added the ready for maintainer review Set after triaging when all criteria pass. label Apr 22, 2026

@choo121600 choo121600 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM, Thanks :)

@choo121600 choo121600 merged commit 93ad61e into apache:main Apr 24, 2026
81 checks passed
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. ready for maintainer review Set after triaging when all criteria pass.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

E2E: Improve Playwright test patterns in specs/xcoms.spec.ts

3 participants