test: roll to folio@0.4.0-alpha16 (#6656)

This commit is contained in:
Dmitry Gozman 2021-05-20 09:51:09 -07:00 committed by GitHub
parent ae35906fb5
commit 57f3a53a7e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 72 additions and 57 deletions

60
package-lock.json generated
View file

@ -20,17 +20,17 @@
"dev": true "dev": true
}, },
"@babel/core": { "@babel/core": {
"version": "7.14.2", "version": "7.14.3",
"resolved": "https://registry.npmjs.org/@babel/core/-/core-7.14.2.tgz", "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.14.3.tgz",
"integrity": "sha512-OgC1mON+l4U4B4wiohJlQNUU3H73mpTyYY3j/c8U9dr9UagGGSm+WFpzjy/YLdoyjiG++c1kIDgxCo/mLwQJeQ==", "integrity": "sha512-jB5AmTKOCSJIZ72sd78ECEhuPiDMKlQdDI/4QRI6lzYATx5SSogS1oQA2AoPecRCknm30gHi2l+QVvNUu3wZAg==",
"dev": true, "dev": true,
"requires": { "requires": {
"@babel/code-frame": "^7.12.13", "@babel/code-frame": "^7.12.13",
"@babel/generator": "^7.14.2", "@babel/generator": "^7.14.3",
"@babel/helper-compilation-targets": "^7.13.16", "@babel/helper-compilation-targets": "^7.13.16",
"@babel/helper-module-transforms": "^7.14.2", "@babel/helper-module-transforms": "^7.14.2",
"@babel/helpers": "^7.14.0", "@babel/helpers": "^7.14.0",
"@babel/parser": "^7.14.2", "@babel/parser": "^7.14.3",
"@babel/template": "^7.12.13", "@babel/template": "^7.12.13",
"@babel/traverse": "^7.14.2", "@babel/traverse": "^7.14.2",
"@babel/types": "^7.14.2", "@babel/types": "^7.14.2",
@ -66,9 +66,9 @@
} }
}, },
"@babel/generator": { "@babel/generator": {
"version": "7.14.2", "version": "7.14.3",
"resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.14.2.tgz", "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.14.3.tgz",
"integrity": "sha512-OnADYbKrffDVai5qcpkMxQ7caomHOoEwjkouqnN2QhydAjowFAZcsdecFIRUBdb+ZcruwYE4ythYmF1UBZU5xQ==", "integrity": "sha512-bn0S6flG/j0xtQdz3hsjJ624h3W0r3llttBMfyHX3YrZ/KtLYr15bjA0FXkgW7FpvrDuTuElXeVjiKlYRpnOFA==",
"dev": true, "dev": true,
"requires": { "requires": {
"@babel/types": "^7.14.2", "@babel/types": "^7.14.2",
@ -114,16 +114,16 @@
} }
}, },
"@babel/helper-create-class-features-plugin": { "@babel/helper-create-class-features-plugin": {
"version": "7.14.2", "version": "7.14.3",
"resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.14.2.tgz", "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.14.3.tgz",
"integrity": "sha512-6YctwVsmlkchxfGUogvVrrhzyD3grFJyluj5JgDlQrwfMLJSt5tdAzFZfPf4H2Xoi5YLcQ6BxfJlaOBHuctyIw==", "integrity": "sha512-BnEfi5+6J2Lte9LeiL6TxLWdIlEv9Woacc1qXzXBgbikcOzMRM2Oya5XGg/f/ngotv1ej2A/b+3iJH8wbS1+lQ==",
"dev": true, "dev": true,
"requires": { "requires": {
"@babel/helper-annotate-as-pure": "^7.12.13", "@babel/helper-annotate-as-pure": "^7.12.13",
"@babel/helper-function-name": "^7.14.2", "@babel/helper-function-name": "^7.14.2",
"@babel/helper-member-expression-to-functions": "^7.13.12", "@babel/helper-member-expression-to-functions": "^7.13.12",
"@babel/helper-optimise-call-expression": "^7.12.13", "@babel/helper-optimise-call-expression": "^7.12.13",
"@babel/helper-replace-supers": "^7.13.12", "@babel/helper-replace-supers": "^7.14.3",
"@babel/helper-split-export-declaration": "^7.12.13" "@babel/helper-split-export-declaration": "^7.12.13"
} }
}, },
@ -197,15 +197,15 @@
"dev": true "dev": true
}, },
"@babel/helper-replace-supers": { "@babel/helper-replace-supers": {
"version": "7.13.12", "version": "7.14.3",
"resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.13.12.tgz", "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.14.3.tgz",
"integrity": "sha512-Gz1eiX+4yDO8mT+heB94aLVNCL+rbuT2xy4YfyNqu8F+OI6vMvJK891qGBTqL9Uc8wxEvRW92Id6G7sDen3fFw==", "integrity": "sha512-Rlh8qEWZSTfdz+tgNV/N4gz1a0TMNwCUcENhMjHTHKp3LseYH5Jha0NSlyTQWMnjbYcwFt+bqAMqSLHVXkQ6UA==",
"dev": true, "dev": true,
"requires": { "requires": {
"@babel/helper-member-expression-to-functions": "^7.13.12", "@babel/helper-member-expression-to-functions": "^7.13.12",
"@babel/helper-optimise-call-expression": "^7.12.13", "@babel/helper-optimise-call-expression": "^7.12.13",
"@babel/traverse": "^7.13.0", "@babel/traverse": "^7.14.2",
"@babel/types": "^7.13.12" "@babel/types": "^7.14.2"
} }
}, },
"@babel/helper-simple-access": { "@babel/helper-simple-access": {
@ -270,9 +270,9 @@
} }
}, },
"@babel/parser": { "@babel/parser": {
"version": "7.14.2", "version": "7.14.3",
"resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.14.2.tgz", "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.14.3.tgz",
"integrity": "sha512-IoVDIHpsgE/fu7eXBeRWt8zLbDrSvD7H1gpomOkPpBoEN8KCruCqSDdqo8dddwQQrui30KSvQBaMUOJiuFu6QQ==", "integrity": "sha512-7MpZDIfI7sUC5zWo2+foJ50CSI5lcqDehZ0lVgIhSi4bFEk94fLAKlF3Q0nzSQQ+ca0lm+O6G9ztKVBeu8PMRQ==",
"dev": true "dev": true
}, },
"@babel/plugin-proposal-class-properties": { "@babel/plugin-proposal-class-properties": {
@ -489,12 +489,12 @@
} }
}, },
"@babel/plugin-transform-typescript": { "@babel/plugin-transform-typescript": {
"version": "7.13.0", "version": "7.14.3",
"resolved": "https://registry.npmjs.org/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.13.0.tgz", "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.14.3.tgz",
"integrity": "sha512-elQEwluzaU8R8dbVuW2Q2Y8Nznf7hnjM7+DSCd14Lo5fF63C9qNLbwZYbmZrtV9/ySpSUpkRpQXvJb6xyu4hCQ==", "integrity": "sha512-G5Bb5pY6tJRTC4ag1visSgiDoGgJ1u1fMUgmc2ijLkcIdzP83Q1qyZX4ggFQ/SkR+PNOatkaYC+nKcTlpsX4ag==",
"dev": true, "dev": true,
"requires": { "requires": {
"@babel/helper-create-class-features-plugin": "^7.13.0", "@babel/helper-create-class-features-plugin": "^7.14.3",
"@babel/helper-plugin-utils": "^7.13.0", "@babel/helper-plugin-utils": "^7.13.0",
"@babel/plugin-syntax-typescript": "^7.12.13" "@babel/plugin-syntax-typescript": "^7.12.13"
} }
@ -2659,9 +2659,9 @@
} }
}, },
"electron-to-chromium": { "electron-to-chromium": {
"version": "1.3.728", "version": "1.3.734",
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.728.tgz", "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.734.tgz",
"integrity": "sha512-SHv4ziXruBpb1Nz4aTuqEHBYi/9GNCJMYIJgDEXrp/2V01nFXMNFUTli5Z85f5ivSkioLilQatqBYFB44wNJrA==", "integrity": "sha512-iQF2mjPZ6zNNq45kbJ6MYZYCBNdv2JpGiJC/lVx4tGJWi9MNg73KkL9sWGN4X4I/CP2SBLWsT8nPADZZpAHIyw==",
"dev": true "dev": true
}, },
"elliptic": { "elliptic": {
@ -3483,9 +3483,9 @@
} }
}, },
"folio": { "folio": {
"version": "0.4.0-alpha14", "version": "0.4.0-alpha16",
"resolved": "https://registry.npmjs.org/folio/-/folio-0.4.0-alpha14.tgz", "resolved": "https://registry.npmjs.org/folio/-/folio-0.4.0-alpha16.tgz",
"integrity": "sha512-rQdHvFmczTtMFy2mlBRWMX6keC1Dd0bfJzF3NfU/H9JcYrU9zv6TuXiN662hC7Z+aky14JpIRNawwg+FVi1Bog==", "integrity": "sha512-rxtXJXLkRnGpWc1tfrz2lI60/T5vb7hEoxmgaZQaq/D7LRrFOqyDWVWy3NKloWGHX+UKFWQERVYO6xRnSbrXnA==",
"dev": true, "dev": true,
"requires": { "requires": {
"@babel/code-frame": "^7.12.13", "@babel/code-frame": "^7.12.13",

View file

@ -80,7 +80,7 @@
"eslint-plugin-notice": "^0.9.10", "eslint-plugin-notice": "^0.9.10",
"eslint-plugin-react-hooks": "^4.2.0", "eslint-plugin-react-hooks": "^4.2.0",
"file-loader": "^6.1.0", "file-loader": "^6.1.0",
"folio": "=0.4.0-alpha14", "folio": "=0.4.0-alpha16",
"formidable": "^1.2.2", "formidable": "^1.2.2",
"html-webpack-plugin": "^4.4.1", "html-webpack-plugin": "^4.4.1",
"ncp": "^2.0.0", "ncp": "^2.0.0",

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

View file

@ -24,7 +24,7 @@ type AndroidWorkerFixtures = {
androidDevice: AndroidDevice; androidDevice: AndroidDevice;
}; };
export const androidFixtures: folio.Fixtures<PageTestFixtures & { __androidSetup: void }, AndroidWorkerFixtures & { androidContext: BrowserContext }, {}, CommonWorkerFixtures> = { export const androidFixtures: folio.Fixtures<PageTestFixtures, AndroidWorkerFixtures & { androidContext: BrowserContext }, {}, CommonWorkerFixtures> = {
androidDevice: [ async ({ playwright }, run) => { androidDevice: [ async ({ playwright }, run) => {
const device = (await playwright._android.devices())[0]; const device = (await playwright._android.devices())[0];
await device.shell('am force-stop org.chromium.webview_shell'); await device.shell('am force-stop org.chromium.webview_shell');
@ -51,13 +51,6 @@ export const androidFixtures: folio.Fixtures<PageTestFixtures & { __androidSetup
isAndroid: true, isAndroid: true,
isElectron: false, isElectron: false,
__androidSetup: [ async ({ browserVersion }, run, testInfo) => {
testInfo.data.platform = 'Android';
testInfo.data.headful = true;
testInfo.data.browserVersion = browserVersion;
await run();
}, { auto: true } ],
androidContext: [ async ({ androidDevice }, run) => { androidContext: [ async ({ androidDevice }, run) => {
await run(await androidDevice.launchBrowser()); await run(await androidDevice.launchBrowser());
}, { scope: 'worker' } ], }, { scope: 'worker' } ],

View file

@ -132,7 +132,7 @@ it('should return bounding box with page scale', async ({ browser, server, brows
}); });
it('should not leak listeners during navigation of 20 pages', async ({contextFactory, server}) => { it('should not leak listeners during navigation of 20 pages', async ({contextFactory, server}) => {
it.slow('We open 20 pages here!'); it.slow(true, 'We open 20 pages here!');
const context = await contextFactory(); const context = await contextFactory();
let warning = null; let warning = null;

View file

@ -19,7 +19,7 @@ import { playwrightTest as test, expect } from './config/browserTest';
import fs from 'fs'; import fs from 'fs';
import * as path from 'path'; import * as path from 'path';
test.slow('All connect tests are slow'); test.slow(true, 'All connect tests are slow');
test('should be able to reconnect to a browser', async ({browserType, startRemoteServer, server}) => { test('should be able to reconnect to a browser', async ({browserType, startRemoteServer, server}) => {
const remoteServer = await startRemoteServer(); const remoteServer = await startRemoteServer();

View file

@ -39,6 +39,15 @@ const config: folio.Config<CommonOptions & PlaywrightOptions> = {
projects: [], projects: [],
}; };
const metadata = {
platform: 'Android',
headful: false,
browserName: 'chromium',
channel: undefined,
mode: 'default',
video: false,
};
config.projects.push({ config.projects.push({
name: 'android', name: 'android',
use: { use: {
@ -47,6 +56,7 @@ config.projects.push({
browserName: 'chromium', browserName: 'chromium',
}, },
testDir: path.join(testDir, 'android'), testDir: path.join(testDir, 'android'),
metadata,
}); });
config.projects.push({ config.projects.push({
@ -58,6 +68,7 @@ config.projects.push({
}, },
testDir: path.join(testDir, 'page'), testDir: path.join(testDir, 'page'),
define: { test: pageTest, fixtures: androidFixtures }, define: { test: pageTest, fixtures: androidFixtures },
metadata,
}); });
export default config; export default config;

View file

@ -123,15 +123,8 @@ const baseFixtures: folio.Fixtures<{ __baseSetup: void }, BaseOptions & BaseFixt
isWindows: [ process.platform === 'win32', { scope: 'worker' } ], isWindows: [ process.platform === 'win32', { scope: 'worker' } ],
isMac: [ process.platform === 'darwin', { scope: 'worker' } ], isMac: [ process.platform === 'darwin', { scope: 'worker' } ],
isLinux: [ process.platform === 'linux', { scope: 'worker' } ], isLinux: [ process.platform === 'linux', { scope: 'worker' } ],
__baseSetup: [ async ({ browserName, headless, mode, video }, run, testInfo) => { __baseSetup: [ async ({ browserName }, run, testInfo) => {
testInfo.snapshotPathSegment = browserName; testInfo.snapshotPathSegment = browserName;
testInfo.data = { browserName };
if (!headless)
testInfo.data.headful = true;
if (mode !== 'default')
testInfo.data.mode = mode;
if (video)
testInfo.data.video = true;
await run(); await run();
}, { auto: true } ], }, { auto: true } ],
}; };

View file

@ -129,7 +129,6 @@ export const playwrightFixtures: folio.Fixtures<PlaywrightTestOptions & Playwrig
}, },
contextOptions: async ({ video, hasTouch, browserVersion }, run, testInfo) => { contextOptions: async ({ video, hasTouch, browserVersion }, run, testInfo) => {
testInfo.data.browserVersion = browserVersion;
const debugName = path.relative(testInfo.project.outputDir, testInfo.outputDir).replace(/[\/\\]/g, '-'); const debugName = path.relative(testInfo.project.outputDir, testInfo.outputDir).replace(/[\/\\]/g, '-');
const contextOptions = { const contextOptions = {
recordVideo: video ? { dir: testInfo.outputPath('') } : undefined, recordVideo: video ? { dir: testInfo.outputPath('') } : undefined,

View file

@ -83,6 +83,14 @@ for (const browserName of browserNames) {
coverageName: browserName, coverageName: browserName,
}, },
define: { test: pageTest, fixtures: pageFixtures }, define: { test: pageTest, fixtures: pageFixtures },
metadata: {
platform: process.platform,
headful: !!headed,
browserName,
channel,
mode,
video: !!video,
},
}); });
} }

View file

@ -39,6 +39,15 @@ const config: folio.Config<CommonOptions & PlaywrightOptions> = {
projects: [], projects: [],
}; };
const metadata = {
platform: process.platform,
headful: true,
browserName: 'electron',
channel: undefined,
mode: 'default',
video: false,
};
config.projects.push({ config.projects.push({
name: 'electron', name: 'electron',
use: { use: {
@ -47,6 +56,7 @@ config.projects.push({
coverageName: 'electron', coverageName: 'electron',
}, },
testDir: path.join(testDir, 'electron'), testDir: path.join(testDir, 'electron'),
metadata,
}); });
config.projects.push({ config.projects.push({
@ -58,6 +68,7 @@ config.projects.push({
}, },
testDir: path.join(testDir, 'page'), testDir: path.join(testDir, 'page'),
define: { test: pageTest, fixtures: electronFixtures }, define: { test: pageTest, fixtures: electronFixtures },
metadata,
}); });
export default config; export default config;

View file

@ -171,7 +171,7 @@ it('should support offline option', async ({server, launchPersistent}) => {
}); });
it('should support acceptDownloads option', async ({server, launchPersistent}) => { it('should support acceptDownloads option', async ({server, launchPersistent}) => {
it.skip('Unskip once we support downloads in persistent context.'); it.skip(true, 'Unskip once we support downloads in persistent context.');
const {page} = await launchPersistent({acceptDownloads: true}); const {page} = await launchPersistent({acceptDownloads: true});
server.setRoute('/download', (req, res) => { server.setRoute('/download', (req, res) => {

View file

@ -72,7 +72,7 @@ it.describe('Drag and drop', () => {
}); });
it.describe('iframe', () => { it.describe('iframe', () => {
it.fixme('implement dragging with iframes'); it.fixme(true, 'implement dragging with iframes');
it('should drag into an iframe', async ({server, page, browserName}) => { it('should drag into an iframe', async ({server, page, browserName}) => {
await page.goto(server.PREFIX + '/drag-n-drop.html'); await page.goto(server.PREFIX + '/drag-n-drop.html');

View file

@ -175,7 +175,7 @@ it('does launch without a port', async ({ browserType, browserOptions }) => {
}); });
it('should use proxy', async ({ browserType, browserOptions }) => { it('should use proxy', async ({ browserType, browserOptions }) => {
it.fixme('Non-emulated user agent is used in proxy CONNECT'); it.fixme(true, 'Non-emulated user agent is used in proxy CONNECT');
let requestText = ''; let requestText = '';
// This is our proxy server // This is our proxy server

View file

@ -51,9 +51,9 @@ browserTest.describe('page screenshot', () => {
await context.close(); await context.close();
}); });
browserTest('should work with a mobile viewport and clip', async ({browser, server, browserName}) => { browserTest('should work with a mobile viewport and clip', async ({browser, server, browserName, channel}) => {
browserTest.skip(browserName === 'firefox'); browserTest.skip(browserName === 'firefox');
browserTest.skip(process.env.CRPATH); // Does not work in stable Chrome. browserTest.skip(!!channel, 'Different result in stable/beta');
const context = await browser.newContext({viewport: { width: 320, height: 480 }, isMobile: true}); const context = await browser.newContext({viewport: { width: 320, height: 480 }, isMobile: true});
const page = await context.newPage(); const page = await context.newPage();
@ -85,7 +85,7 @@ browserTest.describe('page screenshot', () => {
browserTest('should work with large size', async ({ browserName, headless, platform, contextFactory }) => { 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.fixme(browserName === 'chromium' && !headless && platform === 'linux', 'Chromium has gpu problems on linux with large screnshots');
browserTest.slow('Large screenshot is slow'); browserTest.slow(true, 'Large screenshot is slow');
const context = await contextFactory(); const context = await contextFactory();
const page = await context.newPage(); const page = await context.newPage();

View file

@ -18,7 +18,7 @@
import { playwrightTest as test, expect } from './config/browserTest'; import { playwrightTest as test, expect } from './config/browserTest';
import { execSync } from 'child_process'; import { execSync } from 'child_process';
test.slow('All signal tests are slow'); test.slow();
test('should close the browser when the node process closes', async ({startRemoteServer, isWindows, server}) => { test('should close the browser when the node process closes', async ({startRemoteServer, isWindows, server}) => {
const remoteServer = await startRemoteServer({ url: server.EMPTY_PAGE }); const remoteServer = await startRemoteServer({ url: server.EMPTY_PAGE });