diff --git a/tests/page/page-request-continue.spec.ts b/tests/page/page-request-continue.spec.ts index 457f3f972d..81aae9f9cb 100644 --- a/tests/page/page-request-continue.spec.ts +++ b/tests/page/page-request-continue.spec.ts @@ -374,3 +374,38 @@ it('should continue preload link requests', async ({ page, server, browserName } const color = await page.evaluate(() => window.getComputedStyle(document.body).backgroundColor); expect(color).toBe('rgb(255, 192, 203)'); }); + +it('should intercept css variable with background url', async ({ page, server, browserName }) => { + it.fixme(browserName === 'webkit'); + it.info().annotations.push({ type: 'issue', description: 'https://github.com/microsoft/playwright/issues/19158' }); + + server.setRoute('/test.html', (request, response) => { + response.setHeader('Content-Type', 'text/html'); + response.end(` + +
Yo!
`); + }); + let interceptCallback; + const interceptPromise = new Promise(f => interceptCallback = f); + let interceptedRequests = 0; + await page.route(server.PREFIX + '/pptr.png', async (route, request) => { + ++interceptedRequests; + interceptCallback(); + route.continue(); + }); + await page.goto(server.PREFIX + '/test.html'); + expect(await page.locator('div').textContent()).toBe('Yo!'); + await interceptPromise; + await page.waitForTimeout(1000); + expect(interceptedRequests).toBe(1); +});