test: cleanup bad usages of pageTest (#6430)

This commit is contained in:
Dmitry Gozman 2021-05-06 07:08:22 -07:00 committed by GitHub
parent 67f98d00eb
commit 217cbe3e21
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
101 changed files with 112 additions and 131 deletions

2
package-lock.json generated
View file

@ -1,6 +1,6 @@
{ {
"name": "playwright-internal", "name": "playwright-internal",
"version": "1.11.0-next", "version": "1.12.0-next",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {

View file

@ -15,13 +15,10 @@
* limitations under the License. * limitations under the License.
*/ */
import { test as it, expect } from './config/pageTest'; import { contextTest as it, expect } from './config/browserTest';
import { browserTest } from './config/browserTest'; import { browserTest } from './config/browserTest';
import { verifyViewport } from './config/utils'; import { verifyViewport } from './config/utils';
it.skip(({ isAndroid }) => isAndroid, 'Default viewport is null');
it.skip(({ isElectron }) => isElectron, 'Default viewport is null');
it('should get the proper default viewport size', async ({page, server}) => { it('should get the proper default viewport size', async ({page, server}) => {
await verifyViewport(page, 1280, 720); await verifyViewport(page, 1280, 720);
}); });

View file

@ -15,16 +15,14 @@
* limitations under the License. * limitations under the License.
*/ */
import { test as pageTest, expect } from '../config/pageTest'; import { contextTest as test, expect } from '../config/browserTest';
import { playwrightTest } from '../config/browserTest'; import { playwrightTest } from '../config/browserTest';
import http from 'http'; import http from 'http';
pageTest.describe('chromium', () => { test.describe('chromium', () => {
pageTest.skip(({ browserName }) => browserName !== 'chromium'); test.skip(({ browserName }) => browserName !== 'chromium');
pageTest.skip(({ isAndroid }) => isAndroid);
pageTest.skip(({ isElectron }) => isElectron);
pageTest('should create a worker from a service worker', async ({page, server}) => { test('should create a worker from a service worker', async ({page, server}) => {
const [worker] = await Promise.all([ const [worker] = await Promise.all([
page.context().waitForEvent('serviceworker'), page.context().waitForEvent('serviceworker'),
page.goto(server.PREFIX + '/serviceworkers/empty/sw.html') page.goto(server.PREFIX + '/serviceworkers/empty/sw.html')
@ -32,7 +30,7 @@ pageTest.describe('chromium', () => {
expect(await worker.evaluate(() => self.toString())).toBe('[object ServiceWorkerGlobalScope]'); expect(await worker.evaluate(() => self.toString())).toBe('[object ServiceWorkerGlobalScope]');
}); });
pageTest('serviceWorkers() should return current workers', async ({page, server}) => { test('serviceWorkers() should return current workers', async ({page, server}) => {
const context = page.context(); const context = page.context();
const [worker1] = await Promise.all([ const [worker1] = await Promise.all([
context.waitForEvent('serviceworker'), context.waitForEvent('serviceworker'),
@ -51,7 +49,7 @@ pageTest.describe('chromium', () => {
expect(workers).toContain(worker2); expect(workers).toContain(worker2);
}); });
pageTest('should not create a worker from a shared worker', async ({page, server}) => { test('should not create a worker from a shared worker', async ({page, server}) => {
await page.goto(server.EMPTY_PAGE); await page.goto(server.EMPTY_PAGE);
let serviceWorkerCreated; let serviceWorkerCreated;
page.context().once('serviceworker', () => serviceWorkerCreated = true); page.context().once('serviceworker', () => serviceWorkerCreated = true);
@ -61,7 +59,7 @@ pageTest.describe('chromium', () => {
expect(serviceWorkerCreated).not.toBeTruthy(); expect(serviceWorkerCreated).not.toBeTruthy();
}); });
pageTest('Page.route should work with intervention headers', async ({server, page}) => { test('Page.route should work with intervention headers', async ({server, page}) => {
server.setRoute('/intervention', (req, res) => res.end(` server.setRoute('/intervention', (req, res) => res.end(`
<script> <script>
document.write('<script src="${server.CROSS_PROCESS_PREFIX}/intervention.js">' + '</scr' + 'ipt>'); document.write('<script src="${server.CROSS_PROCESS_PREFIX}/intervention.js">' + '</scr' + 'ipt>');

View file

@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { test as it, expect } from '../config/pageTest'; import { contextTest as it, expect } from '../config/browserTest';
it.describe('CSS Coverage', () => { it.describe('CSS Coverage', () => {
it.skip(({ browserName }) => browserName !== 'chromium'); it.skip(({ browserName }) => browserName !== 'chromium');

View file

@ -14,11 +14,10 @@
* limitations under the License. * limitations under the License.
*/ */
import { test as it, expect } from '../config/pageTest'; import { contextTest as it, expect } from '../config/browserTest';
it.describe('JS Coverage', () => { it.describe('JS Coverage', () => {
it.skip(({ browserName }) => browserName !== 'chromium'); it.skip(({ browserName }) => browserName !== 'chromium');
it.fixme(({ isElectron }) => isElectron);
it('should work', async function({page, server}) { it('should work', async function({page, server}) {
await page.coverage.startJSCoverage(); await page.coverage.startJSCoverage();

View file

@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { test as it, expect } from '../config/pageTest'; import { contextTest as it, expect } from '../config/browserTest';
import { browserTest } from '../config/browserTest'; import { browserTest } from '../config/browserTest';
it.describe('session', () => { it.describe('session', () => {

View file

@ -16,7 +16,7 @@
import * as folio from 'folio'; import * as folio from 'folio';
import * as path from 'path'; import * as path from 'path';
import { test as pageTest } from './pageTest'; import { test as pageTest } from '../page/pageTest';
import { AndroidEnv, androidTest } from './androidTest'; import { AndroidEnv, androidTest } from './androidTest';
import type { BrowserContext } from '../../index'; import type { BrowserContext } from '../../index';

View file

@ -17,7 +17,7 @@
import * as folio from 'folio'; import * as folio from 'folio';
import * as path from 'path'; import * as path from 'path';
import { playwrightTest, slowPlaywrightTest, contextTest, tracingTest } from './browserTest'; import { playwrightTest, slowPlaywrightTest, contextTest, tracingTest } from './browserTest';
import { test as pageTest } from './pageTest'; import { test as pageTest } from '../page/pageTest';
import { BrowserName, CommonArgs } from './baseTest'; import { BrowserName, CommonArgs } from './baseTest';
import type { Browser, BrowserContext } from '../../index'; import type { Browser, BrowserContext } from '../../index';

View file

@ -17,7 +17,7 @@
import * as folio from 'folio'; import * as folio from 'folio';
import * as path from 'path'; import * as path from 'path';
import { baseElectronTest, ElectronEnv, electronTest } from './electronTest'; import { baseElectronTest, ElectronEnv, electronTest } from './electronTest';
import { test as pageTest } from './pageTest'; import { test as pageTest } from '../page/pageTest';
const config: folio.Config = { const config: folio.Config = {
testDir: path.join(__dirname, '..'), testDir: path.join(__dirname, '..'),

View file

@ -15,17 +15,14 @@
* limitations under the License. * limitations under the License.
*/ */
import { test as it, expect } from './config/pageTest'; import { contextTest as it, browserTest, expect } from './config/browserTest';
import { browserTest } from './config/browserTest';
import { attachFrame } from './config/utils'; import { attachFrame } from './config/utils';
it('should think that it is focused by default', async ({page}) => { it('should think that it is focused by default', async ({page}) => {
expect(await page.evaluate('document.hasFocus()')).toBe(true); expect(await page.evaluate('document.hasFocus()')).toBe(true);
}); });
it('should think that all pages are focused', async ({page, isElectron}) => { it('should think that all pages are focused', async ({page}) => {
it.fixme(isElectron, 'BrowserContext.newPage does not work in Electron');
const page2 = await page.context().newPage(); const page2 = await page.context().newPage();
expect(await page.evaluate('document.hasFocus()')).toBe(true); expect(await page.evaluate('document.hasFocus()')).toBe(true);
expect(await page2.evaluate('document.hasFocus()')).toBe(true); expect(await page2.evaluate('document.hasFocus()')).toBe(true);
@ -42,9 +39,7 @@ it('should focus popups by default', async ({page, server}) => {
expect(await page.evaluate('document.hasFocus()')).toBe(true); expect(await page.evaluate('document.hasFocus()')).toBe(true);
}); });
it('should provide target for keyboard events', async ({page, server, isElectron}) => { it('should provide target for keyboard events', async ({page, server}) => {
it.fixme(isElectron, 'BrowserContext.newPage does not work in Electron');
const page2 = await page.context().newPage(); const page2 = await page.context().newPage();
await Promise.all([ await Promise.all([
page.goto(server.PREFIX + '/input/textarea.html'), page.goto(server.PREFIX + '/input/textarea.html'),
@ -67,9 +62,7 @@ it('should provide target for keyboard events', async ({page, server, isElectron
expect(results).toEqual([text, text2]); expect(results).toEqual([text, text2]);
}); });
it('should not affect mouse event target page', async ({page, server, isElectron}) => { it('should not affect mouse event target page', async ({page, server}) => {
it.fixme(isElectron, 'BrowserContext.newPage does not work in Electron');
const page2 = await page.context().newPage(); const page2 = await page.context().newPage();
function clickCounter() { function clickCounter() {
document.onclick = () => window['clickCount'] = (window['clickCount'] || 0) + 1; document.onclick = () => window['clickCount'] = (window['clickCount'] || 0) + 1;
@ -91,9 +84,7 @@ it('should not affect mouse event target page', async ({page, server, isElectron
expect(counters).toEqual([1,1]); expect(counters).toEqual([1,1]);
}); });
it('should change document.activeElement', async ({page, server, isElectron}) => { it('should change document.activeElement', async ({page, server}) => {
it.fixme(isElectron, 'BrowserContext.newPage does not work in Electron');
const page2 = await page.context().newPage(); const page2 = await page.context().newPage();
await Promise.all([ await Promise.all([
page.goto(server.PREFIX + '/input/textarea.html'), page.goto(server.PREFIX + '/input/textarea.html'),
@ -110,10 +101,8 @@ it('should change document.activeElement', async ({page, server, isElectron}) =>
expect(active).toEqual(['INPUT', 'TEXTAREA']); expect(active).toEqual(['INPUT', 'TEXTAREA']);
}); });
it('should not affect screenshots', async ({page, server, browserName, headful, isElectron, isAndroid}) => { it('should not affect screenshots', async ({page, server, browserName, headful}) => {
it.skip(browserName === 'firefox' && headful); it.skip(browserName === 'firefox' && headful);
it.skip(isAndroid);
it.fixme(isElectron, 'BrowserContext.newPage does not work in Electron');
// Firefox headful produces a different image. // Firefox headful produces a different image.
const page2 = await page.context().newPage(); const page2 = await page.context().newPage();

View file

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { test as it, expect } from '../config/pageTest'; import { test as it, expect } from './pageTest';
import { browserTest } from '../config/browserTest'; import { browserTest } from '../config/browserTest';
it.skip(({ isAndroid }) => isAndroid); it.skip(({ isAndroid }) => isAndroid);

View file

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { test as it, expect } from '../config/pageTest'; import { test as it, expect } from './pageTest';
it('should work', async ({ page, server }) => { it('should work', async ({ page, server }) => {
await page.goto(server.PREFIX + '/input/button.html'); await page.goto(server.PREFIX + '/input/button.html');

View file

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { test as it, expect } from '../config/pageTest'; import { test as it, expect } from './pageTest';
import { attachFrame } from '../config/utils'; import { attachFrame } from '../config/utils';
it('should work', async ({ page, server }) => { it('should work', async ({ page, server }) => {

View file

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { test as it, expect } from '../config/pageTest'; import { test as it, expect } from './pageTest';
it('should have a nice preview', async ({ page, server }) => { it('should have a nice preview', async ({ page, server }) => {
await page.goto(`${server.PREFIX}/dom.html`); await page.goto(`${server.PREFIX}/dom.html`);

View file

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { test as it, expect } from '../config/pageTest'; import { test as it, expect } from './pageTest';
it('should work', async ({page, server}) => { it('should work', async ({page, server}) => {
await page.setContent('<html><body><div class="tweet"><div class="like">100</div><div class="retweets">10</div></div></body></html>'); await page.setContent('<html><body><div class="tweet"><div class="like">100</div><div class="retweets">10</div></div></body></html>');

View file

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { test as it, expect } from '../config/pageTest'; import { test as it, expect } from './pageTest';
it('should hover', async ({ page, server }) => { it('should hover', async ({ page, server }) => {
await page.goto(server.PREFIX + '/input/scrollable.html'); await page.goto(server.PREFIX + '/input/scrollable.html');

View file

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { test as it, expect } from '../config/pageTest'; import { test as it, expect } from './pageTest';
import { attachFrame } from '../config/utils'; import { attachFrame } from '../config/utils';
it('should work', async ({ page, server }) => { it('should work', async ({ page, server }) => {

View file

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { test as it, expect } from '../config/pageTest'; import { test as it, expect } from './pageTest';
it('should work', async ({ page }) => { it('should work', async ({ page }) => {
await page.setContent(`<input type='text' />`); await page.setContent(`<input type='text' />`);

View file

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { test as it, expect } from '../config/pageTest'; import { test as it, expect } from './pageTest';
it('should query existing element', async ({page, server}) => { it('should query existing element', async ({page, server}) => {
await page.goto(server.PREFIX + '/playground.html'); await page.goto(server.PREFIX + '/playground.html');

View file

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { test as it, expect } from '../config/pageTest'; import { test as it, expect } from './pageTest';
import { verifyViewport } from '../config/utils'; import { verifyViewport } from '../config/utils';
import path from 'path'; import path from 'path';
import fs from 'fs'; import fs from 'fs';

View file

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { test as it, expect } from '../config/pageTest'; import { test as it, expect } from './pageTest';
it('should work', async ({ page, server, isAndroid }) => { it('should work', async ({ page, server, isAndroid }) => {
it.fixme(isAndroid); it.fixme(isAndroid);

View file

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { test as it, expect } from '../config/pageTest'; import { test as it, expect } from './pageTest';
it('should select textarea', async ({ page, server, isFirefox }) => { it('should select textarea', async ({ page, server, isFirefox }) => {
await page.goto(server.PREFIX + '/input/textarea.html'); await page.goto(server.PREFIX + '/input/textarea.html');

View file

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { test as it, expect } from '../config/pageTest'; import { test as it, expect } from './pageTest';
it('should work', async ({ page }) => { it('should work', async ({ page }) => {
await page.setContent(`<input type='text' />`); await page.setContent(`<input type='text' />`);

View file

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { test as it, expect } from '../config/pageTest'; import { test as it, expect } from './pageTest';
async function giveItAChanceToResolve(page) { async function giveItAChanceToResolve(page) {
for (let i = 0; i < 5; i++) for (let i = 0; i < 5; i++)

View file

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { test as it, expect } from '../config/pageTest'; import { test as it, expect } from './pageTest';
it('should work with css selector', async ({page, server}) => { it('should work with css selector', async ({page, server}) => {
await page.setContent('<div>hello</div><div>beautiful</div><div>world!</div>'); await page.setContent('<div>hello</div><div>beautiful</div><div>world!</div>');

View file

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { test as it, expect } from '../config/pageTest'; import { test as it, expect } from './pageTest';
it('should work with css selector', async ({page, server}) => { it('should work with css selector', async ({page, server}) => {
await page.setContent('<section id="testAttribute">43543</section>'); await page.setContent('<section id="testAttribute">43543</section>');

View file

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { test as it, expect } from '../config/pageTest'; import { test as it, expect } from './pageTest';
import { attachFrame, detachFrame } from '../config/utils'; import { attachFrame, detachFrame } from '../config/utils';
import type { Frame } from '../../src/client/frame'; import type { Frame } from '../../src/client/frame';

View file

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { test as it, expect } from '../config/pageTest'; import { test as it, expect } from './pageTest';
import { attachFrame } from '../config/utils'; import { attachFrame } from '../config/utils';
it('should work', async ({page, server}) => { it('should work', async ({page, server}) => {

View file

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { test as it, expect } from '../config/pageTest'; import { test as it, expect } from './pageTest';
import { attachFrame } from '../config/utils'; import { attachFrame } from '../config/utils';
it('should navigate subframes', async ({page, server}) => { it('should navigate subframes', async ({page, server}) => {

View file

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { test as it, expect } from '../config/pageTest'; import { test as it, expect } from './pageTest';
import { attachFrame, detachFrame } from '../config/utils'; import { attachFrame, detachFrame } from '../config/utils';
import type { Frame } from '../../index'; import type { Frame } from '../../index';

View file

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { test as it, expect } from '../config/pageTest'; import { test as it, expect } from './pageTest';
import { globToRegex } from '../../lib/client/clientHelper'; import { globToRegex } from '../../lib/client/clientHelper';
import vm from 'vm'; import vm from 'vm';

View file

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { test, expect } from '../config/pageTest'; import { test, expect } from './pageTest';
test('should work', async ({page}) => { test('should work', async ({page}) => {
const aHandle = await page.evaluateHandle(() => document.body); const aHandle = await page.evaluateHandle(() => document.body);

View file

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { test as it, expect } from '../config/pageTest'; import { test as it, expect } from './pageTest';
it('should work with function', async ({page}) => { it('should work with function', async ({page}) => {
const windowHandle = await page.evaluateHandle(() => { const windowHandle = await page.evaluateHandle(() => {

View file

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { test as it, expect } from '../config/pageTest'; import { test as it, expect } from './pageTest';
it('should work', async ({page}) => { it('should work', async ({page}) => {
const aHandle = await page.evaluateHandle(() => ({foo: 'bar'})); const aHandle = await page.evaluateHandle(() => ({foo: 'bar'}));

View file

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { test as it, expect } from '../config/pageTest'; import { test as it, expect } from './pageTest';
import type { ElementHandle } from '../../index'; import type { ElementHandle } from '../../index';
it('should work', async ({page}) => { it('should work', async ({page}) => {

View file

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { test as it, expect } from '../config/pageTest'; import { test as it, expect } from './pageTest';
it('should work for primitives', async ({page}) => { it('should work for primitives', async ({page}) => {
const numberHandle = await page.evaluateHandle(() => 2); const numberHandle = await page.evaluateHandle(() => 2);

View file

@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { test as it, expect } from '../config/pageTest'; import { test as it, expect } from './pageTest';
it.fixme(({ isAndroid }) => isAndroid, 'Post data does not work'); it.fixme(({ isAndroid }) => isAndroid, 'Post data does not work');

View file

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { test as it, expect } from '../config/pageTest'; import { test as it, expect } from './pageTest';
it('should work', async ({ page, isFirefox, isChromium }) => { it('should work', async ({ page, isFirefox, isChromium }) => {
await page.setContent(` await page.setContent(`

View file

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { test as it, expect } from '../config/pageTest'; import { test as it, expect } from './pageTest';
it('should evaluate before anything else on the page', async ({ page, server }) => { it('should evaluate before anything else on the page', async ({ page, server }) => {
await page.addInitScript(function() { await page.addInitScript(function() {

View file

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { test as it, expect } from '../config/pageTest'; import { test as it, expect } from './pageTest';
import path from 'path'; import path from 'path';
it('should throw an error if no options are provided', async ({page, server}) => { it('should throw an error if no options are provided', async ({page, server}) => {

View file

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { test as it, expect } from '../config/pageTest'; import { test as it, expect } from './pageTest';
import path from 'path'; import path from 'path';
it('should throw an error if no options are provided', async ({page, server}) => { it('should throw an error if no options are provided', async ({page, server}) => {

View file

@ -16,7 +16,7 @@
*/ */
import { TestServer } from '../../utils/testserver'; import { TestServer } from '../../utils/testserver';
import { test as it, expect } from '../config/pageTest'; import { test as it, expect } from './pageTest';
function initServer(server: TestServer): string[] { function initServer(server: TestServer): string[] {
const messages = []; const messages = [];

View file

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { test as it } from '../config/pageTest'; import { test as it } from './pageTest';
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.goto(server.EMPTY_PAGE);

View file

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { test as it, expect } from '../config/pageTest'; import { test as it, expect } from './pageTest';
it('should reject all promises when page is closed', async ({page}) => { it('should reject all promises when page is closed', async ({page}) => {
let error = null; let error = null;

View file

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { test as it, expect } from '../config/pageTest'; import { test as it, expect } from './pageTest';
it('should check the box', async ({page}) => { it('should check the box', async ({page}) => {
await page.setContent(`<input id='checkbox' type='checkbox'></input>`); await page.setContent(`<input id='checkbox' type='checkbox'></input>`);

View file

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { test as it, expect } from '../config/pageTest'; import { test as it, expect } from './pageTest';
declare const renderComponent; declare const renderComponent;
declare const e; declare const e;

View file

@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { test as it } from '../config/pageTest'; import { test as it } from './pageTest';
it('should not hit scroll bar', async ({page, isAndroid, isWebKit, platform}) => { it('should not hit scroll bar', async ({page, isAndroid, isWebKit, platform}) => {
it.fixme(isWebKit && platform === 'darwin'); it.fixme(isWebKit && platform === 'darwin');

View file

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { test as it, expect } from '../config/pageTest'; import { test as it, expect } from './pageTest';
it('should avoid side effects after timeout', async ({page, server, mode}) => { it('should avoid side effects after timeout', async ({page, server, mode}) => {
it.skip(mode !== 'default'); it.skip(mode !== 'default');

View file

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { test as it, expect } from '../config/pageTest'; import { test as it, expect } from './pageTest';
it('should timeout waiting for display:none to be gone', async ({page, server}) => { it('should timeout waiting for display:none to be gone', async ({page, server}) => {
await page.goto(server.PREFIX + '/input/button.html'); await page.goto(server.PREFIX + '/input/button.html');

View file

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { test as it, expect } from '../config/pageTest'; import { test as it, expect } from './pageTest';
it('should fail when element jumps during hit testing', async ({page, mode}) => { it('should fail when element jumps during hit testing', async ({page, mode}) => {
it.skip(mode !== 'default'); it.skip(mode !== 'default');

View file

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { test as it, expect } from '../config/pageTest'; import { test as it, expect } from './pageTest';
it('should timeout waiting for stable position', async ({page, server}) => { it('should timeout waiting for stable position', async ({page, server}) => {
await page.goto(server.PREFIX + '/input/button.html'); await page.goto(server.PREFIX + '/input/button.html');

View file

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { test as it, expect } from '../config/pageTest'; import { test as it, expect } from './pageTest';
import { attachFrame } from '../config/utils'; import { attachFrame } from '../config/utils';
async function giveItAChanceToClick(page) { async function giveItAChanceToClick(page) {

View file

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { test as it, expect } from '../config/pageTest'; import { test as it, expect } from './pageTest';
it('should close page with active dialog', async ({page}) => { it('should close page with active dialog', async ({page}) => {
await page.setContent(`<button onclick="setTimeout(() => alert(1))">alert</button>`); await page.setContent(`<button onclick="setTimeout(() => alert(1))">alert</button>`);

View file

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { test as it, expect } from '../config/pageTest'; import { test as it, expect } from './pageTest';
it('should fire', async ({page, server}) => { it('should fire', async ({page, server}) => {
page.on('dialog', dialog => { page.on('dialog', dialog => {

View file

@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { test as it, expect } from '../config/pageTest'; import { test as it, expect } from './pageTest';
it('should dispatch click event', async ({page, server}) => { it('should dispatch click event', async ({page, server}) => {
await page.goto(server.PREFIX + '/input/button.html'); await page.goto(server.PREFIX + '/input/button.html');

View file

@ -15,7 +15,7 @@
*/ */
import type { ElementHandle } from '../../index'; import type { ElementHandle } from '../../index';
import { test as it, expect } from '../config/pageTest'; import { test as it, expect } from './pageTest';
import { attachFrame } from '../config/utils'; import { attachFrame } from '../config/utils';
it.describe('Drag and drop', () => { it.describe('Drag and drop', () => {

View file

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { test as it, expect } from '../config/pageTest'; import { test as it, expect } from './pageTest';
it.skip(({ isAndroid }) => isAndroid); it.skip(({ isAndroid }) => isAndroid);

View file

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { test as it, expect } from '../config/pageTest'; import { test as it, expect } from './pageTest';
it('should work', async ({page}) => { it('should work', async ({page}) => {
const windowHandle = await page.evaluateHandle(() => window); const windowHandle = await page.evaluateHandle(() => window);

View file

@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { test, expect } from '../config/pageTest'; import { test, expect } from './pageTest';
test.describe('non-stalling evaluate', () => { test.describe('non-stalling evaluate', () => {
test.skip(({mode}) => mode !== 'default'); test.skip(({mode}) => mode !== 'default');

View file

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { test as it, expect } from '../config/pageTest'; import { test as it, expect } from './pageTest';
it('should work', async ({ page }) => { it('should work', async ({ page }) => {
const result = await page.evaluate(() => 7 * 3); const result = await page.evaluate(() => 7 * 3);

View file

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { test as it, expect } from '../config/pageTest'; import { test as it, expect } from './pageTest';
import util from 'util'; import util from 'util';
it('should work', async ({page}) => { it('should work', async ({page}) => {

View file

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { test as it, expect } from '../config/pageTest'; import { test as it, expect } from './pageTest';
import * as os from 'os'; import * as os from 'os';
function crash({ page, toImpl, browserName, platform, mode }: any) { function crash({ page, toImpl, browserName, platform, mode }: any) {

View file

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { test as it, expect } from '../config/pageTest'; import { test as it, expect } from './pageTest';
it('Page.Events.Request', async ({page, server}) => { it('Page.Events.Request', async ({page, server}) => {
const requests = []; const requests = [];

View file

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { test as it, expect } from '../config/pageTest'; import { test as it, expect } from './pageTest';
it('should fire', async ({page, server, isWebKit}) => { it('should fire', async ({page, server, isWebKit}) => {
const [error] = await Promise.all([ const [error] = await Promise.all([

View file

@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { test as it, expect } from '../config/pageTest'; import { test as it, expect } from './pageTest';
it('should work', async ({page}) => { it('should work', async ({page}) => {
const [popup] = await Promise.all([ const [popup] = await Promise.all([

View file

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { test as it, expect } from '../config/pageTest'; import { test as it, expect } from './pageTest';
import { attachFrame } from '../config/utils'; import { attachFrame } from '../config/utils';
it('should fire for navigation requests', async ({page, server}) => { it('should fire for navigation requests', async ({page, server}) => {

View file

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { test as it, expect } from '../config/pageTest'; import { test as it, expect } from './pageTest';
import { attachFrame } from '../config/utils'; import { attachFrame } from '../config/utils';
import type { ElementHandle } from '../../index'; import type { ElementHandle } from '../../index';

View file

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { test as it, expect } from '../config/pageTest'; import { test as it, expect } from './pageTest';
async function giveItAChanceToFill(page) { async function giveItAChanceToFill(page) {
for (let i = 0; i < 5; i++) for (let i = 0; i < 5; i++)

View file

@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { test as it, expect } from '../config/pageTest'; import { test as it, expect } from './pageTest';
it('should work', async function({page, browserName}) { it('should work', async function({page, browserName}) {
it.skip(browserName === 'firefox'); it.skip(browserName === 'firefox');

View file

@ -17,7 +17,7 @@
import url from 'url'; import url from 'url';
import os from 'os'; import os from 'os';
import { test as it, expect } from '../config/pageTest'; import { test as it, expect } from './pageTest';
import { expectedSSLError } from '../config/utils'; import { expectedSSLError } from '../config/utils';
it('should work', async ({page, server}) => { it('should work', async ({page, server}) => {

View file

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { test as it, expect } from '../config/pageTest'; import { test as it, expect } from './pageTest';
import url from 'url'; import url from 'url';
it('page.goBack should work', async ({page, server}) => { it('page.goBack should work', async ({page, server}) => {

View file

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { test as it, expect } from '../config/pageTest'; import { test as it, expect } from './pageTest';
import { attachFrame } from '../config/utils'; import { attachFrame } from '../config/utils';
it.skip(({ isAndroid }) => isAndroid); it.skip(({ isAndroid }) => isAndroid);

View file

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { test as it, expect } from '../config/pageTest'; import { test as it, expect } from './pageTest';
function dimensions() { function dimensions() {
const rect = document.querySelector('textarea').getBoundingClientRect(); const rect = document.querySelector('textarea').getBoundingClientRect();

View file

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { test as it } from '../config/pageTest'; import { test as it } from './pageTest';
it('should work with _blank target', async ({page, server}) => { it('should work with _blank target', async ({page, server}) => {
server.setRoute('/empty.html', (req, res) => { server.setRoute('/empty.html', (req, res) => {

View file

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { test as it, expect } from '../config/pageTest'; import { test as it, expect } from './pageTest';
import type { Frame } from '../../index'; import type { Frame } from '../../index';
import { TestServer } from '../../utils/testserver'; import { TestServer } from '../../utils/testserver';

View file

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { test as it, expect } from '../config/pageTest'; import { test as it, expect } from './pageTest';
import { attachFrame } from '../config/utils'; import { attachFrame } from '../config/utils';
it('should work for main frame navigation request', async ({page, server}) => { it('should work for main frame navigation request', async ({page, server}) => {

View file

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { test as it, expect } from '../config/pageTest'; import { test as it, expect } from './pageTest';
import fs from 'fs'; import fs from 'fs';
it('should work', async ({page, server}) => { it('should work', async ({page, server}) => {

View file

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { test as it, expect } from '../config/pageTest'; import { test as it, expect } from './pageTest';
it('should work', async ({page, server}) => { it('should work', async ({page, server}) => {
await page.route('**/*', route => route.continue()); await page.route('**/*', route => route.continue());

View file

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { test as it, expect } from '../config/pageTest'; import { test as it, expect } from './pageTest';
import fs from 'fs'; import fs from 'fs';
it('should work', async ({page, server}) => { it('should work', async ({page, server}) => {

View file

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { test as it, expect } from '../config/pageTest'; import { test as it, expect } from './pageTest';
it('should intercept', async ({page, server}) => { it('should intercept', async ({page, server}) => {
let intercepted = false; let intercepted = false;

View file

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { test as it, expect } from '../config/pageTest'; import { test as it, expect } from './pageTest';
import { verifyViewport } from '../config/utils'; import { verifyViewport } from '../config/utils';
import path from 'path'; import path from 'path';
import fs from 'fs'; import fs from 'fs';

View file

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { test as it, expect } from '../config/pageTest'; import { test as it, expect } from './pageTest';
async function giveItAChanceToResolve(page) { async function giveItAChanceToResolve(page) {
for (let i = 0; i < 5; i++) for (let i = 0; i < 5; i++)

View file

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { test as it, expect } from '../config/pageTest'; import { test as it, expect } from './pageTest';
const expectedOutput = '<html><head></head><body><div>hello</div></body></html>'; const expectedOutput = '<html><head></head><body><div>hello</div></body></html>';

View file

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { test as it, expect } from '../config/pageTest'; import { test as it, expect } from './pageTest';
it('should work', async ({page, server}) => { it('should work', async ({page, server}) => {
await page.setExtraHTTPHeaders({ await page.setExtraHTTPHeaders({

View file

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { test as it, expect } from '../config/pageTest'; import { test as it, expect } from './pageTest';
import path from 'path'; import path from 'path';
import fs from 'fs'; import fs from 'fs';

View file

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { test as it, expect } from '../config/pageTest'; import { test as it, expect } from './pageTest';
it('should timeout', async ({page}) => { it('should timeout', async ({page}) => {
const startTime = Date.now(); const startTime = Date.now();

View file

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { test as it, expect } from '../config/pageTest'; import { test as it, expect } from './pageTest';
import type { Route } from '../../index'; import type { Route } from '../../index';
it('should pick up ongoing navigation', async ({page, server}) => { it('should pick up ongoing navigation', async ({page, server}) => {

View file

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { test as it, expect } from '../config/pageTest'; import { test as it, expect } from './pageTest';
import type { Frame } from '../../index'; import type { Frame } from '../../index';
import { expectedSSLError } from '../config/utils'; import { expectedSSLError } from '../config/utils';

View file

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { test as it, expect } from '../config/pageTest'; import { test as it, expect } from './pageTest';
import vm from 'vm'; import vm from 'vm';
it('should work', async ({page, server}) => { it('should work', async ({page, server}) => {

View file

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { test as it, expect } from '../config/pageTest'; import { test as it, expect } from './pageTest';
it('should work', async ({page, server}) => { it('should work', async ({page, server}) => {
await page.goto(server.EMPTY_PAGE); await page.goto(server.EMPTY_PAGE);

View file

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { test as it, expect } from '../config/pageTest'; import { test as it, expect } from './pageTest';
import { attachFrame, detachFrame } from '../config/utils'; import { attachFrame, detachFrame } from '../config/utils';
async function giveItTimeToLog(frame) { async function giveItTimeToLog(frame) {

View file

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { test as it, expect } from '../config/pageTest'; import { test as it, expect } from './pageTest';
import { attachFrame, detachFrame } from '../config/utils'; import { attachFrame, detachFrame } from '../config/utils';
const addElement = tag => document.body.appendChild(document.createElement(tag)); const addElement = tag => document.body.appendChild(document.createElement(tag));

View file

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { test as it, expect } from '../config/pageTest'; import { test as it, expect } from './pageTest';
it('should work', async ({page, server}) => { it('should work', async ({page, server}) => {
await page.goto(server.EMPTY_PAGE); await page.goto(server.EMPTY_PAGE);

View file

@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { baseTest } from './baseTest'; import { baseTest } from '../config/baseTest';
import type { Page } from '../../index'; import type { Page } from '../../index';
export { expect } from 'folio'; export { expect } from 'folio';

View file

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { test as it, expect } from '../config/pageTest'; import { test as it, expect } from './pageTest';
it('should throw for non-string selector', async ({page}) => { it('should throw for non-string selector', async ({page}) => {
const error = await page.$(null).catch(e => e); const error = await page.$(null).catch(e => e);

View file

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { test as it, expect } from '../config/pageTest'; import { test as it, expect } from './pageTest';
it('should work with large DOM', async ({page, server}) => { it('should work with large DOM', async ({page, server}) => {
await page.evaluate(() => { await page.evaluate(() => {

View file

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { test as it, expect } from '../config/pageTest'; import { test as it, expect } from './pageTest';
it('should work for open shadow roots', async ({page, server}) => { it('should work for open shadow roots', async ({page, server}) => {
await page.goto(server.PREFIX + '/deep-shadow.html'); await page.goto(server.PREFIX + '/deep-shadow.html');

View file

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { test as it, expect } from '../config/pageTest'; import { test as it, expect } from './pageTest';
it('should work', async ({page}) => { it('should work', async ({page}) => {
await page.setContent(`<div>yo</div><div>ya</div><div>\nye </div>`); await page.setContent(`<div>yo</div><div>ya</div><div>\nye </div>`);

View file

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { test as it, expect } from '../config/pageTest'; import { test as it, expect } from './pageTest';
import { attachFrame } from '../config/utils'; import { attachFrame } from '../config/utils';
import type { ConsoleMessage } from '../../index'; import type { ConsoleMessage } from '../../index';

View file

@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { test as it, expect } from './config/pageTest'; import { contextTest as it, expect } from './config/browserTest';
import { attachFrame } from './config/utils'; import { attachFrame } from './config/utils';
async function checkSlowMo(toImpl, page, task) { async function checkSlowMo(toImpl, page, task) {

Some files were not shown because too many files have changed in this diff Show more