diff --git a/test/accessibility.spec.ts b/test/accessibility.spec.ts index 1eac353ec3..4981b6ef64 100644 --- a/test/accessibility.spec.ts +++ b/test/accessibility.spec.ts @@ -35,7 +35,7 @@ it('should work', async function({page}) { // autofocus happens after a delay in chrome these days await page.waitForFunction(() => document.activeElement.hasAttribute('autofocus')); - const golden = options.FIREFOX() ? { + const golden = options.FIREFOX ? { role: 'document', name: 'Accessibility Test', children: [ @@ -48,7 +48,7 @@ it('should work', async function({page}) { {role: 'textbox', name: '', value: 'and a value'}, // firefox doesn't use aria-placeholder for the name {role: 'textbox', name: '', value: 'and a value', description: 'This is a description!'}, // and here ] - } : options.CHROMIUM() ? { + } : options.CHROMIUM ? { role: 'WebArea', name: 'Accessibility Test', children: [ @@ -82,7 +82,7 @@ it('should work with regular text', async({page}) => { await page.setContent(`


`);
- const golden = options.FIREFOX() ? {
+ const golden = options.FIREFOX ? {
role: 'textbox',
name: 'my favorite textbox',
value: 'this is the inner content yo'
- } : options.CHROMIUM() ? {
+ } : options.CHROMIUM ? {
role: 'textbox',
name: 'my favorite textbox',
value: 'this is the inner content '
@@ -276,7 +276,7 @@ it('checkbox without label should not have children', async function({page}) {
this is the inner content
`);
- const golden = options.FIREFOX() ? {
+ const golden = options.FIREFOX ? {
role: 'checkbox',
name: 'this is the inner content yo',
checked: true
@@ -327,7 +327,7 @@ it('should work on a menu', async({page}) => {
[ { role: 'menuitem', name: 'First Item' },
{ role: 'menuitem', name: 'Second Item' },
{ role: 'menuitem', name: 'Third Item' } ],
- orientation: options.WEBKIT() ? 'vertical' : undefined
+ orientation: options.WEBKIT ? 'vertical' : undefined
});
});
diff --git a/test/browser.spec.ts b/test/browser.spec.ts
index c9b8209aa0..960957e411 100644
--- a/test/browser.spec.ts
+++ b/test/browser.spec.ts
@@ -39,7 +39,7 @@ it('should throw upon second create new page', async function({browser}) {
it('version should work', async function({browser}) {
const version = browser.version();
- if (options.CHROMIUM())
+ if (options.CHROMIUM)
expect(version.match(/^\d+\.\d+\.\d+\.\d+$/)).toBeTruthy();
else
expect(version.match(/^\d+\.\d+/)).toBeTruthy();
diff --git a/test/browsercontext-add-cookies.spec.ts b/test/browsercontext-add-cookies.spec.ts
index f90544f778..750f5a7566 100644
--- a/test/browsercontext-add-cookies.spec.ts
+++ b/test/browsercontext-add-cookies.spec.ts
@@ -325,7 +325,7 @@ it('should(not) block third party cookies', async({context, page, server}) => {
}, server.CROSS_PROCESS_PREFIX + '/grid.html');
await page.frames()[1].evaluate(`document.cookie = 'username=John Doe'`);
await page.waitForTimeout(2000);
- const allowsThirdParty = options.CHROMIUM() || options.FIREFOX();
+ const allowsThirdParty = options.CHROMIUM || options.FIREFOX;
const cookies = await context.cookies(server.CROSS_PROCESS_PREFIX + '/grid.html');
if (allowsThirdParty) {
expect(cookies).toEqual([
diff --git a/test/browsercontext-basic.spec.ts b/test/browsercontext-basic.spec.ts
index 62ee4658bb..21553f1e5b 100644
--- a/test/browsercontext-basic.spec.ts
+++ b/test/browsercontext-basic.spec.ts
@@ -184,7 +184,7 @@ it('should disable javascript', async({browser}) => {
await page.goto('data:text/html, ');
let error = null;
await page.evaluate('something').catch(e => error = e);
- if (options.WEBKIT())
+ if (options.WEBKIT)
expect(error.message).toContain('Can\'t find variable: something');
else
expect(error.message).toContain('something is not defined');
diff --git a/test/browsercontext-cookies.spec.ts b/test/browsercontext-cookies.spec.ts
index 6415e05e95..05c1e4c88b 100644
--- a/test/browsercontext-cookies.spec.ts
+++ b/test/browsercontext-cookies.spec.ts
@@ -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 cooki
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();
diff --git a/test/browsercontext-credentials.spec.ts b/test/browsercontext-credentials.spec.ts
index 9de68b5e63..f535950127 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 credential
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();
@@ -48,7 +48,7 @@ it('should work with correct credentials', async({browser, server}) => {
await context.close();
});
-it.fail(options.CHROMIUM() && !options.HEADLESS)('should fail with wrong credentials', async({browser, server}) => {
+it.fail(options.CHROMIUM && !options.HEADLESS)('should fail with wrong credentials', async({browser, server}) => {
server.setAuth('/empty.html', 'user', 'pass');
const context = await browser.newContext({
httpCredentials: { username: 'foo', password: 'bar' }
diff --git a/test/browsercontext-device.spec.ts b/test/browsercontext-device.spec.ts
index 4e22c69d3b..7d48c5e14e 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-locale.spec.ts b/test/browsercontext-locale.spec.ts
index 865a77cd96..14e5b80fdb 100644
--- a/test/browsercontext-locale.spec.ts
+++ b/test/browsercontext-locale.spec.ts
@@ -137,7 +137,7 @@ it('should be isolated between contexts', async({browser, server}) => {
]);
});
-it.fail(options.FIREFOX())('should not change default locale in another context', async({browser, server}) => {
+it.fail(options.FIREFOX)('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 67bd58526e..de62560d50 100644
--- a/test/browsercontext-page-event.spec.ts
+++ b/test/browsercontext-page-event.spec.ts
@@ -156,7 +156,7 @@ it('should fire page lifecycle events', async function({browser, server}) {
await context.close();
});
-it.fail(options.WEBKIT())('should work with Shift-clicking', async({browser, server}) => {
+it.fail(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.fail(options.WEBKIT())('should work with Shift-clicking', async({browser, ser
await context.close();
});
-it.fail(options.WEBKIT() || options.FIREFOX())('should work with Ctrl-clicking', async({browser, server}) => {
+it.fail(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-timezone-id.spec.ts b/test/browsercontext-timezone-id.spec.ts
index 6e726bd538..91d88f41dc 100644
--- a/test/browsercontext-timezone-id.spec.ts
+++ b/test/browsercontext-timezone-id.spec.ts
@@ -69,7 +69,7 @@ it('should work for multiple pages sharing same process', async({browser, server
await context.close();
});
-it.fail(options.FIREFOX())('should not change default timezone in another context', async({browser, server}) => {
+it.fail(options.FIREFOX)('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-viewport-mobile.spec.ts b/test/browsercontext-viewport-mobile.spec.ts
index d39562bdc7..736e465e83 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,
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,
}
});
-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({playwrigh
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 touc
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({playwrig
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(
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({brows
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/browsertype-basic.spec.ts b/test/browsertype-basic.spec.ts
index ecefd54604..73229bc990 100644
--- a/test/browsertype-basic.spec.ts
+++ b/test/browsertype-basic.spec.ts
@@ -25,11 +25,11 @@ it.skip(Boolean(process.env.CRPATH || process.env.FFPATH || process.env.WKPATH))
});
it('browserType.name should work', async({browserType}) => {
- if (options.WEBKIT())
+ if (options.WEBKIT)
expect(browserType.name()).toBe('webkit');
- else if (options.FIREFOX())
+ else if (options.FIREFOX)
expect(browserType.name()).toBe('firefox');
- else if (options.CHROMIUM())
+ else if (options.CHROMIUM)
expect(browserType.name()).toBe('chromium');
else
throw new Error('Unknown browser');
diff --git a/test/browsertype-connect.spec.ts b/test/browsertype-connect.spec.ts
index b1188f2a67..030c4eb02c 100644
--- a/test/browsertype-connect.spec.ts
+++ b/test/browsertype-connect.spec.ts
@@ -36,7 +36,7 @@ it.skip(options.WIRE).slow()('should be able to reconnect to a browser', async({
await browserServer.close();
});
-it.skip(options.WIRE).fail(options.CHROMIUM() && WIN).slow()('should handle exceptions during connect', async({browserType, defaultBrowserOptions}) => {
+it.skip(options.WIRE).fail(options.CHROMIUM && WIN).slow()('should handle exceptions during connect', async({browserType, defaultBrowserOptions}) => {
const browserServer = await browserType.launchServer(defaultBrowserOptions);
const __testHookBeforeCreateBrowser = () => { throw new Error('Dummy') };
const error = await browserType.connect({ wsEndpoint: browserServer.wsEndpoint(), __testHookBeforeCreateBrowser } as any).catch(e => e);
diff --git a/test/browsertype-launch.spec.ts b/test/browsertype-launch.spec.ts
index 87dc19a6ae..3e61877418 100644
--- a/test/browsertype-launch.spec.ts
+++ b/test/browsertype-launch.spec.ts
@@ -36,7 +36,7 @@ it('should throw if userDataDir option is passed', async({browserType, defaultBr
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);
diff --git a/test/capabilities.spec.ts b/test/capabilities.spec.ts
index 14093c9a2a..a067c99b92 100644
--- a/test/capabilities.spec.ts
+++ b/test/capabilities.spec.ts
@@ -17,7 +17,7 @@
import url from 'url';
import { options } from './playwright.fixtures';
-it.fail(options.WEBKIT() && WIN)('Web Assembly should work', async function({page, server}) {
+it.fail(options.WEBKIT && WIN)('Web Assembly should work', async function({page, server}) {
await page.goto(server.PREFIX + '/wasm/table2.html');
expect(await page.evaluate('loadTable()')).toBe('42, 83');
});
@@ -48,13 +48,13 @@ it('should respect CSP', async({page, server}) => {
expect(await page.evaluate(() => window['testStatus'])).toBe('SUCCESS');
});
-it.fail(options.WEBKIT() && (WIN || LINUX))('should play video', async({page, asset}) => {
+it.fail(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.
//
// Safari only plays mp4 so we test WebKit with an .mp4 clip.
- const fileName = options.WEBKIT() ? 'video_mp4.html' : 'video.html';
+ const fileName = options.WEBKIT ? 'video_mp4.html' : 'video.html';
const absolutePath = asset(fileName);
// Our test server doesn't support range requests required to play on Mac,
// so we load the page using a file url.
diff --git a/test/channels.spec.ts b/test/channels.spec.ts
index 192963aae1..c4774ff9c5 100644
--- a/test/channels.spec.ts
+++ b/test/channels.spec.ts
@@ -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: [
diff --git a/test/chromium-css-coverage.spec.ts b/test/chromium-css-coverage.spec.ts
index cf64cc91ef..ae4e76632e 100644
--- a/test/chromium-css-coverage.spec.ts
+++ b/test/chromium-css-coverage.spec.ts
@@ -15,7 +15,7 @@
*/
import { options } from './playwright.fixtures';
-it.skip(!options.CHROMIUM())('should work', async function({browserType, page, server}) {
+it.skip(!options.CHROMIUM)('should work', async function({browserType, page, server}) {
await page.coverage.startCSSCoverage();
await page.goto(server.PREFIX + '/csscoverage/simple.html');
const coverage = await page.coverage.stopCSSCoverage();
@@ -28,7 +28,7 @@ it.skip(!options.CHROMIUM())('should work', async function({browserType, page, s
expect(coverage[0].text.substring(range.start, range.end)).toBe('div { color: green; }');
});
-it.skip(!options.CHROMIUM())('should report sourceURLs', async function({page, server}) {
+it.skip(!options.CHROMIUM)('should report sourceURLs', async function({page, server}) {
await page.coverage.startCSSCoverage();
await page.goto(server.PREFIX + '/csscoverage/sourceurl.html');
const coverage = await page.coverage.stopCSSCoverage();
@@ -36,7 +36,7 @@ it.skip(!options.CHROMIUM())('should report sourceURLs', async function({page, s
expect(coverage[0].url).toBe('nicename.css');
});
-it.skip(!options.CHROMIUM())('should report multiple stylesheets', async function({page, server}) {
+it.skip(!options.CHROMIUM)('should report multiple stylesheets', async function({page, server}) {
await page.coverage.startCSSCoverage();
await page.goto(server.PREFIX + '/csscoverage/multiple.html');
const coverage = await page.coverage.stopCSSCoverage();
@@ -46,7 +46,7 @@ it.skip(!options.CHROMIUM())('should report multiple stylesheets', async functio
expect(coverage[1].url).toContain('/csscoverage/stylesheet2.css');
});
-it.skip(!options.CHROMIUM())('should report stylesheets that have no coverage', async function({page, server}) {
+it.skip(!options.CHROMIUM)('should report stylesheets that have no coverage', async function({page, server}) {
await page.coverage.startCSSCoverage();
await page.goto(server.PREFIX + '/csscoverage/unused.html');
const coverage = await page.coverage.stopCSSCoverage();
@@ -55,7 +55,7 @@ it.skip(!options.CHROMIUM())('should report stylesheets that have no coverage',
expect(coverage[0].ranges.length).toBe(0);
});
-it.skip(!options.CHROMIUM())('should work with media queries', async function({page, server}) {
+it.skip(!options.CHROMIUM)('should work with media queries', async function({page, server}) {
await page.coverage.startCSSCoverage();
await page.goto(server.PREFIX + '/csscoverage/media.html');
const coverage = await page.coverage.stopCSSCoverage();
@@ -66,7 +66,7 @@ it.skip(!options.CHROMIUM())('should work with media queries', async function({p
]);
});
-it.skip(!options.CHROMIUM())('should work with complicated usecases', async function({page, server}) {
+it.skip(!options.CHROMIUM)('should work with complicated usecases', async function({page, server}) {
await page.coverage.startCSSCoverage();
await page.goto(server.PREFIX + '/csscoverage/involved.html');
const coverage: any = await page.coverage.stopCSSCoverage();
@@ -90,7 +90,7 @@ it.skip(!options.CHROMIUM())('should work with complicated usecases', async func
);
});
-it.skip(!options.CHROMIUM())('should ignore injected stylesheets', async function({page, server}) {
+it.skip(!options.CHROMIUM)('should ignore injected stylesheets', async function({page, server}) {
await page.coverage.startCSSCoverage();
await page.addStyleTag({content: 'body { margin: 10px;}'});
// trigger style recalc
@@ -100,7 +100,7 @@ it.skip(!options.CHROMIUM())('should ignore injected stylesheets', async functio
expect(coverage.length).toBe(0);
});
-it.skip(!options.CHROMIUM())('should report stylesheets across navigations', async function({page, server}) {
+it.skip(!options.CHROMIUM)('should report stylesheets across navigations', async function({page, server}) {
await page.coverage.startCSSCoverage({resetOnNavigation: false});
await page.goto(server.PREFIX + '/csscoverage/multiple.html');
await page.goto(server.EMPTY_PAGE);
@@ -108,7 +108,7 @@ it.skip(!options.CHROMIUM())('should report stylesheets across navigations', asy
expect(coverage.length).toBe(2);
});
-it.skip(!options.CHROMIUM())('should NOT report scripts across navigations', async function({page, server}) {
+it.skip(!options.CHROMIUM)('should NOT report scripts across navigations', async function({page, server}) {
await page.coverage.startCSSCoverage(); // Enabled by default.
await page.goto(server.PREFIX + '/csscoverage/multiple.html');
await page.goto(server.EMPTY_PAGE);
@@ -116,7 +116,7 @@ it.skip(!options.CHROMIUM())('should NOT report scripts across navigations', asy
expect(coverage.length).toBe(0);
});
-it.skip(!options.CHROMIUM())('should work with a recently loaded stylesheet', async function({page, server}) {
+it.skip(!options.CHROMIUM)('should work with a recently loaded stylesheet', async function({page, server}) {
await page.coverage.startCSSCoverage();
await page.evaluate(async url => {
document.body.textContent = 'hello, world';
diff --git a/test/chromium-js-coverage.spec.ts b/test/chromium-js-coverage.spec.ts
index 1c298fd1d7..23202bd2a8 100644
--- a/test/chromium-js-coverage.spec.ts
+++ b/test/chromium-js-coverage.spec.ts
@@ -15,11 +15,11 @@
*/
import { options } from './playwright.fixtures';
-it.skip(options.CHROMIUM())('should be missing', async function({page, server}) {
+it.skip(options.CHROMIUM)('should be missing', async function({page, server}) {
expect(page.coverage).toBe(null);
});
-it.skip(!options.CHROMIUM())('should work', async function({browserType, page, server}) {
+it.skip(!options.CHROMIUM)('should work', async function({browserType, page, server}) {
await page.coverage.startJSCoverage();
await page.goto(server.PREFIX + '/jscoverage/simple.html', { waitUntil: 'load' });
const coverage = await page.coverage.stopJSCoverage();
@@ -28,7 +28,7 @@ it.skip(!options.CHROMIUM())('should work', async function({browserType, page, s
expect(coverage[0].functions.find(f => f.functionName === 'foo').ranges[0].count).toEqual(1);
});
-it.skip(!options.CHROMIUM())('should report sourceURLs', async function({page, server}) {
+it.skip(!options.CHROMIUM)('should report sourceURLs', async function({page, server}) {
await page.coverage.startJSCoverage();
await page.goto(server.PREFIX + '/jscoverage/sourceurl.html');
const coverage = await page.coverage.stopJSCoverage();
@@ -36,14 +36,14 @@ it.skip(!options.CHROMIUM())('should report sourceURLs', async function({page, s
expect(coverage[0].url).toBe('nicename.js');
});
-it.skip(!options.CHROMIUM())('should ignore eval() scripts by default', async function({page, server}) {
+it.skip(!options.CHROMIUM)('should ignore eval() scripts by default', async function({page, server}) {
await page.coverage.startJSCoverage();
await page.goto(server.PREFIX + '/jscoverage/eval.html');
const coverage = await page.coverage.stopJSCoverage();
expect(coverage.length).toBe(1);
});
-it.skip(!options.CHROMIUM())('shouldn\'t ignore eval() scripts if reportAnonymousScripts is true', async function({page, server}) {
+it.skip(!options.CHROMIUM)('shouldn\'t ignore eval() scripts if reportAnonymousScripts is true', async function({page, server}) {
await page.coverage.startJSCoverage({reportAnonymousScripts: true});
await page.goto(server.PREFIX + '/jscoverage/eval.html');
const coverage = await page.coverage.stopJSCoverage();
@@ -51,7 +51,7 @@ it.skip(!options.CHROMIUM())('shouldn\'t ignore eval() scripts if reportAnonymou
expect(coverage.length).toBe(2);
});
-it.skip(!options.CHROMIUM())('should ignore playwright internal scripts if reportAnonymousScripts is true', async function({page, server}) {
+it.skip(!options.CHROMIUM)('should ignore playwright internal scripts if reportAnonymousScripts is true', async function({page, server}) {
await page.coverage.startJSCoverage({reportAnonymousScripts: true});
await page.goto(server.EMPTY_PAGE);
await page.evaluate('console.log("foo")');
@@ -60,7 +60,7 @@ it.skip(!options.CHROMIUM())('should ignore playwright internal scripts if repor
expect(coverage.length).toBe(0);
});
-it.skip(!options.CHROMIUM())('should report multiple scripts', async function({page, server}) {
+it.skip(!options.CHROMIUM)('should report multiple scripts', async function({page, server}) {
await page.coverage.startJSCoverage();
await page.goto(server.PREFIX + '/jscoverage/multiple.html');
const coverage = await page.coverage.stopJSCoverage();
@@ -70,7 +70,7 @@ it.skip(!options.CHROMIUM())('should report multiple scripts', async function({p
expect(coverage[1].url).toContain('/jscoverage/script2.js');
});
-it.skip(!options.CHROMIUM())('should report scripts across navigations when disabled', async function({page, server}) {
+it.skip(!options.CHROMIUM)('should report scripts across navigations when disabled', async function({page, server}) {
await page.coverage.startJSCoverage({resetOnNavigation: false});
await page.goto(server.PREFIX + '/jscoverage/multiple.html');
await page.goto(server.EMPTY_PAGE);
@@ -78,7 +78,7 @@ it.skip(!options.CHROMIUM())('should report scripts across navigations when disa
expect(coverage.length).toBe(2);
});
-it.skip(!options.CHROMIUM())('should NOT report scripts across navigations when enabled', async function({page, server}) {
+it.skip(!options.CHROMIUM)('should NOT report scripts across navigations when enabled', async function({page, server}) {
await page.coverage.startJSCoverage(); // Enabled by default.
await page.goto(server.PREFIX + '/jscoverage/multiple.html');
await page.goto(server.EMPTY_PAGE);
@@ -86,7 +86,7 @@ it.skip(!options.CHROMIUM())('should NOT report scripts across navigations when
expect(coverage.length).toBe(0);
});
-it.skip(!options.CHROMIUM())('should not hang when there is a debugger statement', async function({page, server}) {
+it.skip(!options.CHROMIUM)('should not hang when there is a debugger statement', async function({page, server}) {
await page.coverage.startJSCoverage();
await page.goto(server.EMPTY_PAGE);
await page.evaluate(() => {
diff --git a/test/chromium/chromium.spec.ts b/test/chromium/chromium.spec.ts
index 3e71a27e3e..796feb6659 100644
--- a/test/chromium/chromium.spec.ts
+++ b/test/chromium/chromium.spec.ts
@@ -16,7 +16,7 @@
import { options } from '../playwright.fixtures';
import { ChromiumBrowserContext } from '../..';
-it.skip(!options.CHROMIUM())('should create a worker from a service worker', async({page, server, context}) => {
+it.skip(!options.CHROMIUM)('should create a worker from a service worker', async({page, server, context}) => {
const [worker] = await Promise.all([
(context as ChromiumBrowserContext).waitForEvent('serviceworker'),
page.goto(server.PREFIX + '/serviceworkers/empty/sw.html')
@@ -24,7 +24,7 @@ it.skip(!options.CHROMIUM())('should create a worker from a service worker', asy
expect(await worker.evaluate(() => self.toString())).toBe('[object ServiceWorkerGlobalScope]');
});
-it.skip(!options.CHROMIUM())('serviceWorkers() should return current workers', async({page, server, context}) => {
+it.skip(!options.CHROMIUM)('serviceWorkers() should return current workers', async({page, server, context}) => {
const [worker1] = await Promise.all([
(context as ChromiumBrowserContext).waitForEvent('serviceworker'),
page.goto(server.PREFIX + '/serviceworkers/empty/sw.html')
@@ -42,7 +42,7 @@ it.skip(!options.CHROMIUM())('serviceWorkers() should return current workers', a
expect(workers).toContain(worker2);
});
-it.skip(!options.CHROMIUM())('should not create a worker from a shared worker', async({page, server, context}) => {
+it.skip(!options.CHROMIUM)('should not create a worker from a shared worker', async({page, server, context}) => {
await page.goto(server.EMPTY_PAGE);
let serviceWorkerCreated;
(context as ChromiumBrowserContext).once('serviceworker', () => serviceWorkerCreated = true);
@@ -52,7 +52,7 @@ it.skip(!options.CHROMIUM())('should not create a worker from a shared worker',
expect(serviceWorkerCreated).not.toBeTruthy();
});
-it.skip(!options.CHROMIUM())('should close service worker together with the context', async({browser, server}) => {
+it.skip(!options.CHROMIUM)('should close service worker together with the context', async({browser, server}) => {
const context = await browser.newContext() as ChromiumBrowserContext;
const page = await context.newPage();
const [worker] = await Promise.all([
@@ -66,7 +66,7 @@ it.skip(!options.CHROMIUM())('should close service worker together with the cont
expect(messages.join('|')).toBe('worker|context');
});
-it.skip(!options.CHROMIUM())('Page.route should work with intervention headers', async({server, page}) => {
+it.skip(!options.CHROMIUM)('Page.route should work with intervention headers', async({server, page}) => {
server.setRoute('/intervention', (req, res) => res.end(`
');
let error = null;
await page.evaluate('something').catch(e => error = e);
- if (options.WEBKIT())
+ if (options.WEBKIT)
expect(error.message).toContain('Can\'t find variable: something');
else
expect(error.message).toContain('something is not defined');
@@ -217,7 +217,7 @@ it('should support hasTouch option', async ({server, launchPersistent}) => {
expect(await page.evaluate(() => 'ontouchstart' in window)).toBe(true);
});
-it.skip(options.FIREFOX())('should work in persistent context', async ({server, launchPersistent}) => {
+it.skip(options.FIREFOX)('should work in persistent context', async ({server, launchPersistent}) => {
// Firefox does not support mobile.
const {page, context} = await launchPersistent({viewport: {width: 320, height: 480}, isMobile: true});
await page.goto(server.PREFIX + '/empty.html');
@@ -302,7 +302,7 @@ it.slow()('should restore state from userDataDir', async({browserType, defaultBr
await removeUserDataDir(userDataDir2);
});
-it.fail(options.CHROMIUM() && (WIN || MAC)).slow()('should restore cookies from userDataDir', async({browserType, defaultBrowserOptions, server, launchPersistent}) => {
+it.fail(options.CHROMIUM && (WIN || MAC)).slow()('should restore cookies from userDataDir', async({browserType, defaultBrowserOptions, server, launchPersistent}) => {
const userDataDir = await makeUserDataDir();
const browserContext = await browserType.launchPersistentContext(userDataDir, defaultBrowserOptions);
const page = await browserContext.newPage();
@@ -338,7 +338,7 @@ it('should have default URL when launching browser', async ({launchPersistent})
expect(urls).toEqual(['about:blank']);
});
-it.skip(options.FIREFOX())('should throw if page argument is passed', async ({browserType, defaultBrowserOptions, server, tmpDir}) => {
+it.skip(options.FIREFOX)('should throw if page argument is passed', async ({browserType, defaultBrowserOptions, server, tmpDir}) => {
const options = {...defaultBrowserOptions, args: [server.EMPTY_PAGE] };
const error = await browserType.launchPersistentContext(tmpDir, options).catch(e => e);
expect(error.message).toContain('can not specify page');
@@ -381,7 +381,7 @@ it('should fire close event for a persistent context', async({launchPersistent})
expect(closed).toBe(true);
});
-it.skip(!options.CHROMIUM())('coverage should work', async ({server, launchPersistent}) => {
+it.skip(!options.CHROMIUM)('coverage should work', async ({server, launchPersistent}) => {
const {page, context} = await launchPersistent();
await page.coverage.startJSCoverage();
await page.goto(server.PREFIX + '/jscoverage/simple.html', { waitUntil: 'load' });
@@ -391,7 +391,7 @@ it.skip(!options.CHROMIUM())('coverage should work', async ({server, launchPersi
expect(coverage[0].functions.find(f => f.functionName === 'foo').ranges[0].count).toEqual(1);
});
-it.skip(options.CHROMIUM())('coverage should be missing', async ({launchPersistent}) => {
+it.skip(options.CHROMIUM)('coverage should be missing', async ({launchPersistent}) => {
const {page, context} = await launchPersistent();
expect(page.coverage).toBe(null);
});
diff --git a/test/dialog.spec.ts b/test/dialog.spec.ts
index 8890b5b8b1..1bd6ece5c2 100644
--- a/test/dialog.spec.ts
+++ b/test/dialog.spec.ts
@@ -62,7 +62,7 @@ it('should dismiss the confirm prompt', async({page}) => {
expect(result).toBe(false);
});
-it.fail(options.WEBKIT())('should be able to close context with open alert', async({browser}) => {
+it.fail(options.WEBKIT)('should be able to close context with open alert', async({browser}) => {
const context = await browser.newContext();
const page = await context.newPage();
const alertPromise = page.waitForEvent('dialog');
diff --git a/test/dispatchevent.spec.ts b/test/dispatchevent.spec.ts
index ceb8ba5caf..5698f5e510 100644
--- a/test/dispatchevent.spec.ts
+++ b/test/dispatchevent.spec.ts
@@ -126,7 +126,7 @@ it('should be atomic', async({playwright, page}) => {
expect(await page.evaluate(() => window['_clicked'])).toBe(true);
});
-it.fail(options.WEBKIT())('should dispatch drag drop events', async({page, server}) => {
+it.fail(options.WEBKIT)('should dispatch drag drop events', async({page, server}) => {
await page.goto(server.PREFIX + '/drag-n-drop.html');
const dataTransfer = await page.evaluateHandle(() => new DataTransfer());
await page.dispatchEvent('#source', 'dragstart', { dataTransfer });
@@ -138,7 +138,7 @@ it.fail(options.WEBKIT())('should dispatch drag drop events', async({page, serve
}, {source, target})).toBeTruthy();
});
-it.fail(options.WEBKIT())('should dispatch drag drop events', async({page, server}) => {
+it.fail(options.WEBKIT)('should dispatch drag drop events', async({page, server}) => {
await page.goto(server.PREFIX + '/drag-n-drop.html');
const dataTransfer = await page.evaluateHandle(() => new DataTransfer());
const source = await page.$('#source');
diff --git a/test/download.spec.ts b/test/download.spec.ts
index d6673b37ae..ebebecd633 100644
--- a/test/download.spec.ts
+++ b/test/download.spec.ts
@@ -217,7 +217,7 @@ it(`should report download path within page.on('download', …) handler for Blob
expect(fs.readFileSync(path).toString()).toBe('Hello world');
await page.close();
})
-it.fail(options.FIREFOX() || options.WEBKIT())('should report alt-click downloads', async({browser, server}) => {
+it.fail(options.FIREFOX || options.WEBKIT)('should report alt-click downloads', async({browser, server}) => {
// Firefox does not download on alt-click by default.
// Our WebKit embedder does not download on alt-click, although Safari does.
server.setRoute('/download', (req, res) => {
@@ -238,7 +238,7 @@ it.fail(options.FIREFOX() || options.WEBKIT())('should report alt-click download
await page.close();
});
-it.fail(options.CHROMIUM() && !options.HEADLESS)('should report new window downloads', async({browser, server}) => {
+it.fail(options.CHROMIUM && !options.HEADLESS)('should report new window downloads', async({browser, server}) => {
// TODO: - the test fails in headful Chromium as the popup page gets closed along
// with the session before download completed event arrives.
// - WebKit doesn't close the popup page
diff --git a/test/downloads-path.spec.ts b/test/downloads-path.spec.ts
index ab2c783889..4eee958828 100644
--- a/test/downloads-path.spec.ts
+++ b/test/downloads-path.spec.ts
@@ -26,7 +26,7 @@ import {mkdtempAsync, removeFolderAsync} from './utils';
import { Browser, BrowserContext } from '..';
declare global {
- interface FixtureState {
+ interface TestState {
downloadsBrowser: Browser;
persistentDownloadsContext: BrowserContext;
}
diff --git a/test/electron/electron-app.spec.ts b/test/electron/electron-app.spec.ts
index 9da0408db5..3c59d399a4 100644
--- a/test/electron/electron-app.spec.ts
+++ b/test/electron/electron-app.spec.ts
@@ -21,7 +21,7 @@ import path from 'path';
const electronName = process.platform === 'win32' ? 'electron.cmd' : 'electron';
-it.skip(!options.CHROMIUM())('should fire close event', async ({ playwright }) => {
+it.skip(!options.CHROMIUM)('should fire close event', async ({ playwright }) => {
const electronPath = path.join(__dirname, '..', '..', 'node_modules', '.bin', electronName);
const application = await playwright.electron.launch(electronPath, {
args: [path.join(__dirname, 'testApp.js')],
@@ -36,12 +36,12 @@ it.skip(!options.CHROMIUM())('should fire close event', async ({ playwright }) =
expect(events.join('|')).toBe('context|application');
});
-it.skip(!options.CHROMIUM())('should script application', async ({ application }) => {
+it.skip(!options.CHROMIUM)('should script application', async ({ application }) => {
const appPath = await application.evaluate(async ({ app }) => app.getAppPath());
expect(appPath).toContain('electron');
});
-it.skip(!options.CHROMIUM())('should create window', async ({ application }) => {
+it.skip(!options.CHROMIUM)('should create window', async ({ application }) => {
const [ page ] = await Promise.all([
application.waitForEvent('window'),
application.evaluate(({ BrowserWindow }) => {
@@ -53,13 +53,13 @@ it.skip(!options.CHROMIUM())('should create window', async ({ application }) =>
expect(await page.title()).toBe('Hello World 1');
});
-it.skip(!options.CHROMIUM())('should create window 2', async ({ application }) => {
+it.skip(!options.CHROMIUM)('should create window 2', async ({ application }) => {
const page = await application.newBrowserWindow({ width: 800, height: 600 });
await page.goto('data:text/html,