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

fix(expect): adjust normalization for regex values in toHaveText matcher #33533

Merged
merged 3 commits into from
Nov 12, 2024

Conversation

pengooseDev
Copy link
Contributor

Fixes #29382

  1. The current issue occurs in the toEqual call when the expected type in toHaveText is (string | RegExp)[]. Since we cannot modify the external dependency this.utils.printDiffOrStringify, normalization is performed before invoking it.
  2. As a precaution, I checked the toMatchText method, which handles cases where the type is string | RegExp, to ensure that regex values are processed correctly. Regression tests confirmed that no issues are present.

@pengooseDev pengooseDev changed the title fix: adjust normalization for regex values in toHaveText matcher fix(expect): adjust normalization for regex values in toHaveText matcher Nov 10, 2024

This comment has been minimized.

This comment has been minimized.

packages/playwright/src/matchers/toEqual.ts Outdated Show resolved Hide resolved
Copy link
Contributor

Test results for "tests 1"

1 failed
❌ [playwright-test] › playwright.artifacts.spec.ts:167:5 › should work with screenshot: only-on-failure @windows-latest-node18-1

3 flaky ⚠️ [playwright-test] › ui-mode-test-output.spec.ts:80:5 › should show console messages for test @macos-latest-node18-1
⚠️ [chromium-library] › library/proxy.spec.ts:93:11 › should proxy local network requests › with other bypasses › loopback address @ubuntu-20.04-chromium-tip-of-tree
⚠️ [playwright-test] › ui-mode-test-watch.spec.ts:145:5 › should watch all @windows-latest-node18-1

36902 passed, 690 skipped
✔️✔️✔️

Merge workflow run.

@yury-s yury-s merged commit a501232 into microsoft:main Nov 12, 2024
28 of 29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants