I have the following test:
const specialChars = `#@<`;
for (let specialChar of specialChars) {
if (specialChar === "@") specialChar = `\@`;
test(`search special character: "${specialChar}"`, async ({ page }) => {
// test content
});
}
The problem is that Playwright consider the ' that closes the test name as tag.
I've tried to add \ before the @ like that, but it didn't help:
if (specialChar === "@") specialChar = `\@`;
Is there any way to prevent that?
I've found a solution using Unicode value \u{ff20}
(original value u+ff20
) like so:
const specialChars = `#\u{ff20}<`;
for (let specialChar of specialChars) {
test(`search special character: "${specialChar}"`, async ({ page }) => {
// test content
});
}