-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
[Feature]: Make sure the .toMatchAriaSnapshot() error log function understand the difference between "this text" and "thisNBSPtext" #34153
Labels
Comments
Can you share complete test where it reproduces? I tried to create one below based on the html snippet you provided, but it does pass: import { test, expect } from '@playwright/test';
test('test', async ({ page }) => {
await page.setContent(`<span class="label__text">E-mailadres<span class="label__required-text"> (<!-- -->verplicht<!-- -->)</span></span>`);
await expect(page.locator('body')).toMatchAriaSnapshot(`- text: E-mailadres (verplicht)`);
});``` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
🚀 Feature Request
At this moment if you don't use NBSP in the test while it's used in the HTML (because you didn't use playwright codegen but just type it as you see the tekst on the screen), it's not clear from the error log what is wrong with your test (also see Test fails example below)
So if it would be possible, please make sure the error logging of
.toMatchAriaSnapshot()
understands the difference between usingNBSP
or a whitespace and show this in the logging, that would be very helpful.Example
On screen
HTML
<span class="label__text">E-mailadres<span class="label__required-text"> (<!-- -->verplicht<!-- -->)</span></span>
Test passes is you use it exactly as playwright codegen tells you to do it
Test fails it you replace the NBSP with a space
The logging is not very clear in what goes wrong
Motivation
The logging for regular functions is very clear and I love this new function, however it would be nice if the loggin in general could be better. Compared to the rest of the loggin, for this function it can feel very verbose and not clear what the actual issue is.
The text was updated successfully, but these errors were encountered: