From 8397fac178ef6ce1416339b715974f67d029cbfd Mon Sep 17 00:00:00 2001 From: Yury Semikhatsky Date: Fri, 15 Oct 2021 17:00:31 -0700 Subject: [PATCH] test: eval promise with disabled javascript (#9552) --- tests/browsercontext-basic.spec.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/browsercontext-basic.spec.ts b/tests/browsercontext-basic.spec.ts index d4dd082c2c..7975dafd76 100644 --- a/tests/browsercontext-basic.spec.ts +++ b/tests/browsercontext-basic.spec.ts @@ -218,6 +218,14 @@ it('should be able to navigate after disabling javascript', async ({ browser, se await context.close(); }); +it('should not hang on promises after disabling javascript', async ({ browserName, contextFactory }) => { + it.fixme(browserName === 'webkit' || browserName === 'firefox'); + const context = await contextFactory({ javaScriptEnabled: false }); + const page = await context.newPage(); + expect(await page.evaluate(() => 1)).toBe(1); + expect(await page.evaluate(async () => 2)).toBe(2); +}); + it('should work with offline option', async ({ browser, server }) => { const context = await browser.newContext({ offline: true }); const page = await context.newPage();