`);
const golden = {
- role: isFirefox ? 'document' : 'WebArea',
+ role: browserName === 'firefox' ? 'document' : 'WebArea',
name: '',
children: [{
role: 'tab',
@@ -139,14 +139,14 @@ it('should not report text nodes inside controls', async function({page, isFiref
expect(await page.accessibility.snapshot()).toEqual(golden);
});
-it('rich text editable fields should have children', async function({page, isFirefox, browserName}) {
+it('rich text editable fields should have children', async function({page, browserName}) {
it.skip(browserName === 'webkit', 'WebKit rich text accessibility is iffy');
await page.setContent(`
Edit this image:
`);
- const golden = isFirefox ? {
+ const golden = browserName === 'firefox' ? {
role: 'section',
name: '',
children: [{
@@ -172,14 +172,14 @@ it('rich text editable fields should have children', async function({page, isFir
expect(snapshot.children[0]).toEqual(golden);
});
-it('rich text editable fields with role should have children', async function({page, isFirefox, isWebKit, isChromium, browserMajorVersion}) {
- it.skip(isWebKit, 'WebKit rich text accessibility is iffy');
+it('rich text editable fields with role should have children', async function({page, browserName, browserMajorVersion}) {
+ it.skip(browserName === 'webkit', 'WebKit rich text accessibility is iffy');
await page.setContent(`
Edit this image:
`);
- const golden = isFirefox ? {
+ const golden = browserName === 'firefox' ? {
role: 'textbox',
name: '',
value: 'Edit this image: my fake image',
@@ -190,7 +190,7 @@ it('rich text editable fields with role should have children', async function({p
} : {
role: 'textbox',
name: '',
- multiline: (isChromium && browserMajorVersion >= 92) ? true : undefined,
+ multiline: (browserName === 'chromium' && browserMajorVersion >= 92) ? true : undefined,
value: 'Edit this image: ',
children: [{
role: 'text',
@@ -204,17 +204,17 @@ it('rich text editable fields with role should have children', async function({p
expect(snapshot.children[0]).toEqual(golden);
});
-it('non editable textbox with role and tabIndex and label should not have children', async function({page, isChromium, isFirefox}) {
+it('non editable textbox with role and tabIndex and label should not have children', async function({page, browserName}) {
await page.setContent(`
this is the inner content
`);
- const golden = isFirefox ? {
+ const golden = (browserName === 'firefox') ? {
role: 'textbox',
name: 'my favorite textbox',
value: 'this is the inner content yo'
- } : isChromium ? {
+ } : (browserName === 'chromium') ? {
role: 'textbox',
name: 'my favorite textbox',
value: 'this is the inner content '
@@ -242,13 +242,13 @@ it('checkbox with and tabIndex and label should not have children', async functi
expect(snapshot.children[0]).toEqual(golden);
});
-it('checkbox without label should not have children', async ({page, isFirefox}) => {
+it('checkbox without label should not have children', async ({page, browserName}) => {
await page.setContent(`
this is the inner content
`);
- const golden = isFirefox ? {
+ const golden = browserName === 'firefox' ? {
role: 'checkbox',
name: 'this is the inner content yo',
checked: true
@@ -282,7 +282,7 @@ it('should work an input', async ({page}) => {
});
});
-it('should work on a menu', async ({page, isWebKit}) => {
+it('should work on a menu', async ({page, browserName}) => {
await page.setContent(`
First Item
@@ -299,7 +299,7 @@ it('should work on a menu', async ({page, isWebKit}) => {
[ { role: 'menuitem', name: 'First Item' },
{ role: 'menuitem', name: 'Second Item' },
{ role: 'menuitem', name: 'Third Item' } ],
- orientation: isWebKit ? 'vertical' : undefined
+ orientation: browserName === 'webkit' ? 'vertical' : undefined
});
});
diff --git a/tests/page/page-add-script-tag.spec.ts b/tests/page/page-add-script-tag.spec.ts
index 5e61b6d58d..dfe46774e6 100644
--- a/tests/page/page-add-script-tag.spec.ts
+++ b/tests/page/page-add-script-tag.spec.ts
@@ -74,8 +74,8 @@ it('should work with a path', async ({page, server, asset}) => {
expect(await page.evaluate(() => window['__injected'])).toBe(42);
});
-it('should include sourceURL when path is provided', async ({page, server, isWebKit, asset}) => {
- it.skip(isWebKit);
+it('should include sourceURL when path is provided', async ({page, server, browserName, asset}) => {
+ it.skip(browserName === 'webkit');
await page.goto(server.EMPTY_PAGE);
await page.addScriptTag({ path: asset('injectedfile.js') });
diff --git a/tests/page/page-basic.spec.ts b/tests/page/page-basic.spec.ts
index aa59aafaf0..328bb33d53 100644
--- a/tests/page/page-basic.spec.ts
+++ b/tests/page/page-basic.spec.ts
@@ -182,7 +182,7 @@ it('page.frame should respect url', async function({page, server}) {
expect(page.frame({ url: /empty/ }).url()).toBe(server.EMPTY_PAGE);
});
-it('should have sane user agent', async ({page, isChromium, isFirefox, isElectron, isAndroid}) => {
+it('should have sane user agent', async ({page, browserName, isElectron, isAndroid}) => {
it.skip(isAndroid);
it.skip(isElectron);
@@ -199,7 +199,7 @@ it('should have sane user agent', async ({page, isChromium, isFirefox, isElectro
// Second part in parenthesis is platform - ignore it.
// Third part for Firefox is the last one and encodes engine and browser versions.
- if (isFirefox) {
+ if (browserName === 'firefox') {
const [engine, browser] = part3.split(' ');
expect(engine.startsWith('Gecko')).toBe(true);
expect(browser.startsWith('Firefox')).toBe(true);
@@ -213,7 +213,7 @@ it('should have sane user agent', async ({page, isChromium, isFirefox, isElectro
// 5th part encodes real browser name and engine version.
const [engine, browser] = part5.split(' ');
expect(browser.startsWith('Safari/')).toBe(true);
- if (isChromium)
+ if (browserName === 'chromium')
expect(engine.includes('Chrome/')).toBe(true);
else
expect(engine.startsWith('Version/')).toBe(true);
diff --git a/tests/page/page-click-scroll.spec.ts b/tests/page/page-click-scroll.spec.ts
index 7c731ae1e5..3ea5d71b69 100644
--- a/tests/page/page-click-scroll.spec.ts
+++ b/tests/page/page-click-scroll.spec.ts
@@ -16,8 +16,8 @@
import { test as it } from './pageTest';
-it('should not hit scroll bar', async ({page, isAndroid, isWebKit, platform}) => {
- it.fixme(isWebKit && platform === 'darwin');
+it('should not hit scroll bar', async ({page, isAndroid, browserName, platform}) => {
+ it.fixme(browserName === 'webkit' && platform === 'darwin');
it.skip(isAndroid);
await page.setContent(`
diff --git a/tests/page/page-click.spec.ts b/tests/page/page-click.spec.ts
index 46d826b9dc..9a5c4ef0c0 100644
--- a/tests/page/page-click.spec.ts
+++ b/tests/page/page-click.spec.ts
@@ -306,8 +306,8 @@ it('should click the button inside an iframe', async ({page, server}) => {
expect(await frame.evaluate(() => window['result'])).toBe('Clicked');
});
-it('should click the button with fixed position inside an iframe', async ({page, server, isChromium, isWebKit}) => {
- it.fixme(isChromium || isWebKit);
+it('should click the button with fixed position inside an iframe', async ({page, server, browserName}) => {
+ it.fixme(browserName === 'chromium' || browserName === 'webkit');
// @see https://github.com/GoogleChrome/puppeteer/issues/4110
// @see https://bugs.chromium.org/p/chromium/issues/detail?id=986390
@@ -359,28 +359,28 @@ it('should click the button behind sticky header', async ({page}) => {
expect(await page.evaluate(() => window['__clicked'])).toBe(true);
});
-it('should click the button with px border with offset', async ({page, server, isWebKit}) => {
+it('should click the button with px border with offset', async ({page, server, browserName}) => {
await page.goto(server.PREFIX + '/input/button.html');
await page.$eval('button', button => button.style.borderWidth = '8px');
await page.click('button', { position: { x: 20, y: 10 } });
expect(await page.evaluate('result')).toBe('Clicked');
// Safari reports border-relative offsetX/offsetY.
- expect(await page.evaluate('offsetX')).toBe(isWebKit ? 20 + 8 : 20);
- expect(await page.evaluate('offsetY')).toBe(isWebKit ? 10 + 8 : 10);
+ expect(await page.evaluate('offsetX')).toBe(browserName === 'webkit' ? 20 + 8 : 20);
+ expect(await page.evaluate('offsetY')).toBe(browserName === 'webkit' ? 10 + 8 : 10);
});
-it('should click the button with em border with offset', async ({page, server, isWebKit}) => {
+it('should click the button with em border with offset', async ({page, server, browserName}) => {
await page.goto(server.PREFIX + '/input/button.html');
await page.$eval('button', button => button.style.borderWidth = '2em');
await page.$eval('button', button => button.style.fontSize = '12px');
await page.click('button', { position: { x: 20, y: 10 } });
expect(await page.evaluate('result')).toBe('Clicked');
// Safari reports border-relative offsetX/offsetY.
- expect(await page.evaluate('offsetX')).toBe(isWebKit ? 12 * 2 + 20 : 20);
- expect(await page.evaluate('offsetY')).toBe(isWebKit ? 12 * 2 + 10 : 10);
+ expect(await page.evaluate('offsetX')).toBe(browserName === 'webkit' ? 12 * 2 + 20 : 20);
+ expect(await page.evaluate('offsetY')).toBe(browserName === 'webkit' ? 12 * 2 + 10 : 10);
});
-it('should click a very large button with offset', async ({page, server, isWebKit, isAndroid}) => {
+it('should click a very large button with offset', async ({page, server, browserName, isAndroid}) => {
it.fixme(isAndroid);
await page.goto(server.PREFIX + '/input/button.html');
@@ -389,11 +389,11 @@ it('should click a very large button with offset', async ({page, server, isWebKi
await page.click('button', { position: { x: 1900, y: 1910 } });
expect(await page.evaluate(() => window['result'])).toBe('Clicked');
// Safari reports border-relative offsetX/offsetY.
- expect(await page.evaluate('offsetX')).toBe(isWebKit ? 1900 + 8 : 1900);
- expect(await page.evaluate('offsetY')).toBe(isWebKit ? 1910 + 8 : 1910);
+ expect(await page.evaluate('offsetX')).toBe(browserName === 'webkit' ? 1900 + 8 : 1900);
+ expect(await page.evaluate('offsetY')).toBe(browserName === 'webkit' ? 1910 + 8 : 1910);
});
-it('should click a button in scrolling container with offset', async ({page, server, isWebKit, isAndroid}) => {
+it('should click a button in scrolling container with offset', async ({page, server, browserName, isAndroid}) => {
it.fixme(isAndroid);
await page.goto(server.PREFIX + '/input/button.html');
@@ -411,8 +411,8 @@ it('should click a button in scrolling container with offset', async ({page, ser
await page.click('button', { position: { x: 1900, y: 1910 } });
expect(await page.evaluate(() => window['result'])).toBe('Clicked');
// Safari reports border-relative offsetX/offsetY.
- expect(await page.evaluate('offsetX')).toBe(isWebKit ? 1900 + 8 : 1900);
- expect(await page.evaluate('offsetY')).toBe(isWebKit ? 1910 + 8 : 1910);
+ expect(await page.evaluate('offsetX')).toBe(browserName === 'webkit' ? 1900 + 8 : 1900);
+ expect(await page.evaluate('offsetY')).toBe(browserName === 'webkit' ? 1910 + 8 : 1910);
});
it('should wait for stable position', async ({page, server}) => {
diff --git a/tests/page/page-drag.spec.ts b/tests/page/page-drag.spec.ts
index 54d8f3207a..910f3cf93d 100644
--- a/tests/page/page-drag.spec.ts
+++ b/tests/page/page-drag.spec.ts
@@ -31,7 +31,7 @@ it.describe('Drag and drop', () => {
expect(await page.$eval('#target', target => target.contains(document.querySelector('#source')))).toBe(true); // could not find source in target
});
- it('should send the right events', async ({server, page, isFirefox}) => {
+ it('should send the right events', async ({server, page, browserName}) => {
await page.goto(server.PREFIX + '/drag-n-drop.html');
const events = await trackEvents(await page.$('body'));
await page.hover('#source');
@@ -41,8 +41,8 @@ it.describe('Drag and drop', () => {
expect(await events.jsonValue()).toEqual([
'mousemove',
'mousedown',
- isFirefox ? 'dragstart' : 'mousemove',
- isFirefox ? 'mousemove' : 'dragstart',
+ browserName === 'firefox' ? 'dragstart' : 'mousemove',
+ browserName === 'firefox' ? 'mousemove' : 'dragstart',
'dragenter',
'dragover',
'drop',
@@ -50,7 +50,7 @@ it.describe('Drag and drop', () => {
]);
});
- it('should cancel on escape', async ({server, page, isFirefox}) => {
+ it('should cancel on escape', async ({server, page, browserName}) => {
await page.goto(server.PREFIX + '/drag-n-drop.html');
const events = await trackEvents(await page.$('body'));
await page.hover('#source');
@@ -62,8 +62,8 @@ it.describe('Drag and drop', () => {
expect(await events.jsonValue()).toEqual([
'mousemove',
'mousedown',
- isFirefox ? 'dragstart' : 'mousemove',
- isFirefox ? 'mousemove' : 'dragstart',
+ browserName === 'firefox' ? 'dragstart' : 'mousemove',
+ browserName === 'firefox' ? 'mousemove' : 'dragstart',
'dragenter',
'dragover',
'dragend',
@@ -74,7 +74,7 @@ it.describe('Drag and drop', () => {
it.describe('iframe', () => {
it.fixme('implement dragging with iframes');
- it('should drag into an iframe', async ({server, page, isFirefox}) => {
+ it('should drag into an iframe', async ({server, page, browserName}) => {
await page.goto(server.PREFIX + '/drag-n-drop.html');
const frame = await attachFrame(page, 'oopif',server.PREFIX + '/drag-n-drop.html');
const pageEvents = await trackEvents(await page.$('body'));
@@ -88,8 +88,8 @@ it.describe('Drag and drop', () => {
expect(await pageEvents.jsonValue()).toEqual([
'mousemove',
'mousedown',
- isFirefox ? 'dragstart' : 'mousemove',
- isFirefox ? 'mousemove' : 'dragstart',
+ browserName === 'firefox' ? 'dragstart' : 'mousemove',
+ browserName === 'firefox' ? 'mousemove' : 'dragstart',
]);
expect(await frameEvents.jsonValue()).toEqual([
'dragenter',
diff --git a/tests/page/page-evaluate.spec.ts b/tests/page/page-evaluate.spec.ts
index 99ed4cd3b2..942ef5308e 100644
--- a/tests/page/page-evaluate.spec.ts
+++ b/tests/page/page-evaluate.spec.ts
@@ -415,8 +415,8 @@ it('should not throw an error when evaluation does a navigation', async ({ page,
expect(result).toEqual([42]);
});
-it('should not throw an error when evaluation does a synchronous navigation and returns an object', async ({ page, server, isWebKit }) => {
- it.fixme(isWebKit);
+it('should not throw an error when evaluation does a synchronous navigation and returns an object', async ({ page, server, browserName }) => {
+ it.fixme(browserName === 'webkit');
// It is imporant to be on about:blank for sync reload.
const result = await page.evaluate(() => {
diff --git a/tests/page/page-event-network.spec.ts b/tests/page/page-event-network.spec.ts
index 76b597a6d3..e5c063e65c 100644
--- a/tests/page/page-event-network.spec.ts
+++ b/tests/page/page-event-network.spec.ts
@@ -41,7 +41,7 @@ it('Page.Events.Response', async ({page, server}) => {
expect(responses[0].request()).toBeTruthy();
});
-it('Page.Events.RequestFailed', async ({page, server, isChromium, isWebKit, isMac, isWindows}) => {
+it('Page.Events.RequestFailed', async ({page, server, browserName, isMac, isWindows}) => {
server.setRoute('/one-style.css', (req, res) => {
res.setHeader('Content-Type', 'text/css');
res.connection.destroy();
@@ -53,9 +53,9 @@ it('Page.Events.RequestFailed', async ({page, server, isChromium, isWebKit, isMa
expect(failedRequests[0].url()).toContain('one-style.css');
expect(await failedRequests[0].response()).toBe(null);
expect(failedRequests[0].resourceType()).toBe('stylesheet');
- if (isChromium) {
+ if (browserName === 'chromium') {
expect(failedRequests[0].failure().errorText).toBe('net::ERR_EMPTY_RESPONSE');
- } else if (isWebKit) {
+ } else if (browserName === 'webkit') {
if (isMac)
expect(failedRequests[0].failure().errorText).toBe('The network connection was lost.');
else if (isWindows)
diff --git a/tests/page/page-event-pageerror.spec.ts b/tests/page/page-event-pageerror.spec.ts
index 5cd532d8af..a208db3430 100644
--- a/tests/page/page-event-pageerror.spec.ts
+++ b/tests/page/page-event-pageerror.spec.ts
@@ -17,7 +17,7 @@
import { test as it, expect } from './pageTest';
-it('should fire', async ({page, server, isWebKit}) => {
+it('should fire', async ({page, server, browserName}) => {
const [error] = await Promise.all([
page.waitForEvent('pageerror'),
page.goto(server.PREFIX + '/error.html'),
@@ -26,13 +26,13 @@ it('should fire', async ({page, server, isWebKit}) => {
expect(error.message).toBe('Fancy error!');
let stack = await page.evaluate(() => window['e'].stack);
// Note that WebKit reports the stack of the 'throw' statement instead of the Error constructor call.
- if (isWebKit)
+ if (browserName === 'webkit')
stack = stack.replace('14:25', '15:19');
expect(error.stack).toBe(stack);
});
-it('should contain sourceURL', async ({page, server, isWebKit}) => {
- it.fail(isWebKit);
+it('should contain sourceURL', async ({page, server, browserName}) => {
+ it.fail(browserName === 'webkit');
const [error] = await Promise.all([
page.waitForEvent('pageerror'),
@@ -87,19 +87,19 @@ it('should handle odd values', async ({page}) => {
}
});
-it('should handle object', async ({page, isChromium}) => {
+it('should handle object', async ({page, browserName}) => {
const [error] = await Promise.all([
page.waitForEvent('pageerror'),
page.evaluate(() => setTimeout(() => { throw {}; }, 0)),
]);
- expect(error.message).toBe(isChromium ? 'Object' : '[object Object]');
+ expect(error.message).toBe(browserName === 'chromium' ? 'Object' : '[object Object]');
});
-it('should handle window', async ({page, isChromium, isFirefox, isElectron}) => {
+it('should handle window', async ({page, browserName, isElectron}) => {
it.skip(isElectron);
const [error] = await Promise.all([
page.waitForEvent('pageerror'),
page.evaluate(() => setTimeout(() => { throw window; }, 0)),
]);
- expect(error.message).toBe(isChromium ? 'Window' : '[object Window]');
+ expect(error.message).toBe(browserName === 'chromium' ? 'Window' : '[object Window]');
});
diff --git a/tests/page/page-event-popup.spec.ts b/tests/page/page-event-popup.spec.ts
index 8c72d46a72..6a766b5352 100644
--- a/tests/page/page-event-popup.spec.ts
+++ b/tests/page/page-event-popup.spec.ts
@@ -46,8 +46,8 @@ it('should emit for immediately closed popups', async ({page}) => {
expect(popup).toBeTruthy();
});
-it('should emit for immediately closed popups 2', async ({page, server, isFirefox, video}) => {
- it.fixme(isFirefox && video);
+it('should emit for immediately closed popups 2', async ({page, server, browserName, video}) => {
+ it.fixme(browserName === 'firefox' && video);
await page.goto(server.EMPTY_PAGE);
const [popup] = await Promise.all([
diff --git a/tests/page/page-fill.spec.ts b/tests/page/page-fill.spec.ts
index fe0fd7efbf..fa3c523da3 100644
--- a/tests/page/page-fill.spec.ts
+++ b/tests/page/page-fill.spec.ts
@@ -90,8 +90,8 @@ it('should fill date input after clicking', async ({page, server}) => {
expect(await page.$eval('input', input => input.value)).toBe('2020-03-02');
});
-it('should throw on incorrect date', async ({page, isWebKit}) => {
- it.skip(isWebKit, 'WebKit does not support date inputs');
+it('should throw on incorrect date', async ({page, browserName}) => {
+ it.skip(browserName === 'webkit', 'WebKit does not support date inputs');
await page.setContent('');
const error = await page.fill('input', '2020-13-05').catch(e => e);
@@ -110,8 +110,8 @@ it('should fill month input', async ({page}) => {
expect(await page.$eval('input', input => input.value)).toBe('2020-07');
});
-it('should throw on incorrect month', async ({page, isChromium}) => {
- it.skip(!isChromium, 'Only Chromium supports month inputs');
+it('should throw on incorrect month', async ({page, browserName}) => {
+ it.skip(browserName !== 'chromium', 'Only Chromium supports month inputs');
await page.setContent('');
const error = await page.fill('input', '2020-13').catch(e => e);
@@ -124,16 +124,16 @@ it('should fill week input', async ({page}) => {
expect(await page.$eval('input', input => input.value)).toBe('2020-W50');
});
-it('should throw on incorrect week', async ({page, isChromium}) => {
- it.skip(!isChromium, 'Only Chromium supports week inputs');
+it('should throw on incorrect week', async ({page, browserName}) => {
+ it.skip(browserName !== 'chromium', 'Only Chromium supports week inputs');
await page.setContent('');
const error = await page.fill('input', '2020-123').catch(e => e);
expect(error.message).toContain('Malformed value');
});
-it('should throw on incorrect time', async ({page, isWebKit}) => {
- it.skip(isWebKit, 'WebKit does not support time inputs');
+it('should throw on incorrect time', async ({page, browserName}) => {
+ it.skip(browserName === 'webkit', 'WebKit does not support time inputs');
await page.setContent('');
const error = await page.fill('input', '25:05').catch(e => e);
@@ -146,8 +146,8 @@ it('should fill datetime-local input', async ({page, server}) => {
expect(await page.$eval('input', input => input.value)).toBe('2020-03-02T05:15');
});
-it('should throw on incorrect datetime-local', async ({page, server, isChromium}) => {
- it.skip(!isChromium, 'Only Chromium supports datetime-local inputs');
+it('should throw on incorrect datetime-local', async ({page, server, browserName}) => {
+ it.skip(browserName !== 'chromium', 'Only Chromium supports datetime-local inputs');
await page.setContent('');
const error = await page.fill('input', 'abc').catch(e => e);
diff --git a/tests/page/page-focus.spec.ts b/tests/page/page-focus.spec.ts
index 5658767645..9a3341eb98 100644
--- a/tests/page/page-focus.spec.ts
+++ b/tests/page/page-focus.spec.ts
@@ -108,9 +108,9 @@ it('should traverse only form elements', async function({page, browserName, plat
expect(await page.evaluate(() => document.activeElement.id)).toBe('input-1');
});
-it('clicking checkbox should activate it', async ({ page, browserName, headful, platform }) => {
- it.fixme(browserName === 'webkit' && !headful);
- it.fixme(browserName === 'firefox' && !headful && platform === 'darwin');
+it('clicking checkbox should activate it', async ({ page, browserName, headless, platform }) => {
+ it.fixme(browserName === 'webkit' && headless);
+ it.fixme(browserName === 'firefox' && headless && platform === 'darwin');
await page.setContent(``);
await page.click('input');
diff --git a/tests/page/page-goto.spec.ts b/tests/page/page-goto.spec.ts
index fb67837bb8..822ffc2fb5 100644
--- a/tests/page/page-goto.spec.ts
+++ b/tests/page/page-goto.spec.ts
@@ -137,7 +137,7 @@ it('should work with subframes return 204 with domcontentloaded', async ({page,
await page.goto(server.PREFIX + '/frames/one-frame.html', { waitUntil: 'domcontentloaded' });
});
-it('should fail when server returns 204', async ({page, server, isChromium, isWebKit}) => {
+it('should fail when server returns 204', async ({page, server, browserName}) => {
// WebKit just loads an empty page.
server.setRoute('/empty.html', (req, res) => {
res.statusCode = 204;
@@ -146,9 +146,9 @@ it('should fail when server returns 204', async ({page, server, isChromium, isWe
let error = null;
await page.goto(server.EMPTY_PAGE).catch(e => error = e);
expect(error).not.toBe(null);
- if (isChromium)
+ if (browserName === 'chromium')
expect(error.message).toContain('net::ERR_ABORTED');
- else if (isWebKit)
+ else if (browserName === 'webkit')
expect(error.message).toContain('Aborted: 204 No Content');
else
expect(error.message).toContain('NS_BINDING_ABORTED');
@@ -168,10 +168,10 @@ it('should work when page calls history API in beforeunload', async ({page, serv
expect(response.status()).toBe(200);
});
-it('should fail when navigating to bad url', async ({page, isChromium, isWebKit}) => {
+it('should fail when navigating to bad url', async ({page, browserName}) => {
let error = null;
await page.goto('asdfasdf').catch(e => error = e);
- if (isChromium || isWebKit)
+ if (browserName === 'chromium' || browserName === 'webkit')
expect(error.message).toContain('Cannot navigate to invalid URL');
else
expect(error.message).toContain('Invalid url');
@@ -213,14 +213,14 @@ it('should throw if networkidle2 is passed as an option', async ({page, server})
expect(error.message).toContain(`waitUntil: expected one of (load|domcontentloaded|networkidle)`);
});
-it('should fail when main resources failed to load', async ({page, isChromium, isWebKit, isWindows}) => {
+it('should fail when main resources failed to load', async ({page, browserName, isWindows}) => {
let error = null;
await page.goto('http://localhost:44123/non-existing-url').catch(e => error = e);
- if (isChromium)
+ if (browserName === 'chromium')
expect(error.message).toContain('net::ERR_CONNECTION_REFUSED');
- else if (isWebKit && isWindows)
+ else if (browserName === 'webkit' && isWindows)
expect(error.message).toContain(`Couldn\'t connect to server`);
- else if (isWebKit)
+ else if (browserName === 'webkit')
expect(error.message).toContain('Could not connect');
else
expect(error.message).toContain('NS_ERROR_CONNECTION_REFUSED');
@@ -311,7 +311,7 @@ it('should disable timeout when its set to 0', async ({page, server}) => {
expect(loaded).toBe(true);
});
-it('should fail when replaced by another navigation', async ({page, server, isChromium, isWebKit}) => {
+it('should fail when replaced by another navigation', async ({page, server, browserName}) => {
let anotherPromise;
server.setRoute('/empty.html', (req, res) => {
anotherPromise = page.goto(server.PREFIX + '/one-style.html');
@@ -319,9 +319,9 @@ it('should fail when replaced by another navigation', async ({page, server, isCh
});
const error = await page.goto(server.PREFIX + '/empty.html').catch(e => e);
await anotherPromise;
- if (isChromium)
+ if (browserName === 'chromium')
expect(error.message).toContain('net::ERR_ABORTED');
- else if (isWebKit)
+ else if (browserName === 'webkit')
expect(error.message).toContain('cancelled');
else
expect(error.message).toContain('NS_BINDING_ABORTED');
diff --git a/tests/page/page-keyboard.spec.ts b/tests/page/page-keyboard.spec.ts
index bb1e7203b2..9ae4b3641b 100644
--- a/tests/page/page-keyboard.spec.ts
+++ b/tests/page/page-keyboard.spec.ts
@@ -358,21 +358,21 @@ it('should support MacOS shortcuts', async ({page, server, platform, browserName
expect(await page.$eval('textarea', textarea => textarea.value)).toBe('some ');
});
-it('should press the meta key', async ({page, isFirefox, isMac}) => {
+it('should press the meta key', async ({page, browserName, isMac}) => {
const lastEvent = await captureLastKeydown(page);
await page.keyboard.press('Meta');
const {key, code, metaKey} = await lastEvent.jsonValue();
- if (isFirefox && !isMac)
+ if (browserName === 'firefox' && !isMac)
expect(key).toBe('OS');
else
expect(key).toBe('Meta');
- if (isFirefox)
+ if (browserName === 'firefox')
expect(code).toBe('OSLeft');
else
expect(code).toBe('MetaLeft');
- if (isFirefox && !isMac)
+ if (browserName === 'firefox' && !isMac)
expect(metaKey).toBe(false);
else
expect(metaKey).toBe(true);
diff --git a/tests/page/page-mouse.spec.ts b/tests/page/page-mouse.spec.ts
index 7012fa4ed0..4737408dd6 100644
--- a/tests/page/page-mouse.spec.ts
+++ b/tests/page/page-mouse.spec.ts
@@ -121,12 +121,12 @@ it('should trigger hover state with removed window.Node', async ({page, server})
expect(await page.evaluate(() => document.querySelector('button:hover').id)).toBe('button-6');
});
-it('should set modifier keys on click', async ({page, server, isFirefox, isMac}) => {
+it('should set modifier keys on click', async ({page, server, browserName, isMac}) => {
await page.goto(server.PREFIX + '/input/scrollable.html');
await page.evaluate(() => document.querySelector('#button-3').addEventListener('mousedown', e => window['lastEvent'] = e, true));
const modifiers = {'Shift': 'shiftKey', 'Control': 'ctrlKey', 'Alt': 'altKey', 'Meta': 'metaKey'};
// In Firefox, the Meta modifier only exists on Mac
- if (isFirefox && !isMac)
+ if (browserName === 'firefox' && !isMac)
delete modifiers['Meta'];
for (const modifier in modifiers) {
await page.keyboard.down(modifier);
@@ -142,11 +142,11 @@ it('should set modifier keys on click', async ({page, server, isFirefox, isMac})
}
});
-it('should tween mouse movement', async ({page, isWebKit, isAndroid}) => {
+it('should tween mouse movement', async ({page, browserName, isAndroid}) => {
it.skip(isAndroid, 'Bad rounding');
// The test becomes flaky on WebKit without next line.
- if (isWebKit)
+ if (browserName === 'webkit')
await page.evaluate(() => new Promise(requestAnimationFrame));
await page.mouse.move(100, 100);
await page.evaluate(() => {
diff --git a/tests/page/page-network-request.spec.ts b/tests/page/page-network-request.spec.ts
index 053a00773f..e2f3ca6b75 100644
--- a/tests/page/page-network-request.spec.ts
+++ b/tests/page/page-network-request.spec.ts
@@ -71,13 +71,13 @@ it('should not work for a redirect and interception', async ({page, server}) =>
expect(requests[0].url()).toBe(server.PREFIX + '/foo.html');
});
-it('should return headers', async ({page, server, isChromium, isFirefox, isWebKit}) => {
+it('should return headers', async ({page, server, browserName}) => {
const response = await page.goto(server.EMPTY_PAGE);
- if (isChromium)
+ if (browserName === 'chromium')
expect(response.request().headers()['user-agent']).toContain('Chrome');
- else if (isFirefox)
+ else if (browserName === 'firefox')
expect(response.request().headers()['user-agent']).toContain('Firefox');
- else if (isWebKit)
+ else if (browserName === 'webkit')
expect(response.request().headers()['user-agent']).toContain('WebKit');
});
diff --git a/tests/page/page-request-fulfill.spec.ts b/tests/page/page-request-fulfill.spec.ts
index 5827966ca7..de04b26b10 100644
--- a/tests/page/page-request-fulfill.spec.ts
+++ b/tests/page/page-request-fulfill.spec.ts
@@ -48,8 +48,8 @@ it('should work with status code 422', async ({page, server}) => {
expect(await page.evaluate(() => document.body.textContent)).toBe('Yo, page!');
});
-it('should allow mocking binary responses', async ({page, server, browserName, headful, asset, isAndroid}) => {
- it.skip(browserName === 'firefox' && headful, 'Firefox headful produces a different image.');
+it('should allow mocking binary responses', async ({page, server, browserName, headless, asset, isAndroid}) => {
+ it.skip(browserName === 'firefox' && !headless, 'Firefox headed produces a different image.');
it.skip(isAndroid);
await page.route('**/*', route => {
@@ -69,11 +69,10 @@ it('should allow mocking binary responses', async ({page, server, browserName, h
expect(await img.screenshot()).toMatchSnapshot('mock-binary-response.png');
});
-it('should allow mocking svg with charset', async ({page, server, browserName, headful, isAndroid}) => {
- it.skip(browserName === 'firefox' && headful, 'Firefox headful produces a different image.');
+it('should allow mocking svg with charset', async ({page, server, browserName, headless, isAndroid}) => {
+ it.skip(browserName === 'firefox' && !headless, 'Firefox headed produces a different image.');
it.skip(isAndroid);
- // Firefox headful produces a different image.
await page.route('**/*', route => {
route.fulfill({
contentType: 'image/svg+xml ; charset=utf-8',
diff --git a/tests/page/page-route.spec.ts b/tests/page/page-route.spec.ts
index c65b0f9ffd..0367c5c816 100644
--- a/tests/page/page-route.spec.ts
+++ b/tests/page/page-route.spec.ts
@@ -162,8 +162,8 @@ it('should work with redirect inside sync XHR', async ({page, server}) => {
expect(status).toBe(200);
});
-it('should pause intercepted XHR until continue', async ({page, server, isWebKit}) => {
- it.fixme(isWebKit, 'Redirected request is not paused in WebKit');
+it('should pause intercepted XHR until continue', async ({page, server, browserName}) => {
+ it.fixme(browserName === 'webkit', 'Redirected request is not paused in WebKit');
await page.goto(server.EMPTY_PAGE);
let resolveRoute;
@@ -237,15 +237,15 @@ it('should be abortable', async ({page, server}) => {
expect(failed).toBe(true);
});
-it('should be abortable with custom error codes', async ({page, server, isWebKit, isFirefox}) => {
+it('should be abortable with custom error codes', async ({page, server, browserName}) => {
await page.route('**/*', route => route.abort('internetdisconnected'));
let failedRequest = null;
page.on('requestfailed', request => failedRequest = request);
await page.goto(server.EMPTY_PAGE).catch(e => {});
expect(failedRequest).toBeTruthy();
- if (isWebKit)
+ if (browserName === 'webkit')
expect(failedRequest.failure().errorText).toBe('Request intercepted');
- else if (isFirefox)
+ else if (browserName === 'firefox')
expect(failedRequest.failure().errorText).toBe('NS_ERROR_OFFLINE');
else
expect(failedRequest.failure().errorText).toBe('net::ERR_INTERNET_DISCONNECTED');
@@ -263,14 +263,14 @@ it('should send referer', async ({page, server}) => {
expect(request.headers['referer']).toBe('http://google.com/');
});
-it('should fail navigation when aborting main resource', async ({page, server, isWebKit, isFirefox}) => {
+it('should fail navigation when aborting main resource', async ({page, server, browserName}) => {
await page.route('**/*', route => route.abort());
let error = null;
await page.goto(server.EMPTY_PAGE).catch(e => error = e);
expect(error).toBeTruthy();
- if (isWebKit)
+ if (browserName === 'webkit')
expect(error.message).toContain('Request intercepted');
- else if (isFirefox)
+ else if (browserName === 'firefox')
expect(error.message).toContain('NS_ERROR_FAILURE');
else
expect(error.message).toContain('net::ERR_FAILED');
@@ -449,8 +449,8 @@ it('should intercept main resource during cross-process navigation', async ({pag
expect(intercepted).toBe(true);
});
-it('should fulfill with redirect status', async ({page, server, isWebKit}) => {
- it.fixme(isWebKit, 'in WebKit the redirects are handled by the network stack and we intercept before');
+it('should fulfill with redirect status', async ({page, server, browserName}) => {
+ it.fixme(browserName === 'webkit', 'in WebKit the redirects are handled by the network stack and we intercept before');
await page.goto(server.PREFIX + '/title.html');
server.setRoute('/final', (req, res) => res.end('foo'));
@@ -472,8 +472,8 @@ it('should fulfill with redirect status', async ({page, server, isWebKit}) => {
expect(text).toBe('foo');
});
-it('should not fulfill with redirect status', async ({page, server, isWebKit}) => {
- it.skip(!isWebKit, 'we should support fulfill with redirect in webkit and delete this test');
+it('should not fulfill with redirect status', async ({page, server, browserName}) => {
+ it.skip(browserName !== 'webkit', 'we should support fulfill with redirect in webkit and delete this test');
await page.goto(server.PREFIX + '/empty.html');
diff --git a/tests/page/page-screenshot.spec.ts b/tests/page/page-screenshot.spec.ts
index 7c0b830622..f39831bff2 100644
--- a/tests/page/page-screenshot.spec.ts
+++ b/tests/page/page-screenshot.spec.ts
@@ -21,7 +21,7 @@ import path from 'path';
import fs from 'fs';
it.describe('page screenshot', () => {
- it.skip(({ browserName, headful }) => browserName === 'firefox' && headful, 'Firefox headful produces a different image.');
+ it.skip(({ browserName, headless }) => browserName === 'firefox' && !headless, 'Firefox headed produces a different image.');
it.skip(({ isAndroid }) => isAndroid, 'Different viewport');
it('should work', async ({page, server}) => {
diff --git a/tests/page/page-set-input-files.spec.ts b/tests/page/page-set-input-files.spec.ts
index c1544a2715..c710b8aeda 100644
--- a/tests/page/page-set-input-files.spec.ts
+++ b/tests/page/page-set-input-files.spec.ts
@@ -118,8 +118,8 @@ it('should work when file input is not attached to DOM', async ({page, asset}) =
expect(content).toBe('contents of the file');
});
-it('should not throw when filechooser belongs to iframe', async ({page, server, isFirefox}) => {
- it.skip(isFirefox, 'Firefox ignores filechooser from child frame');
+it('should not throw when filechooser belongs to iframe', async ({page, server, browserName}) => {
+ it.skip(browserName === 'firefox', 'Firefox ignores filechooser from child frame');
await page.goto(server.PREFIX + '/frames/one-frame.html');
const frame = page.mainFrame().childFrames()[0];
diff --git a/tests/page/page-wait-for-load-state.spec.ts b/tests/page/page-wait-for-load-state.spec.ts
index 14be071711..73be5e99ef 100644
--- a/tests/page/page-wait-for-load-state.spec.ts
+++ b/tests/page/page-wait-for-load-state.spec.ts
@@ -69,7 +69,7 @@ it('should work with pages that have loaded before being connected to', async ({
expect(popup.url()).toBe(server.EMPTY_PAGE);
});
-it('should wait for load state of empty url popup', async ({page, isFirefox}) => {
+it('should wait for load state of empty url popup', async ({page, browserName}) => {
const [popup, readyState] = await Promise.all([
page.waitForEvent('popup'),
page.evaluate(() => {
@@ -78,8 +78,8 @@ it('should wait for load state of empty url popup', async ({page, isFirefox}) =>
}),
]);
await popup.waitForLoadState();
- expect(readyState).toBe(isFirefox ? 'uninitialized' : 'complete');
- expect(await popup.evaluate(() => document.readyState)).toBe(isFirefox ? 'uninitialized' : 'complete');
+ expect(readyState).toBe(browserName === 'firefox' ? 'uninitialized' : 'complete');
+ expect(await popup.evaluate(() => document.readyState)).toBe(browserName === 'firefox' ? 'uninitialized' : 'complete');
});
it('should wait for load state of about:blank popup ', async ({page}) => {
diff --git a/tests/pdf.spec.ts b/tests/pdf.spec.ts
index d184f6ba48..8d09f87000 100644
--- a/tests/pdf.spec.ts
+++ b/tests/pdf.spec.ts
@@ -17,8 +17,8 @@
import { browserTest as it, expect } from './config/browserTest';
import fs from 'fs';
-it('should be able to save file', async ({contextFactory, headful, browserName}, testInfo) => {
- it.skip(headful || browserName !== 'chromium', 'Printing to pdf is currently only supported in headless chromium.');
+it('should be able to save file', async ({contextFactory, headless, browserName}, testInfo) => {
+ it.skip(!headless || browserName !== 'chromium', 'Printing to pdf is currently only supported in headless chromium.');
const context = await contextFactory();
const page = await context.newPage();
diff --git a/tests/permissions.spec.ts b/tests/permissions.spec.ts
index ef4e705201..d69702ddae 100644
--- a/tests/permissions.spec.ts
+++ b/tests/permissions.spec.ts
@@ -100,9 +100,9 @@ it.describe('permissions', () => {
expect(await getPermission(page, 'geolocation')).toBe('prompt');
});
- it('should trigger permission onchange', async ({page, context, server, browserName, headful}) => {
+ it('should trigger permission onchange', async ({page, context, server, browserName, headless}) => {
it.fail(browserName === 'webkit');
- it.fail(browserName === 'chromium' && headful);
+ it.fail(browserName === 'chromium' && !headless);
await page.goto(server.EMPTY_PAGE);
await page.evaluate(() => {
@@ -145,10 +145,10 @@ it.describe('permissions', () => {
await context.close();
});
- it('should support clipboard read', async ({page, context, server, browserName, headful}) => {
+ it('should support clipboard read', async ({page, context, server, browserName, headless}) => {
it.fail(browserName === 'webkit');
it.fail(browserName === 'firefox', 'No such permissions (requires flag) in Firefox');
- it.fixme(browserName === 'chromium' && headful);
+ it.fixme(browserName === 'chromium' && !headless);
await page.goto(server.EMPTY_PAGE);
expect(await getPermission(page, 'clipboard-read')).toBe('prompt');
diff --git a/tests/popup.spec.ts b/tests/popup.spec.ts
index aee788d820..24390390a6 100644
--- a/tests/popup.spec.ts
+++ b/tests/popup.spec.ts
@@ -210,7 +210,7 @@ it('should expose function from browser context', async function({browser, serve
expect(messages.join('|')).toBe('page|binding');
});
-it('should not dispatch binding on a closed page', async function({browser, server, isFirefox}) {
+it('should not dispatch binding on a closed page', async function({browser, server, browserName}) {
const context = await browser.newContext();
const messages = [];
await context.exposeFunction('add', (a, b) => {
@@ -233,7 +233,7 @@ it('should not dispatch binding on a closed page', async function({browser, serv
}),
]);
await context.close();
- if (isFirefox)
+ if (browserName === 'firefox')
expect(messages.join('|')).toBe('close');
else
expect(messages.join('|')).toBe('binding|close');
diff --git a/tests/proxy.spec.ts b/tests/proxy.spec.ts
index 2b1323f783..eadd2d47bd 100644
--- a/tests/proxy.spec.ts
+++ b/tests/proxy.spec.ts
@@ -96,8 +96,8 @@ it('should authenticate', async ({browserType, browserOptions, server}) => {
await browser.close();
});
-it('should exclude patterns', async ({browserType, browserOptions, server, browserName, headful}) => {
- it.fixme(browserName === 'chromium' && headful, 'Chromium headful crashes with CHECK(!in_frame_tree_) in RenderFrameImpl::OnDeleteFrame.');
+it('should exclude patterns', async ({browserType, browserOptions, server, browserName, headless}) => {
+ it.fixme(browserName === 'chromium' && !headless, 'Chromium headed crashes with CHECK(!in_frame_tree_) in RenderFrameImpl::OnDeleteFrame.');
server.setRoute('/target.html', async (req, res) => {
res.end('Served by the proxy');
diff --git a/tests/screenshot.spec.ts b/tests/screenshot.spec.ts
index b875a6f81e..fd63659b29 100644
--- a/tests/screenshot.spec.ts
+++ b/tests/screenshot.spec.ts
@@ -20,7 +20,7 @@ import { PNG } from 'pngjs';
import { verifyViewport } from './config/utils';
browserTest.describe('page screenshot', () => {
- browserTest.skip(({ browserName, headful }) => browserName === 'firefox' && headful, 'Firefox headful produces a different image.');
+ browserTest.skip(({ browserName, headless }) => browserName === 'firefox' && !headless, 'Firefox headed produces a different image.');
browserTest('should run in parallel in multiple pages', async ({server, contextFactory}) => {
const context = await contextFactory();
@@ -83,8 +83,8 @@ browserTest.describe('page screenshot', () => {
await context.close();
});
- browserTest('should work with large size', async ({ browserName, headful, platform, contextFactory }) => {
- browserTest.fixme(browserName === 'chromium' && headful === true && platform === 'linux', 'Chromium has gpu problems on linux with large screnshots');
+ browserTest('should work with large size', async ({ browserName, headless, platform, contextFactory }) => {
+ browserTest.fixme(browserName === 'chromium' && !headless && platform === 'linux', 'Chromium has gpu problems on linux with large screnshots');
browserTest.slow('Large screenshot is slow');
const context = await contextFactory();
@@ -120,7 +120,7 @@ browserTest.describe('page screenshot', () => {
});
browserTest.describe('element sceenshot', () => {
- browserTest.skip(({ browserName, headful }) => browserName === 'firefox' && headful);
+ browserTest.skip(({ browserName, headless }) => browserName === 'firefox' && !headless);
browserTest('element screenshot should work with a mobile viewport', async ({browser, server, browserName}) => {
browserTest.skip(browserName === 'firefox');
diff --git a/tests/signals.spec.ts b/tests/signals.spec.ts
index c21d22170a..3e966b5bb3 100644
--- a/tests/signals.spec.ts
+++ b/tests/signals.spec.ts
@@ -32,7 +32,7 @@ test('should close the browser when the node process closes', async ({startRemot
});
test.describe('signals', () => {
- test.skip(({platform, headful}) => platform === 'win32' || headful);
+ test.skip(({platform, headless}) => platform === 'win32' || !headless);
test('should report browser close signal', async ({startRemoteServer, server}) => {
const remoteServer = await startRemoteServer({ url: server.EMPTY_PAGE });
@@ -54,8 +54,8 @@ test.describe('signals', () => {
await remoteServer.childExitCode();
});
- test('should close the browser on SIGINT', async ({startRemoteServer, server, browserChannel}) => {
- test.fixme(!!browserChannel, 'Uncomment on roll');
+ test('should close the browser on SIGINT', async ({startRemoteServer, server, channel}) => {
+ test.fixme(!!channel, 'Uncomment on roll');
const remoteServer = await startRemoteServer({ url: server.EMPTY_PAGE });
process.kill(remoteServer.child().pid, 'SIGINT');
@@ -64,8 +64,8 @@ test.describe('signals', () => {
expect(await remoteServer.childExitCode()).toBe(130);
});
- test('should close the browser on SIGTERM', async ({startRemoteServer, server, browserChannel}) => {
- test.fixme(!!browserChannel, 'Uncomment on roll');
+ test('should close the browser on SIGTERM', async ({startRemoteServer, server, channel}) => {
+ test.fixme(!!channel, 'Uncomment on roll');
const remoteServer = await startRemoteServer({ url: server.EMPTY_PAGE });
process.kill(remoteServer.child().pid, 'SIGTERM');
@@ -74,8 +74,8 @@ test.describe('signals', () => {
expect(await remoteServer.childExitCode()).toBe(0);
});
- test('should close the browser on SIGHUP', async ({startRemoteServer, server, browserChannel}) => {
- test.fixme(!!browserChannel, 'Uncomment on roll');
+ test('should close the browser on SIGHUP', async ({startRemoteServer, server, channel}) => {
+ test.fixme(!!channel, 'Uncomment on roll');
const remoteServer = await startRemoteServer({ url: server.EMPTY_PAGE });
process.kill(remoteServer.child().pid, 'SIGHUP');
diff --git a/tests/tracing.spec.ts b/tests/tracing.spec.ts
index ec33d97667..2eebf9aabb 100644
--- a/tests/tracing.spec.ts
+++ b/tests/tracing.spec.ts
@@ -23,8 +23,8 @@ import jpeg from 'jpeg-js';
const traceDir = path.join(__dirname, '..', 'test-results', 'trace-' + process.env.FOLIO_WORKER_INDEX);
test.useOptions({ traceDir });
-test.beforeEach(async ({ browserName, headful }) => {
- test.fixme(browserName === 'chromium' && headful, 'Chromium screencast on headful has a min width issue');
+test.beforeEach(async ({ browserName, headless }) => {
+ test.fixme(browserName === 'chromium' && !headless, 'Chromium screencast on headed has a min width issue');
await new Promise(f => removeFolder(traceDir, f));
});
diff --git a/tests/video.spec.ts b/tests/video.spec.ts
index 06cfd5dcbb..3f8a439265 100644
--- a/tests/video.spec.ts
+++ b/tests/video.spec.ts
@@ -159,7 +159,7 @@ it.describe('screencast', () => {
expect(error.message).toContain('"videoSize" option requires "videosPath" to be specified');
});
- it('should work with old options', async ({browser, isFirefox, isWindows}, testInfo) => {
+ it('should work with old options', async ({browser}, testInfo) => {
const videosPath = testInfo.outputPath('');
const size = { width: 450, height: 240 };
const context = await browser.newContext({
@@ -182,7 +182,7 @@ it.describe('screencast', () => {
expect(error.message).toContain('recordVideo.dir: expected string, got undefined');
});
- it('should capture static page', async ({browser, isFirefox, isWindows}, testInfo) => {
+ it('should capture static page', async ({browser}, testInfo) => {
const size = { width: 450, height: 240 };
const context = await browser.newContext({
recordVideo: {
@@ -359,9 +359,9 @@ it.describe('screencast', () => {
}
});
- it('should capture css transformation', async ({browser, server, headful, browserName, platform}, testInfo) => {
- it.fixme(headful, 'Fails on headful');
- it.fixme(browserName === 'webkit' && platform === 'win32', 'Fails on headful');
+ it('should capture css transformation', async ({browser, server, headless, browserName, platform}, testInfo) => {
+ it.fixme(!headless, 'Fails on headed');
+ it.fixme(browserName === 'webkit' && platform === 'win32');
const size = { width: 320, height: 240 };
// Set viewport equal to screencast frame size to avoid scaling.
@@ -419,8 +419,8 @@ it.describe('screencast', () => {
expect(videoFiles.length).toBe(2);
});
- it('should scale frames down to the requested size ', async ({browser, server, headful}, testInfo) => {
- it.fixme(headful, 'Fails on headful');
+ it('should scale frames down to the requested size ', async ({browser, server, headless}, testInfo) => {
+ it.fixme(!headless, 'Fails on headed');
const context = await browser.newContext({
recordVideo: {
@@ -503,8 +503,8 @@ it.describe('screencast', () => {
expect(videoPlayer.videoHeight).toBe(450);
});
- it('should be 800x600 with null viewport', async ({ browser, headful, browserName }, testInfo) => {
- it.fixme(browserName === 'firefox' && !headful, 'Fails in headless on bots');
+ it('should be 800x600 with null viewport', async ({ browser, headless, browserName }, testInfo) => {
+ it.fixme(browserName === 'firefox' && headless, 'Fails in headless on bots');
const context = await browser.newContext({
recordVideo: {
diff --git a/tests/web-socket.spec.ts b/tests/web-socket.spec.ts
index e885b609f5..76a8080c7e 100644
--- a/tests/web-socket.spec.ts
+++ b/tests/web-socket.spec.ts
@@ -111,7 +111,7 @@ it('should emit binary frame events', async ({ page, server }) => {
expect(sent[1][i]).toBe(i);
});
-it('should emit error', async ({page, server, isFirefox}) => {
+it('should emit error', async ({page, server, browserName}) => {
let callback;
const result = new Promise(f => callback = f);
page.on('websocket', ws => ws.on('socketerror', callback));
@@ -119,7 +119,7 @@ it('should emit error', async ({page, server, isFirefox}) => {
new WebSocket('ws://localhost:' + port + '/bogus-ws');
}, server.PORT);
const message = await result;
- if (isFirefox)
+ if (browserName === 'firefox')
expect(message).toBe('CLOSE_ABNORMAL');
else
expect(message).toContain(': 400');