Skip to content

Commit e0c8fbf

Browse files
authored
test: put test runner api on global, remove unused parameters (#1684)
1 parent e15fc08 commit e0c8fbf

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+70
-236
lines changed

test/accessibility.spec.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,7 @@
1818
/**
1919
* @type {PageTestSuite}
2020
*/
21-
module.exports.describe = function({testRunner, expect, FFOX, CHROMIUM, WEBKIT, MAC}) {
22-
const {describe, xdescribe, fdescribe} = testRunner;
23-
const {it, fit, xit, dit} = testRunner;
24-
const {beforeAll, beforeEach, afterAll, afterEach} = testRunner;
21+
module.exports.describe = function({FFOX, CHROMIUM, WEBKIT, MAC}) {
2522

2623
describe('Accessibility', function() {
2724
it('should work', async function({page}) {

test/assets/playwrightweb.html

Lines changed: 0 additions & 12 deletions
This file was deleted.

test/autowaiting.spec.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,7 @@
1818
/**
1919
* @type {PageTestSuite}
2020
*/
21-
module.exports.describe = function({testRunner, expect, playwright, MAC, WIN, FFOX, CHROMIUM, WEBKIT}) {
22-
const {describe, xdescribe, fdescribe} = testRunner;
23-
const {it, fit, xit, dit} = testRunner;
24-
const {beforeAll, beforeEach, afterAll, afterEach} = testRunner;
21+
module.exports.describe = function({playwright, MAC, WIN, FFOX, CHROMIUM, WEBKIT}) {
2522

2623
describe('Auto waiting', () => {
2724
it('should await navigation when clicking anchor', async({page, server}) => {

test/browser.spec.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,10 @@
1414
* limitations under the License.
1515
*/
1616

17-
const utils = require('./utils');
18-
1917
/**
2018
* @type {BrowserTestSuite}
2119
*/
22-
module.exports.describe = function({testRunner, expect, playwright, CHROMIUM, WEBKIT}) {
23-
const {describe, xdescribe, fdescribe} = testRunner;
24-
const {it, fit, xit, dit} = testRunner;
25-
const {beforeAll, beforeEach, afterAll, afterEach} = testRunner;
20+
module.exports.describe = function({playwright, CHROMIUM, WEBKIT}) {
2621

2722
describe('Browser.newPage', function() {
2823
it('should create new page', async function({browser}) {

test/browsercontext.spec.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,7 @@ const utils = require('./utils');
2020
/**
2121
* @type {BrowserTestSuite}
2222
*/
23-
module.exports.describe = function({testRunner, expect, playwright, CHROMIUM, FFOX, WEBKIT, LINUX}) {
24-
const {describe, xdescribe, fdescribe} = testRunner;
25-
const {it, fit, xit, dit} = testRunner;
26-
const {beforeAll, beforeEach, afterAll, afterEach} = testRunner;
23+
module.exports.describe = function({playwright, CHROMIUM, FFOX, WEBKIT, LINUX}) {
2724

2825
describe('BrowserContext', function() {
2926
it('should create new context', async function({browser}) {

test/capabilities.spec.js

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,10 @@
1414
* limitations under the License.
1515
*/
1616

17-
const utils = require('./utils');
18-
const { waitEvent } = utils;
19-
2017
/**
2118
* @type {PageTestSuite}
2219
*/
23-
module.exports.describe = function({testRunner, expect, WIN, WEBKIT}) {
24-
const {describe, xdescribe, fdescribe} = testRunner;
25-
const {it, fit, xit, dit} = testRunner;
26-
const {beforeAll, beforeEach, afterAll, afterEach} = testRunner;
20+
module.exports.describe = function({WIN, WEBKIT}) {
2721

2822
describe('Capabilities', function() {
2923
it.fail(WEBKIT && WIN)('Web Assembly should work', async function({page, server}) {

test/chromium/chromium.spec.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,10 @@
1414
* limitations under the License.
1515
*/
1616

17-
const { waitEvent } = require('../utils');
18-
1917
/**
2018
* @type {ChromiumTestSuite}
2119
*/
22-
module.exports.describe = function({testRunner, expect, playwright, FFOX, CHROMIUM, WEBKIT}) {
23-
const {describe, xdescribe, fdescribe} = testRunner;
24-
const {it, fit, xit, dit} = testRunner;
25-
const {beforeAll, beforeEach, afterAll, afterEach} = testRunner;
20+
module.exports.describe = function({playwright, FFOX, CHROMIUM, WEBKIT}) {
2621

2722
describe('ChromiumBrowserContext', function() {
2823
it('should create a worker from a service worker', async({browser, page, server, context}) => {

test/chromium/coverage.spec.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,7 @@
1717
/**
1818
* @type {ChromiumTestSuite}
1919
*/
20-
module.exports.describe = function({testRunner, expect, FFOX, CHROMIUM, WEBKIT}) {
21-
const {describe, xdescribe, fdescribe} = testRunner;
22-
const {it, fit, xit, dit} = testRunner;
23-
const {beforeAll, beforeEach, afterAll, afterEach} = testRunner;
20+
module.exports.describe = function({FFOX, CHROMIUM, WEBKIT}) {
2421

2522
describe('JSCoverage', function() {
2623
it('should work', async function({page, server}) {

test/chromium/launcher.spec.js

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,21 +18,12 @@ const util = require('util');
1818
const fs = require('fs');
1919
const path = require('path');
2020
const os = require('os');
21-
const readFileAsync = util.promisify(fs.readFile);
22-
const rmAsync = util.promisify(require('rimraf'));
23-
const mkdtempAsync = util.promisify(fs.mkdtemp);
24-
const statAsync = util.promisify(fs.stat);
2521
const { makeUserDataDir, removeUserDataDir } = require('../utils');
2622

27-
const TMP_FOLDER = path.join(os.tmpdir(), 'pw_tmp_folder-');
28-
2923
/**
3024
* @type {TestSuite}
3125
*/
32-
module.exports.describe = function({testRunner, expect, defaultBrowserOptions, browserType, WIN}) {
33-
const {describe, xdescribe, fdescribe} = testRunner;
34-
const {it, fit, xit, dit} = testRunner;
35-
const {beforeAll, beforeEach, afterAll, afterEach} = testRunner;
26+
module.exports.describe = function({defaultBrowserOptions, browserType, WIN}) {
3627

3728
const headfulOptions = Object.assign({}, defaultBrowserOptions, {
3829
headless: false

test/chromium/oopif.spec.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,7 @@
1717
/**
1818
* @type {ChromiumTestSuite}
1919
*/
20-
module.exports.describe = function({testRunner, expect, defaultBrowserOptions, browserType, FFOX, CHROMIUM, WEBKIT}) {
21-
const {describe, xdescribe, fdescribe} = testRunner;
22-
const {it, fit, xit, dit} = testRunner;
23-
const {beforeAll, beforeEach, afterAll, afterEach} = testRunner;
20+
module.exports.describe = function({defaultBrowserOptions, browserType, FFOX, CHROMIUM, WEBKIT}) {
2421

2522
const headfulOptions = Object.assign({}, defaultBrowserOptions, {
2623
headless: false

0 commit comments

Comments
 (0)