test: eval promise with disabled javascript (#9552)

This commit is contained in:
Yury Semikhatsky 2021-10-15 17:00:31 -07:00 committed by GitHub
parent 811d02dbe8
commit 8397fac178
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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();