-
Notifications
You must be signed in to change notification settings - Fork 260
Description
π Feature Request
The hasText(String[] expected) assertion is strictly order-dependent. However, many UI components (like tags, filter chips, or list items) might appear in a non-deterministic order or the order might be irrelevant to the test case.
Example
Add a param to HasTextOptions or a new method to ignore order: hasText(String[] expected, boolean ignoreOrder) or hasTextInAnyOrder(String[] expected).
Motivation
Resilience to Change: Tests won't fail due to minor UI sorting changes that do not affect business logic.
Cleaner Test Code: Developers won't need to manually fetch, sort, and compare lists, which often bypasses Playwright's automatic retries.
Implementation: This can be implemented by internally sorting both the actual and expected collections before comparison when the flag is set.