From 67d5c13d654350f69d1594e5523cff43de7917f2 Mon Sep 17 00:00:00 2001 From: Yury Semikhatsky Date: Fri, 26 Aug 2022 17:39:33 -0700 Subject: [PATCH] test: text selector with double quotes (#16865) --- tests/page/selectors-text.spec.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/page/selectors-text.spec.ts b/tests/page/selectors-text.spec.ts index 5975e5cdc2..cebb004e02 100644 --- a/tests/page/selectors-text.spec.ts +++ b/tests/page/selectors-text.spec.ts @@ -439,3 +439,15 @@ it('should work with unpaired quotes when not at the start', async ({ page }) => expect(await page.$(`text=" >> span`)).toBe(null); expect(await page.$(`text=\` >> span`)).toBe(null); }); + +it('should work with paired quotes in the middle of selector', async ({ page }) => { + it.info().annotations.push({ type: 'issue', description: 'https://github.com/microsoft/playwright/issues/16858' }); + it.fail(); + await page.setContent(`
pattern "^-?\\d+$"
`); + expect(await page.locator(`div >> text=pattern "^-?\\d+$`).isVisible()); + expect(await page.locator(`div >> text=pattern "^-?\\d+$"`).isVisible()); + expect(await page.locator(`div >> text='pattern "^-?\\d+$"'`).isVisible()); + await expect(page.locator(`div >> text=pattern "^-?\\d+$`)).toBeVisible(); + await expect(page.locator(`div >> text=pattern "^-?\\d+$"`)).toBeVisible(); + await expect(page.locator(`div >> text='pattern "^-?\\d+$"'`)).toBeVisible(); +});