test: add a test for leading and trailing spaces (#11156)

This commit is contained in:
Pavel Feldman 2022-01-03 12:51:58 -08:00 committed by GitHub
parent 4106274f6b
commit 38801a3b85
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -404,3 +404,10 @@ it('should match root after >> with *', async ({ page }) => {
await page.setContent(`<button> hello world </button> <button> hellow <span> world </span> </button>`);
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(`<button> Add widget </button>`);
await expect(page.locator('text=Add widget')).toBeVisible();
await expect(page.locator('text= Add widget ')).toBeVisible();
});