From 38801a3b8524b08b37a251bece318e7d68188bf7 Mon Sep 17 00:00:00 2001 From: Pavel Feldman Date: Mon, 3 Jan 2022 12:51:58 -0800 Subject: [PATCH] test: add a test for leading and trailing spaces (#11156) --- tests/page/selectors-text.spec.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/page/selectors-text.spec.ts b/tests/page/selectors-text.spec.ts index e57d4550be..e0c1e6547a 100644 --- a/tests/page/selectors-text.spec.ts +++ b/tests/page/selectors-text.spec.ts @@ -404,3 +404,10 @@ it('should match root after >> with *', async ({ page }) => { await page.setContent(` `); expect(await page.$$eval('*css=button >> text=hello >> text=world', els => els.length)).toBe(2); }); + +it('should work with leading and trailing spaces', async ({ page }) => { + it.info().annotations.push({ type: 'issue', description: 'https://github.com/microsoft/playwright/issues/10997' }); + await page.setContent(``); + await expect(page.locator('text=Add widget')).toBeVisible(); + await expect(page.locator('text= Add widget ')).toBeVisible(); +});