');
const snapshot = await page.accessibility.snapshot();
expect(snapshot.children[0].keyshortcuts).toEqual('foo');
@@ -204,12 +204,12 @@ it.skip(options.FIREFOX || options.WEBKIT)('plain text field with role should no
// WebKit rich text accessibility is iffy
await page.setContent(`
Edit this image:
`);
- const snapshot = await page.accessibility.snapshot();
- expect(snapshot.children[0]).toEqual({
- role: 'textbox',
- name: '',
- value: 'Edit this image:'
- });
+ const snapshot = await page.accessibility.snapshot();
+ expect(snapshot.children[0]).toEqual({
+ role: 'textbox',
+ name: '',
+ value: 'Edit this image:'
+ });
});
it.skip(options.FIREFOX || options.WEBKIT)('plain text field without role should not have content', async function({page}) {
@@ -289,7 +289,7 @@ it('checkbox without label should not have children', async function({page}) {
expect(snapshot.children[0]).toEqual(golden);
});
-it('should work a button', async({page}) => {
+it('should work a button', async ({page}) => {
await page.setContent(``);
const button = await page.$('button');
@@ -299,7 +299,7 @@ it('should work a button', async({page}) => {
});
});
-it('should work an input', async({page}) => {
+it('should work an input', async ({page}) => {
await page.setContent(``);
const input = await page.$('input');
@@ -310,7 +310,7 @@ it('should work an input', async({page}) => {
});
});
-it('should work on a menu', async({page}) => {
+it('should work on a menu', async ({page}) => {
await page.setContent(`
First Item
@@ -331,14 +331,14 @@ it('should work on a menu', async({page}) => {
});
});
-it('should return null when the element is no longer in DOM', async({page}) => {
+it('should return null when the element is no longer in DOM', async ({page}) => {
await page.setContent(``);
const button = await page.$('button');
await page.$eval('button', button => button.remove());
expect(await page.accessibility.snapshot({root: button})).toEqual(null);
});
-it('should show uninteresting nodes', async({page}) => {
+it('should show uninteresting nodes', async ({page}) => {
await page.setContent(`
diff --git a/test/autowaiting-basic.spec.ts b/test/autowaiting-basic.spec.ts
index 13a47a941b..b8eefe371e 100644
--- a/test/autowaiting-basic.spec.ts
+++ b/test/autowaiting-basic.spec.ts
@@ -16,7 +16,7 @@
*/
import { options } from './playwright.fixtures';
-it('should await navigation when clicking anchor', async({page, server}) => {
+it('should await navigation when clicking anchor', async ({page, server}) => {
const messages = [];
server.setRoute('/empty.html', async (req, res) => {
messages.push('route');
@@ -33,7 +33,7 @@ it('should await navigation when clicking anchor', async({page, server}) => {
expect(messages.join('|')).toBe('route|navigated|click');
});
-it('should await cross-process navigation when clicking anchor', async({page, server}) => {
+it('should await cross-process navigation when clicking anchor', async ({page, server}) => {
const messages = [];
server.setRoute('/empty.html', async (req, res) => {
messages.push('route');
@@ -50,7 +50,7 @@ it('should await cross-process navigation when clicking anchor', async({page, se
expect(messages.join('|')).toBe('route|navigated|click');
});
-it('should await form-get on click', async({page, server}) => {
+it('should await form-get on click', async ({page, server}) => {
const messages = [];
server.setRoute('/empty.html?foo=bar', async (req, res) => {
messages.push('route');
@@ -71,7 +71,7 @@ it('should await form-get on click', async({page, server}) => {
expect(messages.join('|')).toBe('route|navigated|click');
});
-it('should await form-post on click', async({page, server}) => {
+it('should await form-post on click', async ({page, server}) => {
const messages = [];
server.setRoute('/empty.html', async (req, res) => {
messages.push('route');
@@ -92,7 +92,7 @@ it('should await form-post on click', async({page, server}) => {
expect(messages.join('|')).toBe('route|navigated|click');
});
-it('should await navigation when assigning location', async({page, server}) => {
+it('should await navigation when assigning location', async ({page, server}) => {
const messages = [];
server.setRoute('/empty.html', async (req, res) => {
messages.push('route');
@@ -106,7 +106,7 @@ it('should await navigation when assigning location', async({page, server}) => {
expect(messages.join('|')).toBe('route|navigated|evaluate');
});
-it('should await navigation when assigning location twice', async({page, server}) => {
+it('should await navigation when assigning location twice', async ({page, server}) => {
const messages = [];
server.setRoute('/empty.html?cancel', async (req, res) => { res.end('done'); });
server.setRoute('/empty.html?override', async (req, res) => { messages.push('routeoverride'); res.end('done'); });
@@ -118,7 +118,7 @@ it('should await navigation when assigning location twice', async({page, server}
expect(messages.join('|')).toBe('routeoverride|evaluate');
});
-it('should await navigation when evaluating reload', async({page, server}) => {
+it('should await navigation when evaluating reload', async ({page, server}) => {
const messages = [];
await page.goto(server.EMPTY_PAGE);
server.setRoute('/empty.html', async (req, res) => {
@@ -134,7 +134,7 @@ it('should await navigation when evaluating reload', async({page, server}) => {
expect(messages.join('|')).toBe('route|navigated|evaluate');
});
-it('should await navigating specified target', async({page, server}) => {
+it('should await navigating specified target', async ({page, server}) => {
const messages = [];
server.setRoute('/empty.html', async (req, res) => {
messages.push('route');
@@ -155,19 +155,19 @@ it('should await navigating specified target', async({page, server}) => {
expect(messages.join('|')).toBe('route|navigated|click');
});
-it('should work with noWaitAfter: true', async({page, server}) => {
+it('should work with noWaitAfter: true', async ({page, server}) => {
server.setRoute('/empty.html', async () => {});
await page.setContent(`empty.html`);
await page.click('a', { noWaitAfter: true });
});
-it('should work with dblclick noWaitAfter: true', async({page, server}) => {
+it('should work with dblclick noWaitAfter: true', async ({page, server}) => {
server.setRoute('/empty.html', async () => {});
await page.setContent(`empty.html`);
await page.dblclick('a', { noWaitAfter: true });
});
-it('should work with waitForLoadState(load)', async({page, server}) => {
+it('should work with waitForLoadState(load)', async ({page, server}) => {
const messages = [];
server.setRoute('/empty.html', async (req, res) => {
messages.push('route');
@@ -183,7 +183,7 @@ it('should work with waitForLoadState(load)', async({page, server}) => {
expect(messages.join('|')).toBe('route|domcontentloaded|clickload');
});
-it('should work with goto following click', async({page, server}) => {
+it('should work with goto following click', async ({page, server}) => {
server.setRoute('/login.html', async (req, res) => {
res.setHeader('Content-Type', 'text/html');
res.end(`You are logged in`);
@@ -200,7 +200,7 @@ it('should work with goto following click', async({page, server}) => {
await page.goto(server.EMPTY_PAGE);
});
-it.skip(options.WIRE)('should report navigation in the log when clicking anchor', async({page, server}) => {
+it.skip(options.WIRE)('should report navigation in the log when clicking anchor', async ({page, server}) => {
await page.setContent(`click me`);
const __testHookAfterPointerAction = () => new Promise(f => setTimeout(f, 6000));
const error = await page.click('a', { timeout: 5000, __testHookAfterPointerAction } as any).catch(e => e);
diff --git a/test/autowaiting-no-hang.spec.ts b/test/autowaiting-no-hang.spec.ts
index 10d1a964de..d2b5f57a09 100644
--- a/test/autowaiting-no-hang.spec.ts
+++ b/test/autowaiting-no-hang.spec.ts
@@ -16,33 +16,33 @@
*/
import './playwright.fixtures';
-it('clicking on links which do not commit navigation', async({page, server, httpsServer}) => {
+it('clicking on links which do not commit navigation', async ({page, server, httpsServer}) => {
await page.goto(server.EMPTY_PAGE);
await page.setContent(`foobar`);
await page.click('a');
});
-it('calling window.stop async', async({page, server}) => {
+it('calling window.stop async', async ({page, server}) => {
server.setRoute('/empty.html', async (req, res) => {});
- await page.evaluate((url) => {
- window.location.href = url;
- setTimeout(() => window.stop(), 100);
- }, server.EMPTY_PAGE);
+ await page.evaluate(url => {
+ window.location.href = url;
+ setTimeout(() => window.stop(), 100);
+ }, server.EMPTY_PAGE);
});
-it('calling window.stop sync', async({page, server}) => {
- await page.evaluate((url) => {
- window.location.href = url;
- window.stop();
- }, server.EMPTY_PAGE);
+it('calling window.stop sync', async ({page, server}) => {
+ await page.evaluate(url => {
+ window.location.href = url;
+ window.stop();
+ }, server.EMPTY_PAGE);
});
-it('assigning location to about:blank', async({page, server}) => {
+it('assigning location to about:blank', async ({page, server}) => {
await page.goto(server.EMPTY_PAGE);
await page.evaluate(`window.location.href = "about:blank";`);
});
-it('assigning location to about:blank after non-about:blank', async({page, server}) => {
+it('assigning location to about:blank after non-about:blank', async ({page, server}) => {
server.setRoute('/empty.html', async (req, res) => {});
await page.evaluate(`
window.location.href = "${server.EMPTY_PAGE}";
diff --git a/test/browsercontext-add-cookies.spec.ts b/test/browsercontext-add-cookies.spec.ts
index 750f5a7566..990f121099 100644
--- a/test/browsercontext-add-cookies.spec.ts
+++ b/test/browsercontext-add-cookies.spec.ts
@@ -16,7 +16,7 @@
*/
import { options } from './playwright.fixtures';
-it('should work', async({context, page, server}) => {
+it('should work', async ({context, page, server}) => {
await page.goto(server.EMPTY_PAGE);
await context.addCookies([{
url: server.EMPTY_PAGE,
@@ -26,7 +26,7 @@ it('should work', async({context, page, server}) => {
expect(await page.evaluate(() => document.cookie)).toEqual('password=123456');
});
-it('should roundtrip cookie', async({context, page, server}) => {
+it('should roundtrip cookie', async ({context, page, server}) => {
await page.goto(server.EMPTY_PAGE);
// @see https://en.wikipedia.org/wiki/Year_2038_problem
const date = +(new Date('1/1/2038'));
@@ -43,7 +43,7 @@ it('should roundtrip cookie', async({context, page, server}) => {
expect(await context.cookies()).toEqual(cookies);
});
-it('should send cookie header', async({server, context}) => {
+it('should send cookie header', async ({server, context}) => {
let cookie = '';
server.setRoute('/empty.html', (req, res) => {
cookie = req.headers.cookie;
@@ -55,7 +55,7 @@ it('should send cookie header', async({server, context}) => {
expect(cookie).toBe('cookie=value');
});
-it('should isolate cookies in browser contexts', async({context, server, browser}) => {
+it('should isolate cookies in browser contexts', async ({context, server, browser}) => {
const anotherContext = await browser.newContext();
await context.addCookies([{url: server.EMPTY_PAGE, name: 'isolatecookie', value: 'page1value'}]);
await anotherContext.addCookies([{url: server.EMPTY_PAGE, name: 'isolatecookie', value: 'page2value'}]);
@@ -71,7 +71,7 @@ it('should isolate cookies in browser contexts', async({context, server, browser
await anotherContext.close();
});
-it('should isolate session cookies', async({context, server, browser}) => {
+it('should isolate session cookies', async ({context, server, browser}) => {
server.setRoute('/setcookie.html', (req, res) => {
res.setHeader('Set-Cookie', 'session=value');
res.end();
@@ -97,7 +97,7 @@ it('should isolate session cookies', async({context, server, browser}) => {
}
});
-it('should isolate persistent cookies', async({context, server, browser}) => {
+it('should isolate persistent cookies', async ({context, server, browser}) => {
server.setRoute('/setcookie.html', (req, res) => {
res.setHeader('Set-Cookie', 'persistent=persistent-value; max-age=3600');
res.end();
@@ -117,7 +117,7 @@ it('should isolate persistent cookies', async({context, server, browser}) => {
await context2.close();
});
-it('should isolate send cookie header', async({server, context, browser}) => {
+it('should isolate send cookie header', async ({server, context, browser}) => {
let cookie = '';
server.setRoute('/empty.html', (req, res) => {
cookie = req.headers.cookie || '';
@@ -138,7 +138,7 @@ it('should isolate send cookie header', async({server, context, browser}) => {
}
});
-it.slow()('should isolate cookies between launches', async({browserType, server, defaultBrowserOptions}) => {
+it.slow()('should isolate cookies between launches', async ({browserType, server, defaultBrowserOptions}) => {
const browser1 = await browserType.launch(defaultBrowserOptions);
const context1 = await browser1.newContext();
await context1.addCookies([{url: server.EMPTY_PAGE, name: 'cookie-in-context-1', value: 'value', expires: Date.now() / 1000 + 10000}]);
@@ -151,7 +151,7 @@ it.slow()('should isolate cookies between launches', async({browserType, server,
await browser2.close();
});
-it('should set multiple cookies', async({context, page, server}) => {
+it('should set multiple cookies', async ({context, page, server}) => {
await page.goto(server.EMPTY_PAGE);
await context.addCookies([{
url: server.EMPTY_PAGE,
@@ -171,7 +171,7 @@ it('should set multiple cookies', async({context, page, server}) => {
]);
});
-it('should have |expires| set to |-1| for session cookies', async({context, server}) => {
+it('should have |expires| set to |-1| for session cookies', async ({context, server}) => {
await context.addCookies([{
url: server.EMPTY_PAGE,
name: 'expires',
@@ -181,7 +181,7 @@ it('should have |expires| set to |-1| for session cookies', async({context, serv
expect(cookies[0].expires).toBe(-1);
});
-it('should set cookie with reasonable defaults', async({context, server}) => {
+it('should set cookie with reasonable defaults', async ({context, server}) => {
await context.addCookies([{
url: server.EMPTY_PAGE,
name: 'defaults',
@@ -200,7 +200,7 @@ it('should set cookie with reasonable defaults', async({context, server}) => {
}]);
});
-it('should set a cookie with a path', async({context, page, server}) => {
+it('should set a cookie with a path', async ({context, page, server}) => {
await page.goto(server.PREFIX + '/grid.html');
await context.addCookies([{
domain: 'localhost',
@@ -229,8 +229,8 @@ it('should not set a cookie with blank page URL', async function({context, serve
let error = null;
try {
await context.addCookies([
- {url: server.EMPTY_PAGE, name: 'example-cookie', value: 'best'},
- {url: 'about:blank', name: 'example-cookie-blank', value: 'best'}
+ {url: server.EMPTY_PAGE, name: 'example-cookie', value: 'best'},
+ {url: 'about:blank', name: 'example-cookie-blank', value: 'best'}
]);
} catch (e) {
error = e;
@@ -250,7 +250,7 @@ it('should not set a cookie on a data URL page', async function({context}) {
expect(error.message).toContain('Data URL page can not have cookie "example-cookie"');
});
-it('should default to setting secure cookie for HTTPS websites', async({context, page, server}) => {
+it('should default to setting secure cookie for HTTPS websites', async ({context, page, server}) => {
await page.goto(server.EMPTY_PAGE);
const SECURE_URL = 'https://example.com';
await context.addCookies([{
@@ -262,7 +262,7 @@ it('should default to setting secure cookie for HTTPS websites', async({context,
expect(cookie.secure).toBe(true);
});
-it('should be able to set unsecure cookie for HTTP website', async({context, page, server}) => {
+it('should be able to set unsecure cookie for HTTP website', async ({context, page, server}) => {
await page.goto(server.EMPTY_PAGE);
const HTTP_URL = 'http://example.com';
await context.addCookies([{
@@ -274,7 +274,7 @@ it('should be able to set unsecure cookie for HTTP website', async({context, pag
expect(cookie.secure).toBe(false);
});
-it('should set a cookie on a different domain', async({context, page, server}) => {
+it('should set a cookie on a different domain', async ({context, page, server}) => {
await page.goto(server.EMPTY_PAGE);
await context.addCookies([{
url: 'https://www.example.com',
@@ -294,7 +294,7 @@ it('should set a cookie on a different domain', async({context, page, server}) =
}]);
});
-it('should set cookies for a frame', async({context, page, server}) => {
+it('should set cookies for a frame', async ({context, page, server}) => {
await page.goto(server.EMPTY_PAGE);
await context.addCookies([
{url: server.PREFIX, name: 'frame-cookie', value: 'value'}
@@ -312,7 +312,7 @@ it('should set cookies for a frame', async({context, page, server}) => {
expect(await page.frames()[1].evaluate('document.cookie')).toBe('frame-cookie=value');
});
-it('should(not) block third party cookies', async({context, page, server}) => {
+it('should(not) block third party cookies', async ({context, page, server}) => {
await page.goto(server.EMPTY_PAGE);
await page.evaluate(src => {
let fulfill;
@@ -330,14 +330,14 @@ it('should(not) block third party cookies', async({context, page, server}) => {
if (allowsThirdParty) {
expect(cookies).toEqual([
{
- "domain": "127.0.0.1",
- "expires": -1,
- "httpOnly": false,
- "name": "username",
- "path": "/",
- "sameSite": "None",
- "secure": false,
- "value": "John Doe"
+ 'domain': '127.0.0.1',
+ 'expires': -1,
+ 'httpOnly': false,
+ 'name': 'username',
+ 'path': '/',
+ 'sameSite': 'None',
+ 'secure': false,
+ 'value': 'John Doe'
}
]);
} else {
diff --git a/test/browsercontext-basic.spec.ts b/test/browsercontext-basic.spec.ts
index 21553f1e5b..380719ffdf 100644
--- a/test/browsercontext-basic.spec.ts
+++ b/test/browsercontext-basic.spec.ts
@@ -84,14 +84,14 @@ it('should isolate localStorage and cookies', async function({browser, server})
expect(browser.contexts().length).toBe(0);
});
-it('should propagate default viewport to the page', async({ browser }) => {
+it('should propagate default viewport to the page', async ({ browser }) => {
const context = await browser.newContext({ viewport: { width: 456, height: 789 } });
const page = await context.newPage();
await utils.verifyViewport(page, 456, 789);
await context.close();
});
-it('should make a copy of default viewport', async({ browser }) => {
+it('should make a copy of default viewport', async ({ browser }) => {
const viewport = { width: 456, height: 789 };
const context = await browser.newContext({ viewport });
viewport.width = 567;
@@ -100,37 +100,37 @@ it('should make a copy of default viewport', async({ browser }) => {
await context.close();
});
-it('should respect deviceScaleFactor', async({ browser }) => {
+it('should respect deviceScaleFactor', async ({ browser }) => {
const context = await browser.newContext({ deviceScaleFactor: 3 });
const page = await context.newPage();
expect(await page.evaluate('window.devicePixelRatio')).toBe(3);
await context.close();
});
-it('should not allow deviceScaleFactor with null viewport', async({ browser }) => {
+it('should not allow deviceScaleFactor with null viewport', async ({ browser }) => {
const error = await browser.newContext({ viewport: null, deviceScaleFactor: 1 }).catch(e => e);
expect(error.message).toContain('"deviceScaleFactor" option is not supported with null "viewport"');
});
-it('should not allow isMobile with null viewport', async({ browser }) => {
+it('should not allow isMobile with null viewport', async ({ browser }) => {
const error = await browser.newContext({ viewport: null, isMobile: true }).catch(e => e);
expect(error.message).toContain('"isMobile" option is not supported with null "viewport"');
});
-it('close() should work for empty context', async({ browser }) => {
+it('close() should work for empty context', async ({ browser }) => {
const context = await browser.newContext();
await context.close();
});
-it('close() should abort waitForEvent', async({ browser }) => {
+it('close() should abort waitForEvent', async ({ browser }) => {
const context = await browser.newContext();
const promise = context.waitForEvent('page').catch(e => e);
await context.close();
- let error = await promise;
+ const error = await promise;
expect(error.message).toContain('Context closed');
});
-it('close() should be callable twice', async({browser}) => {
+it('close() should be callable twice', async ({browser}) => {
const context = await browser.newContext();
await Promise.all([
context.close(),
@@ -139,7 +139,7 @@ it('close() should be callable twice', async({browser}) => {
await context.close();
});
-it('should not report frameless pages on error', async({browser, server}) => {
+it('should not report frameless pages on error', async ({browser, server}) => {
const context = await browser.newContext();
const page = await context.newPage();
server.setRoute('/empty.html', (req, res) => {
@@ -157,7 +157,7 @@ it('should not report frameless pages on error', async({browser, server}) => {
}
});
-it('should return all of the pages', async({browser, server}) => {
+it('should return all of the pages', async ({browser, server}) => {
const context = await browser.newContext();
const page = await context.newPage();
const second = await context.newPage();
@@ -177,7 +177,7 @@ it('should close all belonging pages once closing context', async function({brow
expect(context.pages().length).toBe(0);
});
-it('should disable javascript', async({browser}) => {
+it('should disable javascript', async ({browser}) => {
{
const context = await browser.newContext({ javaScriptEnabled: false });
const page = await context.newPage();
@@ -200,14 +200,14 @@ it('should disable javascript', async({browser}) => {
}
});
-it('should be able to navigate after disabling javascript', async({browser, server}) => {
+it('should be able to navigate after disabling javascript', async ({browser, server}) => {
const context = await browser.newContext({ javaScriptEnabled: false });
const page = await context.newPage();
await page.goto(server.EMPTY_PAGE);
await context.close();
});
-it('should work with offline option', async({browser, server}) => {
+it('should work with offline option', async ({browser, server}) => {
const context = await browser.newContext({offline: true});
const page = await context.newPage();
let error = null;
@@ -219,7 +219,7 @@ it('should work with offline option', async({browser, server}) => {
await context.close();
});
-it('should emulate navigator.onLine', async({browser, server}) => {
+it('should emulate navigator.onLine', async ({browser, server}) => {
const context = await browser.newContext();
const page = await context.newPage();
expect(await page.evaluate(() => window.navigator.onLine)).toBe(true);
diff --git a/test/browsercontext-clearcookies.spec.ts b/test/browsercontext-clearcookies.spec.ts
index 10441460b2..2cd7d86184 100644
--- a/test/browsercontext-clearcookies.spec.ts
+++ b/test/browsercontext-clearcookies.spec.ts
@@ -17,7 +17,7 @@
import './playwright.fixtures';
-it('should clear cookies', async({context, page, server}) => {
+it('should clear cookies', async ({context, page, server}) => {
await page.goto(server.EMPTY_PAGE);
await context.addCookies([{
url: server.EMPTY_PAGE,
@@ -31,7 +31,7 @@ it('should clear cookies', async({context, page, server}) => {
expect(await page.evaluate('document.cookie')).toBe('');
});
-it('should isolate cookies when clearing', async({context, server, browser}) => {
+it('should isolate cookies when clearing', async ({context, server, browser}) => {
const anotherContext = await browser.newContext();
await context.addCookies([{url: server.EMPTY_PAGE, name: 'page1cookie', value: 'page1value'}]);
await anotherContext.addCookies([{url: server.EMPTY_PAGE, name: 'page2cookie', value: 'page2value'}]);
diff --git a/test/browsercontext-cookies.spec.ts b/test/browsercontext-cookies.spec.ts
index 05c1e4c88b..7c01d72645 100644
--- a/test/browsercontext-cookies.spec.ts
+++ b/test/browsercontext-cookies.spec.ts
@@ -16,11 +16,11 @@
*/
import { options } from './playwright.fixtures';
-it('should return no cookies in pristine browser context', async({context, page, server}) => {
+it('should return no cookies in pristine browser context', async ({context, page, server}) => {
expect(await context.cookies()).toEqual([]);
});
-it('should get a cookie', async({context, page, server}) => {
+it('should get a cookie', async ({context, page, server}) => {
await page.goto(server.EMPTY_PAGE);
const documentCookie = await page.evaluate(() => {
document.cookie = 'username=John Doe';
@@ -39,7 +39,7 @@ it('should get a cookie', async({context, page, server}) => {
}]);
});
-it('should get a non-session cookie', async({context, page, server}) => {
+it('should get a non-session cookie', async ({context, page, server}) => {
await page.goto(server.EMPTY_PAGE);
// @see https://en.wikipedia.org/wiki/Year_2038_problem
const date = +(new Date('1/1/2038'));
@@ -61,7 +61,7 @@ it('should get a non-session cookie', async({context, page, server}) => {
}]);
});
-it('should properly report httpOnly cookie', async({context, page, server}) => {
+it('should properly report httpOnly cookie', async ({context, page, server}) => {
server.setRoute('/empty.html', (req, res) => {
res.setHeader('Set-Cookie', 'name=value;HttpOnly; Path=/');
res.end();
@@ -72,7 +72,7 @@ it('should properly report httpOnly cookie', async({context, page, server}) => {
expect(cookies[0].httpOnly).toBe(true);
});
-it.fail(options.WEBKIT && WIN)('should properly report "Strict" sameSite cookie', async({context, page, server}) => {
+it.fail(options.WEBKIT && WIN)('should properly report "Strict" sameSite cookie', async ({context, page, server}) => {
server.setRoute('/empty.html', (req, res) => {
res.setHeader('Set-Cookie', 'name=value;SameSite=Strict');
res.end();
@@ -83,7 +83,7 @@ it.fail(options.WEBKIT && WIN)('should properly report "Strict" sameSite cookie'
expect(cookies[0].sameSite).toBe('Strict');
});
-it.fail(options.WEBKIT && WIN)('should properly report "Lax" sameSite cookie', async({context, page, server}) => {
+it.fail(options.WEBKIT && WIN)('should properly report "Lax" sameSite cookie', async ({context, page, server}) => {
server.setRoute('/empty.html', (req, res) => {
res.setHeader('Set-Cookie', 'name=value;SameSite=Lax');
res.end();
@@ -94,7 +94,7 @@ it.fail(options.WEBKIT && WIN)('should properly report "Lax" sameSite cookie', a
expect(cookies[0].sameSite).toBe('Lax');
});
-it('should get multiple cookies', async({context, page, server}) => {
+it('should get multiple cookies', async ({context, page, server}) => {
await page.goto(server.EMPTY_PAGE);
const documentCookie = await page.evaluate(() => {
document.cookie = 'username=John Doe';
@@ -128,7 +128,7 @@ it('should get multiple cookies', async({context, page, server}) => {
]);
});
-it('should get cookies from multiple urls', async({context}) => {
+it('should get cookies from multiple urls', async ({context}) => {
await context.addCookies([{
url: 'https://foo.com',
name: 'doggo',
diff --git a/test/browsercontext-credentials.spec.ts b/test/browsercontext-credentials.spec.ts
index a3a8341209..2ea2013caf 100644
--- a/test/browsercontext-credentials.spec.ts
+++ b/test/browsercontext-credentials.spec.ts
@@ -16,7 +16,7 @@
*/
import { options } from './playwright.fixtures';
-it.fail(options.CHROMIUM && !options.HEADLESS)('should fail without credentials', async({browser, server}) => {
+it.fail(options.CHROMIUM && !options.HEADLESS)('should fail without credentials', async ({browser, server}) => {
server.setAuth('/empty.html', 'user', 'pass');
const context = await browser.newContext();
const page = await context.newPage();
@@ -25,7 +25,7 @@ it.fail(options.CHROMIUM && !options.HEADLESS)('should fail without credentials'
await context.close();
});
-it.fail(options.CHROMIUM && !options.HEADLESS)('should work with setHTTPCredentials', async({browser, server}) => {
+it.fail(options.CHROMIUM && !options.HEADLESS)('should work with setHTTPCredentials', async ({browser, server}) => {
server.setAuth('/empty.html', 'user', 'pass');
const context = await browser.newContext();
const page = await context.newPage();
@@ -37,7 +37,7 @@ it.fail(options.CHROMIUM && !options.HEADLESS)('should work with setHTTPCredenti
await context.close();
});
-it('should work with correct credentials', async({browser, server}) => {
+it('should work with correct credentials', async ({browser, server}) => {
server.setAuth('/empty.html', 'user', 'pass');
const context = await browser.newContext({
httpCredentials: { username: 'user', password: 'pass' }
@@ -48,7 +48,7 @@ it('should work with correct credentials', async({browser, server}) => {
await context.close();
});
-it('should fail with wrong credentials', async({browser, server}) => {
+it('should fail with wrong credentials', async ({browser, server}) => {
server.setAuth('/empty.html', 'user', 'pass');
const context = await browser.newContext({
httpCredentials: { username: 'foo', password: 'bar' }
@@ -59,7 +59,7 @@ it('should fail with wrong credentials', async({browser, server}) => {
await context.close();
});
-it('should return resource body', async({browser, server}) => {
+it('should return resource body', async ({browser, server}) => {
server.setAuth('/playground.html', 'user', 'pass');
const context = await browser.newContext({
httpCredentials: { username: 'user', password: 'pass' }
@@ -67,7 +67,7 @@ it('should return resource body', async({browser, server}) => {
const page = await context.newPage();
const response = await page.goto(server.PREFIX + '/playground.html');
expect(response.status()).toBe(200);
- expect(await page.title()).toBe("Playground");
- expect((await response.body()).toString()).toContain("Playground");
+ expect(await page.title()).toBe('Playground');
+ expect((await response.body()).toString()).toContain('Playground');
await context.close();
});
diff --git a/test/browsercontext-csp.spec.ts b/test/browsercontext-csp.spec.ts
index cdc67a4207..d92e117e38 100644
--- a/test/browsercontext-csp.spec.ts
+++ b/test/browsercontext-csp.spec.ts
@@ -18,7 +18,7 @@ import './playwright.fixtures';
import * as utils from './utils';
-it('should bypass CSP meta tag', async({browser, server}) => {
+it('should bypass CSP meta tag', async ({browser, server}) => {
// Make sure CSP prohibits addScriptTag.
{
const context = await browser.newContext();
@@ -40,7 +40,7 @@ it('should bypass CSP meta tag', async({browser, server}) => {
}
});
-it('should bypass CSP header', async({browser, server}) => {
+it('should bypass CSP header', async ({browser, server}) => {
// Make sure CSP prohibits addScriptTag.
server.setCSP('/empty.html', 'default-src "self"');
@@ -64,7 +64,7 @@ it('should bypass CSP header', async({browser, server}) => {
}
});
-it('should bypass after cross-process navigation', async({browser, server}) => {
+it('should bypass after cross-process navigation', async ({browser, server}) => {
const context = await browser.newContext({ bypassCSP: true });
const page = await context.newPage();
await page.goto(server.PREFIX + '/csp.html');
@@ -77,7 +77,7 @@ it('should bypass after cross-process navigation', async({browser, server}) => {
await context.close();
});
-it('should bypass CSP in iframes as well', async({browser, server}) => {
+it('should bypass CSP in iframes as well', async ({browser, server}) => {
// Make sure CSP prohibits addScriptTag in an iframe.
{
const context = await browser.newContext();
diff --git a/test/browsercontext-device.spec.ts b/test/browsercontext-device.spec.ts
index 7d48c5e14e..63c4073951 100644
--- a/test/browsercontext-device.spec.ts
+++ b/test/browsercontext-device.spec.ts
@@ -16,7 +16,7 @@
*/
import { options } from './playwright.fixtures';
-it.skip(options.FIREFOX)('should work', async({playwright, browser, server}) => {
+it.skip(options.FIREFOX)('should work', async ({playwright, browser, server}) => {
const iPhone = playwright.devices['iPhone 6'];
const context = await browser.newContext({ ...iPhone });
const page = await context.newPage();
@@ -26,7 +26,7 @@ it.skip(options.FIREFOX)('should work', async({playwright, browser, server}) =>
await context.close();
});
-it.skip(options.FIREFOX)('should support clicking', async({playwright, browser, server}) => {
+it.skip(options.FIREFOX)('should support clicking', async ({playwright, browser, server}) => {
const iPhone = playwright.devices['iPhone 6'];
const context = await browser.newContext({ ...iPhone });
const page = await context.newPage();
@@ -38,7 +38,7 @@ it.skip(options.FIREFOX)('should support clicking', async({playwright, browser,
await context.close();
});
-it.skip(options.FIREFOX)('should scroll to click', async({browser, server}) => {
+it.skip(options.FIREFOX)('should scroll to click', async ({browser, server}) => {
const context = await browser.newContext({
viewport: {
width: 400,
diff --git a/test/browsercontext-expose-function.spec.ts b/test/browsercontext-expose-function.spec.ts
index f506fe9a49..0329521476 100644
--- a/test/browsercontext-expose-function.spec.ts
+++ b/test/browsercontext-expose-function.spec.ts
@@ -16,7 +16,7 @@
*/
import './playwright.fixtures';
-it('expose binding should work', async({browser}) => {
+it('expose binding should work', async ({browser}) => {
const context = await browser.newContext();
let bindingSource;
await context.exposeBinding('add', (source, a, b) => {
@@ -32,7 +32,7 @@ it('expose binding should work', async({browser}) => {
await context.close();
});
-it('should work', async({browser, server}) => {
+it('should work', async ({browser, server}) => {
const context = await browser.newContext();
await context.exposeFunction('add', (a, b) => a + b);
const page = await context.newPage();
@@ -47,7 +47,7 @@ it('should work', async({browser, server}) => {
await context.close();
});
-it('should throw for duplicate registrations', async({browser, server}) => {
+it('should throw for duplicate registrations', async ({browser, server}) => {
const context = await browser.newContext();
await context.exposeFunction('foo', () => {});
await context.exposeFunction('bar', () => {});
@@ -62,7 +62,7 @@ it('should throw for duplicate registrations', async({browser, server}) => {
await context.close();
});
-it('should be callable from-inside addInitScript', async({browser, server}) => {
+it('should be callable from-inside addInitScript', async ({browser, server}) => {
const context = await browser.newContext();
let args = [];
await context.exposeFunction('woof', function(arg) {
diff --git a/test/browsercontext-locale.spec.ts b/test/browsercontext-locale.spec.ts
index e7974c5a76..27646c60bb 100644
--- a/test/browsercontext-locale.spec.ts
+++ b/test/browsercontext-locale.spec.ts
@@ -14,9 +14,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-import { options } from './playwright.fixtures';
+import './playwright.fixtures';
-it('should affect accept-language header', async({browser, server}) => {
+it('should affect accept-language header', async ({browser, server}) => {
const context = await browser.newContext({ locale: 'fr-CH' });
const page = await context.newPage();
const [request] = await Promise.all([
@@ -27,14 +27,14 @@ it('should affect accept-language header', async({browser, server}) => {
await context.close();
});
-it('should affect navigator.language', async({browser, server}) => {
+it('should affect navigator.language', async ({browser, server}) => {
const context = await browser.newContext({ locale: 'fr-CH' });
const page = await context.newPage();
expect(await page.evaluate(() => navigator.language)).toBe('fr-CH');
await context.close();
});
-it('should format number', async({browser, server}) => {
+it('should format number', async ({browser, server}) => {
{
const context = await browser.newContext({ locale: 'en-US' });
const page = await context.newPage();
@@ -51,7 +51,7 @@ it('should format number', async({browser, server}) => {
}
});
-it('should format date', async({browser, server}) => {
+it('should format date', async ({browser, server}) => {
{
const context = await browser.newContext({ locale: 'en-US', timezoneId: 'America/Los_Angeles' });
const page = await context.newPage();
@@ -70,7 +70,7 @@ it('should format date', async({browser, server}) => {
}
});
-it('should format number in popups', async({browser, server}) => {
+it('should format number in popups', async ({browser, server}) => {
const context = await browser.newContext({ locale: 'fr-CH' });
const page = await context.newPage();
await page.goto(server.EMPTY_PAGE);
@@ -85,7 +85,7 @@ it('should format number in popups', async({browser, server}) => {
await context.close();
});
-it('should affect navigator.language in popups', async({browser, server}) => {
+it('should affect navigator.language in popups', async ({browser, server}) => {
const context = await browser.newContext({ locale: 'fr-CH' });
const page = await context.newPage();
await page.goto(server.EMPTY_PAGE);
@@ -99,7 +99,7 @@ it('should affect navigator.language in popups', async({browser, server}) => {
await context.close();
});
-it('should work for multiple pages sharing same process', async({browser, server}) => {
+it('should work for multiple pages sharing same process', async ({browser, server}) => {
const context = await browser.newContext({ locale: 'ru-RU' });
const page = await context.newPage();
await page.goto(server.EMPTY_PAGE);
@@ -114,11 +114,11 @@ it('should work for multiple pages sharing same process', async({browser, server
await context.close();
});
-it('should be isolated between contexts', async({browser, server}) => {
+it('should be isolated between contexts', async ({browser, server}) => {
const context1 = await browser.newContext({ locale: 'en-US' });
const promises = [];
// By default firefox limits number of child web processes to 8.
- for (let i = 0; i< 8; i++)
+ for (let i = 0; i < 8; i++)
promises.push(context1.newPage());
await Promise.all(promises);
@@ -137,7 +137,7 @@ it('should be isolated between contexts', async({browser, server}) => {
]);
});
-it('should not change default locale in another context', async({browser, server}) => {
+it('should not change default locale in another context', async ({browser, server}) => {
async function getContextLocale(context) {
const page = await context.newPage();
return await page.evaluate(() => (new Intl.NumberFormat()).resolvedOptions().locale);
diff --git a/test/browsercontext-page-event.spec.ts b/test/browsercontext-page-event.spec.ts
index e8aa8c7657..d64f3b06ed 100644
--- a/test/browsercontext-page-event.spec.ts
+++ b/test/browsercontext-page-event.spec.ts
@@ -16,7 +16,7 @@
*/
import { options } from './playwright.fixtures';
-it('should have url', async({browser, server}) => {
+it('should have url', async ({browser, server}) => {
const context = await browser.newContext();
const page = await context.newPage();
const [otherPage] = await Promise.all([
@@ -27,7 +27,7 @@ it('should have url', async({browser, server}) => {
await context.close();
});
-it('should have url after domcontentloaded', async({browser, server}) => {
+it('should have url after domcontentloaded', async ({browser, server}) => {
const context = await browser.newContext();
const page = await context.newPage();
const [otherPage] = await Promise.all([
@@ -39,7 +39,7 @@ it('should have url after domcontentloaded', async({browser, server}) => {
await context.close();
});
-it('should have about:blank url with domcontentloaded', async({browser, server}) => {
+it('should have about:blank url with domcontentloaded', async ({browser, server}) => {
const context = await browser.newContext();
const page = await context.newPage();
const [otherPage] = await Promise.all([
@@ -51,7 +51,7 @@ it('should have about:blank url with domcontentloaded', async({browser, server})
await context.close();
});
-it('should have about:blank for empty url with domcontentloaded', async({browser, server}) => {
+it('should have about:blank for empty url with domcontentloaded', async ({browser, server}) => {
const context = await browser.newContext();
const page = await context.newPage();
const [otherPage] = await Promise.all([
@@ -63,7 +63,7 @@ it('should have about:blank for empty url with domcontentloaded', async({browser
await context.close();
});
-it('should report when a new page is created and closed', async({browser, server}) => {
+it('should report when a new page is created and closed', async ({browser, server}) => {
const context = await browser.newContext();
const page = await context.newPage();
const [otherPage] = await Promise.all([
@@ -90,7 +90,7 @@ it('should report when a new page is created and closed', async({browser, server
await context.close();
});
-it('should report initialized pages', async({browser, server}) => {
+it('should report initialized pages', async ({browser, server}) => {
const context = await browser.newContext();
const pagePromise = context.waitForEvent('page');
context.newPage();
@@ -105,7 +105,7 @@ it('should report initialized pages', async({browser, server}) => {
await context.close();
});
-it('should not crash while redirecting of original request was missed', async({browser, server}) => {
+it('should not crash while redirecting of original request was missed', async ({browser, server}) => {
const context = await browser.newContext();
const page = await context.newPage();
let serverResponse = null;
@@ -125,7 +125,7 @@ it('should not crash while redirecting of original request was missed', async({b
await context.close();
});
-it('should have an opener', async({browser, server}) => {
+it('should have an opener', async ({browser, server}) => {
const context = await browser.newContext();
const page = await context.newPage();
await page.goto(server.EMPTY_PAGE);
@@ -156,7 +156,7 @@ it('should fire page lifecycle events', async function({browser, server}) {
await context.close();
});
-it.fixme(options.WEBKIT)('should work with Shift-clicking', async({browser, server}) => {
+it.fixme(options.WEBKIT)('should work with Shift-clicking', async ({browser, server}) => {
// WebKit: Shift+Click does not open a new window.
const context = await browser.newContext();
const page = await context.newPage();
@@ -170,7 +170,7 @@ it.fixme(options.WEBKIT)('should work with Shift-clicking', async({browser, serv
await context.close();
});
-it.fixme(options.WEBKIT || options.FIREFOX)('should work with Ctrl-clicking', async({browser, server}) => {
+it.fixme(options.WEBKIT || options.FIREFOX)('should work with Ctrl-clicking', async ({browser, server}) => {
// Firefox: reports an opener in this case.
// WebKit: Ctrl+Click does not open a new tab.
const context = await browser.newContext();
diff --git a/test/browsercontext-route.spec.ts b/test/browsercontext-route.spec.ts
index 0fbbd2e8d0..47b73dacaa 100644
--- a/test/browsercontext-route.spec.ts
+++ b/test/browsercontext-route.spec.ts
@@ -16,7 +16,7 @@
*/
import './playwright.fixtures';
-it('should intercept', async({browser, server}) => {
+it('should intercept', async ({browser, server}) => {
const context = await browser.newContext();
let intercepted = false;
await context.route('**/empty.html', route => {
@@ -39,7 +39,7 @@ it('should intercept', async({browser, server}) => {
await context.close();
});
-it('should unroute', async({browser, server}) => {
+it('should unroute', async ({browser, server}) => {
const context = await browser.newContext();
const page = await context.newPage();
@@ -77,7 +77,7 @@ it('should unroute', async({browser, server}) => {
await context.close();
});
-it('should yield to page.route', async({browser, server}) => {
+it('should yield to page.route', async ({browser, server}) => {
const context = await browser.newContext();
await context.route('**/empty.html', route => {
route.fulfill({ status: 200, body: 'context' });
@@ -92,7 +92,7 @@ it('should yield to page.route', async({browser, server}) => {
await context.close();
});
-it('should fall back to context.route', async({browser, server}) => {
+it('should fall back to context.route', async ({browser, server}) => {
const context = await browser.newContext();
await context.route('**/empty.html', route => {
route.fulfill({ status: 200, body: 'context' });
diff --git a/test/browsercontext-timezone-id.spec.ts b/test/browsercontext-timezone-id.spec.ts
index 7bc4c71b8b..84b61fc393 100644
--- a/test/browsercontext-timezone-id.spec.ts
+++ b/test/browsercontext-timezone-id.spec.ts
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-import { options } from './playwright.fixtures';
+import './playwright.fixtures';
it('should work', async ({ browser }) => {
const func = () => new Date(1479579154987).toString();
@@ -44,17 +44,17 @@ it('should work', async ({ browser }) => {
}
});
-it('should throw for invalid timezone IDs when creating pages', async({browser}) => {
+it('should throw for invalid timezone IDs when creating pages', async ({browser}) => {
for (const timezoneId of ['Foo/Bar', 'Baz/Qux']) {
let error = null;
const context = await browser.newContext({ timezoneId });
- const page = await context.newPage().catch(e => error = e);
+ await context.newPage().catch(e => error = e);
expect(error.message).toContain(`Invalid timezone ID: ${timezoneId}`);
await context.close();
}
});
-it('should work for multiple pages sharing same process', async({browser, server}) => {
+it('should work for multiple pages sharing same process', async ({browser, server}) => {
const context = await browser.newContext({ timezoneId: 'Europe/Moscow' });
const page = await context.newPage();
await page.goto(server.EMPTY_PAGE);
@@ -69,7 +69,7 @@ it('should work for multiple pages sharing same process', async({browser, server
await context.close();
});
-it('should not change default timezone in another context', async({browser, server}) => {
+it('should not change default timezone in another context', async ({browser, server}) => {
async function getContextTimezone(context) {
const page = await context.newPage();
return await page.evaluate(() => Intl.DateTimeFormat().resolvedOptions().timeZone);
diff --git a/test/browsercontext-user-agent.spec.ts b/test/browsercontext-user-agent.spec.ts
index 22dd11b63f..e964eb3693 100644
--- a/test/browsercontext-user-agent.spec.ts
+++ b/test/browsercontext-user-agent.spec.ts
@@ -18,7 +18,7 @@ import './playwright.fixtures';
import utils from './utils';
-it('should work', async({browser, server}) => {
+it('should work', async ({browser, server}) => {
{
const context = await browser.newContext();
const page = await context.newPage();
@@ -37,7 +37,7 @@ it('should work', async({browser, server}) => {
}
});
-it('should work for subframes', async({browser, server}) => {
+it('should work for subframes', async ({browser, server}) => {
{
const context = await browser.newContext();
const page = await context.newPage();
@@ -56,7 +56,7 @@ it('should work for subframes', async({browser, server}) => {
}
});
-it('should emulate device user-agent', async({browser, server, playwright}) => {
+it('should emulate device user-agent', async ({browser, server, playwright}) => {
{
const context = await browser.newContext();
const page = await context.newPage();
@@ -73,7 +73,7 @@ it('should emulate device user-agent', async({browser, server, playwright}) => {
}
});
-it('should make a copy of default options', async({browser, server}) => {
+it('should make a copy of default options', async ({browser, server}) => {
const options = { userAgent: 'foobar' };
const context = await browser.newContext(options);
options.userAgent = 'wrong';
diff --git a/test/browsercontext-viewport-mobile.spec.ts b/test/browsercontext-viewport-mobile.spec.ts
index 736e465e83..dd14e29b25 100644
--- a/test/browsercontext-viewport-mobile.spec.ts
+++ b/test/browsercontext-viewport-mobile.spec.ts
@@ -17,7 +17,7 @@
import { options } from './playwright.fixtures';
-it.skip(options.FIREFOX)('should support mobile emulation', async({playwright, browser, server}) => {
+it.skip(options.FIREFOX)('should support mobile emulation', async ({playwright, browser, server}) => {
const iPhone = playwright.devices['iPhone 6'];
const context = await browser.newContext({ ...iPhone });
const page = await context.newPage();
@@ -28,7 +28,7 @@ it.skip(options.FIREFOX)('should support mobile emulation', async({playwright, b
await context.close();
});
-it.skip(options.FIREFOX)('should support touch emulation', async({playwright, browser, server}) => {
+it.skip(options.FIREFOX)('should support touch emulation', async ({playwright, browser, server}) => {
const iPhone = playwright.devices['iPhone 6'];
const context = await browser.newContext({ ...iPhone });
const page = await context.newPage();
@@ -51,7 +51,7 @@ it.skip(options.FIREFOX)('should support touch emulation', async({playwright, br
}
});
-it.skip(options.FIREFOX)('should be detectable by Modernizr', async({playwright, browser, server}) => {
+it.skip(options.FIREFOX)('should be detectable by Modernizr', async ({playwright, browser, server}) => {
const iPhone = playwright.devices['iPhone 6'];
const context = await browser.newContext({ ...iPhone });
const page = await context.newPage();
@@ -60,7 +60,7 @@ it.skip(options.FIREFOX)('should be detectable by Modernizr', async({playwright,
await context.close();
});
-it.skip(options.FIREFOX)('should detect touch when applying viewport with touches', async({browser, server}) => {
+it.skip(options.FIREFOX)('should detect touch when applying viewport with touches', async ({browser, server}) => {
const context = await browser.newContext({ viewport: { width: 800, height: 600 }, hasTouch: true });
const page = await context.newPage();
await page.goto(server.EMPTY_PAGE);
@@ -69,7 +69,7 @@ it.skip(options.FIREFOX)('should detect touch when applying viewport with touche
await context.close();
});
-it.skip(options.FIREFOX)('should support landscape emulation', async({playwright, browser, server}) => {
+it.skip(options.FIREFOX)('should support landscape emulation', async ({playwright, browser, server}) => {
const iPhone = playwright.devices['iPhone 6'];
const iPhoneLandscape = playwright.devices['iPhone 6 landscape'];
const context1 = await browser.newContext({ ...iPhone });
@@ -83,7 +83,7 @@ it.skip(options.FIREFOX)('should support landscape emulation', async({playwright
await context2.close();
});
-it.skip(options.FIREFOX)('should support window.orientation emulation', async({browser, server}) => {
+it.skip(options.FIREFOX)('should support window.orientation emulation', async ({browser, server}) => {
const context = await browser.newContext({ viewport: { width: 300, height: 400 }, isMobile: true });
const page = await context.newPage();
await page.goto(server.PREFIX + '/mobile.html');
@@ -93,7 +93,7 @@ it.skip(options.FIREFOX)('should support window.orientation emulation', async({b
await context.close();
});
-it.skip(options.FIREFOX)('should fire orientationchange event', async({browser, server}) => {
+it.skip(options.FIREFOX)('should fire orientationchange event', async ({browser, server}) => {
const context = await browser.newContext({ viewport: { width: 300, height: 400 }, isMobile: true });
const page = await context.newPage();
await page.goto(server.PREFIX + '/mobile.html');
@@ -112,7 +112,7 @@ it.skip(options.FIREFOX)('should fire orientationchange event', async({browser,
await context.close();
});
-it.skip(options.FIREFOX)('default mobile viewports to 980 width', async({browser, server}) => {
+it.skip(options.FIREFOX)('default mobile viewports to 980 width', async ({browser, server}) => {
const context = await browser.newContext({ viewport: {width: 320, height: 480 }, isMobile: true });
const page = await context.newPage();
await page.goto(server.PREFIX + '/empty.html');
@@ -120,7 +120,7 @@ it.skip(options.FIREFOX)('default mobile viewports to 980 width', async({browser
await context.close();
});
-it.skip(options.FIREFOX)('respect meta viewport tag', async({browser, server}) => {
+it.skip(options.FIREFOX)('respect meta viewport tag', async ({browser, server}) => {
const context = await browser.newContext({ viewport: {width: 320, height: 480 }, isMobile: true });
const page = await context.newPage();
await page.goto(server.PREFIX + '/mobile.html');
diff --git a/test/browsercontext-viewport.spec.ts b/test/browsercontext-viewport.spec.ts
index 0bb42bc3a3..dcf175b7a7 100644
--- a/test/browsercontext-viewport.spec.ts
+++ b/test/browsercontext-viewport.spec.ts
@@ -18,17 +18,17 @@ import './playwright.fixtures';
import utils from './utils';
-it('should get the proper default viewport size', async({page, server}) => {
+it('should get the proper default viewport size', async ({page, server}) => {
await utils.verifyViewport(page, 1280, 720);
});
-it('should set the proper viewport size', async({page, server}) => {
+it('should set the proper viewport size', async ({page, server}) => {
await utils.verifyViewport(page, 1280, 720);
await page.setViewportSize({width: 123, height: 456});
await utils.verifyViewport(page, 123, 456);
});
-it('should return correct outerWidth and outerHeight', async({page}) => {
+it('should return correct outerWidth and outerHeight', async ({page}) => {
const size = await page.evaluate(() => {
return {
innerWidth: window.innerWidth,
@@ -43,7 +43,7 @@ it('should return correct outerWidth and outerHeight', async({page}) => {
expect(size.outerHeight >= size.innerHeight).toBeTruthy();
});
-it('should emulate device width', async({page, server}) => {
+it('should emulate device width', async ({page, server}) => {
expect(page.viewportSize()).toEqual({width: 1280, height: 720});
await page.setViewportSize({width: 200, height: 200});
expect(await page.evaluate(() => window.screen.width)).toBe(200);
@@ -63,7 +63,7 @@ it('should emulate device width', async({page, server}) => {
expect(await page.evaluate(() => matchMedia('(device-width: 500px)').matches)).toBe(true);
});
-it('should emulate device height', async({page, server}) => {
+it('should emulate device height', async ({page, server}) => {
expect(page.viewportSize()).toEqual({width: 1280, height: 720});
await page.setViewportSize({width: 200, height: 200});
expect(await page.evaluate(() => window.screen.height)).toBe(200);
@@ -83,14 +83,14 @@ it('should emulate device height', async({page, server}) => {
expect(await page.evaluate(() => matchMedia('(device-height: 500px)').matches)).toBe(true);
});
-it('should not have touch by default', async({page, server}) => {
+it('should not have touch by default', async ({page, server}) => {
await page.goto(server.PREFIX + '/mobile.html');
expect(await page.evaluate(() => 'ontouchstart' in window)).toBe(false);
await page.goto(server.PREFIX + '/detect-touch.html');
expect(await page.evaluate(() => document.body.textContent.trim())).toBe('NO');
});
-it('should support touch with null viewport', async({browser, server}) => {
+it('should support touch with null viewport', async ({browser, server}) => {
const context = await browser.newContext({ viewport: null, hasTouch: true });
const page = await context.newPage();
await page.goto(server.PREFIX + '/mobile.html');
@@ -98,7 +98,7 @@ it('should support touch with null viewport', async({browser, server}) => {
await context.close();
});
-it('should report null viewportSize when given null viewport', async({browser, server}) => {
+it('should report null viewportSize when given null viewport', async ({browser, server}) => {
const context = await browser.newContext({ viewport: null });
const page = await context.newPage();
expect(page.viewportSize()).toBe(null);
diff --git a/test/browsertype-basic.spec.ts b/test/browsertype-basic.spec.ts
index 73229bc990..258b5e8e05 100644
--- a/test/browsertype-basic.spec.ts
+++ b/test/browsertype-basic.spec.ts
@@ -18,13 +18,13 @@
import fs from 'fs';
import { options } from './playwright.fixtures';
-it.skip(Boolean(process.env.CRPATH || process.env.FFPATH || process.env.WKPATH))('browserType.executablePath should work', async({browserType}) => {
+it.skip(Boolean(process.env.CRPATH || process.env.FFPATH || process.env.WKPATH))('browserType.executablePath should work', async ({browserType}) => {
const executablePath = browserType.executablePath();
expect(fs.existsSync(executablePath)).toBe(true);
expect(fs.realpathSync(executablePath)).toBe(executablePath);
});
-it('browserType.name should work', async({browserType}) => {
+it('browserType.name should work', async ({browserType}) => {
if (options.WEBKIT)
expect(browserType.name()).toBe('webkit');
else if (options.FIREFOX)
diff --git a/test/browsertype-connect.spec.ts b/test/browsertype-connect.spec.ts
index 8bd117dc83..bc4a8b0783 100644
--- a/test/browsertype-connect.spec.ts
+++ b/test/browsertype-connect.spec.ts
@@ -19,7 +19,7 @@ import { options } from './playwright.fixtures';
import utils from './utils';
import './remoteServer.fixture';
-it.skip(options.WIRE).slow()('should be able to reconnect to a browser', async({browserType, remoteServer, server}) => {
+it.skip(options.WIRE).slow()('should be able to reconnect to a browser', async ({browserType, remoteServer, server}) => {
{
const browser = await browserType.connect({ wsEndpoint: remoteServer.wsEndpoint() });
const browserContext = await browser.newContext();
@@ -81,8 +81,8 @@ it.skip(options.WIRE).slow()('disconnected event should be emitted when browser
expect(disconnected2).toBe(1);
});
-it.skip(options.WIRE).slow()('should handle exceptions during connect', async({browserType, remoteServer}) => {
- const __testHookBeforeCreateBrowser = () => { throw new Error('Dummy') };
+it.skip(options.WIRE).slow()('should handle exceptions during connect', async ({browserType, remoteServer}) => {
+ const __testHookBeforeCreateBrowser = () => { throw new Error('Dummy'); };
const error = await browserType.connect({ wsEndpoint: remoteServer.wsEndpoint(), __testHookBeforeCreateBrowser } as any).catch(e => e);
expect(error.message).toContain('Dummy');
});
@@ -94,7 +94,7 @@ it.skip(options.WIRE).slow()('should set the browser connected state', async ({b
expect(remote.isConnected()).toBe(false);
});
-it.skip(options.WIRE).slow()('should throw when used after isConnected returns false', async({browserType, remoteServer}) => {
+it.skip(options.WIRE).slow()('should throw when used after isConnected returns false', async ({browserType, remoteServer}) => {
const remote = await browserType.connect({ wsEndpoint: remoteServer.wsEndpoint() });
const page = await remote.newPage();
await Promise.all([
@@ -106,7 +106,7 @@ it.skip(options.WIRE).slow()('should throw when used after isConnected returns f
expect(error.message).toContain('has been closed');
});
-it.skip(options.WIRE).slow()('should reject navigation when browser closes', async({browserType, remoteServer, server}) => {
+it.skip(options.WIRE).slow()('should reject navigation when browser closes', async ({browserType, remoteServer, server}) => {
server.setRoute('/one-style.css', () => {});
const remote = await browserType.connect({ wsEndpoint: remoteServer.wsEndpoint() });
const page = await remote.newPage();
@@ -117,7 +117,7 @@ it.skip(options.WIRE).slow()('should reject navigation when browser closes', asy
expect(error.message).toContain('Navigation failed because page was closed!');
});
-it.skip(options.WIRE).slow()('should reject waitForSelector when browser closes', async({browserType, remoteServer, server}) => {
+it.skip(options.WIRE).slow()('should reject waitForSelector when browser closes', async ({browserType, remoteServer, server}) => {
server.setRoute('/empty.html', () => {});
const remote = await browserType.connect({ wsEndpoint: remoteServer.wsEndpoint() });
const page = await remote.newPage();
@@ -131,7 +131,7 @@ it.skip(options.WIRE).slow()('should reject waitForSelector when browser closes'
expect(error.message).toContain('Protocol error');
});
-it.skip(options.WIRE).slow()('should emit close events on pages and contexts', async({browserType, remoteServer}) => {
+it.skip(options.WIRE).slow()('should emit close events on pages and contexts', async ({browserType, remoteServer}) => {
const remote = await browserType.connect({ wsEndpoint: remoteServer.wsEndpoint() });
const context = await remote.newContext();
const page = await context.newPage();
@@ -144,7 +144,7 @@ it.skip(options.WIRE).slow()('should emit close events on pages and contexts', a
expect(pageClosed).toBeTruthy();
});
-it.skip(options.WIRE).slow()('should terminate network waiters', async({browserType, remoteServer, server}) => {
+it.skip(options.WIRE).slow()('should terminate network waiters', async ({browserType, remoteServer, server}) => {
const remote = await browserType.connect({ wsEndpoint: remoteServer.wsEndpoint() });
const newPage = await remote.newPage();
const results = await Promise.all([
@@ -159,7 +159,7 @@ it.skip(options.WIRE).slow()('should terminate network waiters', async({browserT
}
});
-it.skip(options.WIRE).fail(true).slow()('should respect selectors', async({ playwright, browserType, remoteServer }) => {
+it.skip(options.WIRE).fail(true).slow()('should respect selectors', async ({ playwright, browserType, remoteServer }) => {
const mycss = () => ({
create(root, target) {},
query(root, selector) {
diff --git a/test/browsertype-launch-server.spec.ts b/test/browsertype-launch-server.spec.ts
index 98c23f790e..399b10ee6d 100644
--- a/test/browsertype-launch-server.spec.ts
+++ b/test/browsertype-launch-server.spec.ts
@@ -17,13 +17,13 @@
import { options } from './playwright.fixtures';
-it.skip(options.WIRE)('should work', async({browserType, defaultBrowserOptions}) => {
+it.skip(options.WIRE)('should work', async ({browserType, defaultBrowserOptions}) => {
const browserServer = await browserType.launchServer(defaultBrowserOptions);
expect(browserServer.wsEndpoint()).not.toBe(null);
await browserServer.close();
});
-it.skip(options.WIRE)('should fire "close" event during kill', async({browserType, defaultBrowserOptions}) => {
+it.skip(options.WIRE)('should fire "close" event during kill', async ({browserType, defaultBrowserOptions}) => {
const order = [];
const browserServer = await browserType.launchServer(defaultBrowserOptions);
const closedPromise = new Promise(f => browserServer.on('close', () => {
diff --git a/test/browsertype-launch.spec.ts b/test/browsertype-launch.spec.ts
index 6d69b46aae..007d790a7d 100644
--- a/test/browsertype-launch.spec.ts
+++ b/test/browsertype-launch.spec.ts
@@ -18,7 +18,7 @@
import path from 'path';
import { options } from './playwright.fixtures';
-it('should reject all promises when browser is closed', async({browserType, defaultBrowserOptions}) => {
+it('should reject all promises when browser is closed', async ({browserType, defaultBrowserOptions}) => {
const browser = await browserType.launch(defaultBrowserOptions);
const page = await (await browser.newContext()).newPage();
let error = null;
@@ -29,21 +29,21 @@ it('should reject all promises when browser is closed', async({browserType, defa
expect(error.message).toContain('Protocol error');
});
-it('should throw if userDataDir option is passed', async({browserType, defaultBrowserOptions}) => {
+it('should throw if userDataDir option is passed', async ({browserType, defaultBrowserOptions}) => {
let waitError = null;
const options = Object.assign({}, defaultBrowserOptions, {userDataDir: 'random-path'});
await browserType.launch(options).catch(e => waitError = e);
expect(waitError.message).toContain('launchPersistentContext');
});
-it.skip(options.FIREFOX)('should throw if page argument is passed', async({browserType, defaultBrowserOptions}) => {
+it.skip(options.FIREFOX)('should throw if page argument is passed', async ({browserType, defaultBrowserOptions}) => {
let waitError = null;
const options = Object.assign({}, defaultBrowserOptions, { args: ['http://example.com'] });
await browserType.launch(options).catch(e => waitError = e);
expect(waitError.message).toContain('can not specify page');
});
-it.fixme(true)('should reject if launched browser fails immediately', async({browserType, defaultBrowserOptions}) => {
+it.fixme(true)('should reject if launched browser fails immediately', async ({browserType, defaultBrowserOptions}) => {
// I'm getting ENCONRESET on this one.
const options = Object.assign({}, defaultBrowserOptions, {executablePath: path.join(__dirname, 'assets', 'dummy_bad_browser_executable.js')});
let waitError = null;
@@ -51,14 +51,14 @@ it.fixme(true)('should reject if launched browser fails immediately', async({bro
expect(waitError.message).toContain('== logs ==');
});
-it('should reject if executable path is invalid', async({browserType, defaultBrowserOptions}) => {
+it('should reject if executable path is invalid', async ({browserType, defaultBrowserOptions}) => {
let waitError = null;
const options = Object.assign({}, defaultBrowserOptions, {executablePath: 'random-invalid-path'});
await browserType.launch(options).catch(e => waitError = e);
expect(waitError.message).toContain('Failed to launch');
});
-it.skip(options.WIRE)('should handle timeout', async({browserType, defaultBrowserOptions}) => {
+it.skip(options.WIRE)('should handle timeout', async ({browserType, defaultBrowserOptions}) => {
const options = { ...defaultBrowserOptions, timeout: 5000, __testHookBeforeCreateBrowser: () => new Promise(f => setTimeout(f, 6000)) };
const error = await browserType.launch(options).catch(e => e);
expect(error.message).toContain(`browserType.launch: Timeout 5000ms exceeded.`);
@@ -66,26 +66,26 @@ it.skip(options.WIRE)('should handle timeout', async({browserType, defaultBrowse
expect(error.message).toContain(` pid=`);
});
-it.skip(options.WIRE)('should handle exception', async({browserType, defaultBrowserOptions}) => {
+it.skip(options.WIRE)('should handle exception', async ({browserType, defaultBrowserOptions}) => {
const e = new Error('Dummy');
const options = { ...defaultBrowserOptions, __testHookBeforeCreateBrowser: () => { throw e; }, timeout: 9000 };
const error = await browserType.launch(options).catch(e => e);
expect(error.message).toContain('Dummy');
});
-it.skip(options.WIRE)('should report launch log', async({browserType, defaultBrowserOptions}) => {
+it.skip(options.WIRE)('should report launch log', async ({browserType, defaultBrowserOptions}) => {
const e = new Error('Dummy');
const options = { ...defaultBrowserOptions, __testHookBeforeCreateBrowser: () => { throw e; }, timeout: 9000 };
const error = await browserType.launch(options).catch(e => e);
expect(error.message).toContain('');
});
-it.slow()('should accept objects as options', async({browserType, defaultBrowserOptions}) => {
+it.slow()('should accept objects as options', async ({browserType, defaultBrowserOptions}) => {
const browser = await browserType.launch({ ...defaultBrowserOptions, process } as any);
await browser.close();
});
-it('should fire close event for all contexts', async({browserType, defaultBrowserOptions}) => {
+it('should fire close event for all contexts', async ({browserType, defaultBrowserOptions}) => {
const browser = await browserType.launch(defaultBrowserOptions);
const context = await browser.newContext();
let closed = false;
@@ -94,7 +94,7 @@ it('should fire close event for all contexts', async({browserType, defaultBrowse
expect(closed).toBe(true);
});
-it('should be callable twice', async({browserType, defaultBrowserOptions}) => {
+it('should be callable twice', async ({browserType, defaultBrowserOptions}) => {
const browser = await browserType.launch(defaultBrowserOptions);
await Promise.all([
browser.close(),
diff --git a/test/capabilities.spec.ts b/test/capabilities.spec.ts
index 4a631d41b0..83b082a3ba 100644
--- a/test/capabilities.spec.ts
+++ b/test/capabilities.spec.ts
@@ -22,8 +22,8 @@ it.fail(options.WEBKIT && WIN)('Web Assembly should work', async function({page,
expect(await page.evaluate('loadTable()')).toBe('42, 83');
});
-it('WebSocket should work', async({page, server}) => {
- const value = await page.evaluate((port) => {
+it('WebSocket should work', async ({page, server}) => {
+ const value = await page.evaluate(port => {
let cb;
const result = new Promise(f => cb = f);
const ws = new WebSocket('ws://localhost:' + port + '/ws');
@@ -34,7 +34,7 @@ it('WebSocket should work', async({page, server}) => {
expect(value).toBe('incoming');
});
-it('should respect CSP', async({page, server}) => {
+it('should respect CSP', async ({page, server}) => {
server.setRoute('/empty.html', async (req, res) => {
res.setHeader('Content-Security-Policy', `script-src 'unsafe-inline';`);
res.end(`
@@ -48,7 +48,7 @@ it('should respect CSP', async({page, server}) => {
expect(await page.evaluate(() => window['testStatus'])).toBe('SUCCESS');
});
-it.fixme(options.WEBKIT && (WIN || LINUX))('should play video', async({page, asset}) => {
+it.fixme(options.WEBKIT && (WIN || LINUX))('should play video', async ({page, asset}) => {
// TODO: the test passes on Windows locally but fails on GitHub Action bot,
// apparently due to a Media Pack issue in the Windows Server.
// Also the test is very flaky on Linux WebKit.
diff --git a/test/channels.spec.ts b/test/channels.spec.ts
index 4cbc5d202f..eb9c01a7dc 100644
--- a/test/channels.spec.ts
+++ b/test/channels.spec.ts
@@ -17,11 +17,11 @@
import { options } from './playwright.fixtures';
import type { ChromiumBrowser } from '..';
-it('should work', async({browser}) => {
+it('should work', async ({browser}) => {
expect(!!browser['_connection']).toBeTruthy();
});
-it('should scope context handles', async({browserType, browser, server}) => {
+it('should scope context handles', async ({browserType, browser, server}) => {
const GOLDEN_PRECONDITION = {
_guid: '',
objects: [
@@ -65,7 +65,7 @@ it('should scope context handles', async({browserType, browser, server}) => {
await expectScopeState(browser, GOLDEN_PRECONDITION);
});
-it.skip(!options.CHROMIUM)('should scope CDPSession handles', async({browserType, browser, server}) => {
+it.skip(!options.CHROMIUM)('should scope CDPSession handles', async ({browserType, browser, server}) => {
const GOLDEN_PRECONDITION = {
_guid: '',
objects: [
@@ -102,7 +102,7 @@ it.skip(!options.CHROMIUM)('should scope CDPSession handles', async({browserType
await expectScopeState(browserType, GOLDEN_PRECONDITION);
});
-it('should scope browser handles', async({browserType, defaultBrowserOptions}) => {
+it('should scope browser handles', async ({browserType, defaultBrowserOptions}) => {
const GOLDEN_PRECONDITION = {
_guid: '',
objects: [
diff --git a/test/check.spec.ts b/test/check.spec.ts
index 902ff3e7bd..05f4b1afd1 100644
--- a/test/check.spec.ts
+++ b/test/check.spec.ts
@@ -16,49 +16,49 @@
*/
import './playwright.fixtures';
-it('should check the box', async({page}) => {
+it('should check the box', async ({page}) => {
await page.setContent(``);
await page.check('input');
expect(await page.evaluate(() => window['checkbox'].checked)).toBe(true);
});
-it('should not check the checked box', async({page}) => {
+it('should not check the checked box', async ({page}) => {
await page.setContent(``);
await page.check('input');
expect(await page.evaluate(() => window['checkbox'].checked)).toBe(true);
});
-it('should uncheck the box', async({page}) => {
+it('should uncheck the box', async ({page}) => {
await page.setContent(``);
await page.uncheck('input');
expect(await page.evaluate(() => window['checkbox'].checked)).toBe(false);
});
-it('should not uncheck the unchecked box', async({page}) => {
+it('should not uncheck the unchecked box', async ({page}) => {
await page.setContent(``);
await page.uncheck('input');
expect(await page.evaluate(() => window['checkbox'].checked)).toBe(false);
});
-it('should check the box by label', async({page}) => {
+it('should check the box by label', async ({page}) => {
await page.setContent(``);
await page.check('label');
expect(await page.evaluate(() => window['checkbox'].checked)).toBe(true);
});
-it('should check the box outside label', async({page}) => {
+it('should check the box outside label', async ({page}) => {
await page.setContent(``);
await page.check('label');
expect(await page.evaluate(() => window['checkbox'].checked)).toBe(true);
});
-it('should check the box inside label w/o id', async({page}) => {
+it('should check the box inside label w/o id', async ({page}) => {
await page.setContent(``);
await page.check('label');
expect(await page.evaluate(() => window['checkbox'].checked)).toBe(true);
});
-it('should check radio', async({page}) => {
+it('should check radio', async ({page}) => {
await page.setContent(`
one
two
@@ -67,7 +67,7 @@ it('should check radio', async({page}) => {
expect(await page.evaluate(() => window['two'].checked)).toBe(true);
});
-it('should check the box by aria role', async({page}) => {
+it('should check the box by aria role', async ({page}) => {
await page.setContent(`