tests: move ws-specific browser tests to corrsponding browser suites (#289)

This commit is contained in:
Yury Semikhatsky 2019-12-18 13:28:23 -07:00 committed by GitHub
parent 6d0dfd0abf
commit adf54ee6b3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 41 additions and 7 deletions

View File

@ -49,11 +49,5 @@ module.exports.addTests = function({testRunner, expect, headless, playwright, FF
const process = await browser.process();
expect(process.pid).toBeGreaterThan(0);
});
it.skip(WEBKIT || FFOX)('should not return child_process for remote browser', async function({browser}) {
const browserWSEndpoint = browser.chromium.wsEndpoint();
const remoteBrowser = await playwright.connect({browserWSEndpoint});
expect(remoteBrowser.process()).toBe(null);
remoteBrowser.disconnect();
});
});
};

View File

@ -0,0 +1,17 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
module.exports.addTests = function({testRunner, expect, headless, playwright, FFOX, CHROME, WEBKIT}) {
const {describe, xdescribe, fdescribe} = testRunner;
const {it, fit, xit} = testRunner;
const {beforeAll, beforeEach, afterAll, afterEach} = testRunner;
describe('Browser.process', function() {
it('should not return child_process for remote browser', async function({browser}) {
const browserWSEndpoint = browser.chromium.wsEndpoint();
const remoteBrowser = await playwright.connect({browserWSEndpoint});
expect(remoteBrowser.process()).toBe(null);
remoteBrowser.disconnect();
});
});
};

View File

@ -0,0 +1,17 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
module.exports.addTests = function({testRunner, expect, headless, playwright, FFOX, CHROME, WEBKIT}) {
const {describe, xdescribe, fdescribe} = testRunner;
const {it, fit, xit} = testRunner;
const {beforeAll, beforeEach, afterAll, afterEach} = testRunner;
describe('Browser.process', function() {
it('should not return child_process for remote browser', async function({browser}) {
const browserWSEndpoint = browser.firefox.wsEndpoint();
const remoteBrowser = await playwright.connect({browserWSEndpoint});
expect(remoteBrowser.process()).toBe(null);
remoteBrowser.disconnect();
});
});
};

View File

@ -149,7 +149,6 @@ module.exports.addTests = ({testRunner, product, playwrightPath}) => {
// Page-level tests that are given a browser, a context and a page.
// Each test is launched in a new browser context.
require('./browser.spec.js').addTests(testOptions);
require('./click.spec.js').addTests(testOptions);
require('./cookies.spec.js').addTests(testOptions);
require('./dialog.spec.js').addTests(testOptions);
@ -186,8 +185,15 @@ module.exports.addTests = ({testRunner, product, playwrightPath}) => {
});
// Browser-level tests that are given a browser.
require('./browser.spec.js').addTests(testOptions);
require('./browsercontext.spec.js').addTests(testOptions);
require('./ignorehttpserrors.spec.js').addTests(testOptions);
if (CHROME) {
require('./chromium/browser.spec.js').addTests(testOptions);
}
if (FFOX) {
require('./firefox/browser.spec.js').addTests(testOptions);
}
});
// Top-level tests that launch Browser themselves.