tests: move ws-specific browser tests to corrsponding browser suites
This commit is contained in:
parent
6d0dfd0abf
commit
52777c4888
|
|
@ -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();
|
||||
});
|
||||
});
|
||||
};
|
||||
|
|
|
|||
31
test/chromium/browser.spec.js
Normal file
31
test/chromium/browser.spec.js
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
/**
|
||||
* Copyright 2018 Google Inc. All rights reserved.
|
||||
* Modifications copyright (c) Microsoft Corporation.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the 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();
|
||||
});
|
||||
});
|
||||
};
|
||||
|
|
@ -36,6 +36,15 @@ module.exports.addTests = function({testRunner, expect, playwright, FFOX, CHROME
|
|||
});
|
||||
});
|
||||
|
||||
describe('Browser.process', function() {
|
||||
fit('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();
|
||||
});
|
||||
});
|
||||
|
||||
describe('Target', function() {
|
||||
it('Chromium.targets should return all of the targets', async({page, server, browser}) => {
|
||||
// The pages will be the testing page and the original newtab page
|
||||
|
|
|
|||
31
test/firefox/browser.spec.js
Normal file
31
test/firefox/browser.spec.js
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
/**
|
||||
* Copyright 2018 Google Inc. All rights reserved.
|
||||
* Modifications copyright (c) Microsoft Corporation.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the 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();
|
||||
});
|
||||
});
|
||||
};
|
||||
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Reference in a new issue