Skip to content

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.

test: content that does not work without useInnerText (#13781)

Yury Semikhatsky5588defa22fb
diff --git a/tests/playwright-test/playwright.expect.text.spec.ts b/tests/playwright-test/playwright.expect.text.spec.ts
index 859b651cce..c110becb69 100644
--- a/tests/playwright-test/playwright.expect.text.spec.ts
+++ b/tests/playwright-test/playwright.expect.text.spec.ts
@@ -272,7 +272,7 @@ test('should support toHaveText with innerText', async ({ runInlineTest }) => {
const { test } = pwt;
test('pass', async ({ page }) => {
- await page.setContent('<div id=node>Text content</div>');
+ await page.setContent('<div id=node>Text <span hidden>garbage</span> content</div>');
const locator = page.locator('#node');
await expect(locator).toHaveText('Text content', { useInnerText: true });
});