Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: improve robustness of Playwright tests #7139

Draft
wants to merge 14 commits into
base: master
Choose a base branch
from

Conversation

Parsium
Copy link
Contributor

@Parsium Parsium commented Dec 19, 2024

Proposed behaviour

Updated Playwright tests for the following Carbon components to enhance reliability:

  • Date
  • DialogFullscreen
  • Portal
  • SimpleSelect
  • FilterableSelect
  • MultiSelect
  • SimpleColorPicker
  • TextEditor
  • Toast

Key changes made:

  1. Migrate tests asserting event callbacks to Jest - this mitigates flakiness by utilising Jest's better-suited tools for verifying function calls.
  2. Wait for element appearance/disappearance - use waitFor() or explicit assertions that check for element appearance/disappearance at critical moments. Ensures UI has reached the expected state before the test proceeds, minimising the risk of flakiness due to synchronisation issues.

Current behaviour

A collection of Playwright tests have a high flakiness rate. This reduces overall reliability of the test suite, and increases development time.

Checklist

  • Commits follow our style guide
  • Related issues linked in commit messages if required
  • Screenshots are included in the PR if useful
  • All themes are supported if required
  • Unit tests added or updated if required
  • Playwright automation tests added or updated if required
  • Storybook added or updated if required
  • Translations added or updated (including creating or amending translation keys table in storybook) if required
  • Typescript d.ts file added or updated if required
  • Related docs have been updated if required

QA

  • Tested in provided StackBlitz sandbox/Storybook
  • Add new Playwright test coverage if required
  • Carbon implementation matches Design System/designs
  • UI Tests GitHub check reviewed if required

Additional context

Testing instructions

@Parsium Parsium self-assigned this Dec 19, 2024
…aviour

Removed tests focused on the lazy loading behaviour managed by the test wrapper. This behaviour
is not a built-in feature of `FilterableSelect` so the tests did not reflect its out-of-box
functionality. The test suite now focuses on verifying `FilterableSelect`'s native behaviour
based on its props and interactions with its rendered UI.
Removed tests focused on the lazy loading behaviour managed by the test wrapper. This behaviour
is not a built-in feature of `MultiSelect` so the tests did not reflect its out-of-box
functionality. The test suite now focuses on verifying `MultiSelect`'s native behaviour
based on its props and interactions with its rendered UI.
Removed tests focused on the lazy loading behaviour managed by the test wrapper. This behaviour
is not a built-in feature of `SimpleSelect` so the tests did not reflect its out-of-box
functionality. The test suite now focuses on verifying `SimpleSelect`'s native behaviour
based on its props and interactions with its rendered UI.
@Parsium Parsium force-pushed the improving-pw-performance branch from 40d7dd5 to 1c5cd32 Compare December 19, 2024 16:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant