Skip to content

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.

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

Yury Semikhatskyadf54ee6b3da
diff --git a/test/browser.spec.js b/test/browser.spec.js
index c0c2fd0561..8adc0c1dd6 100644
--- a/test/browser.spec.js
+++ b/test/browser.spec.js
@@ -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();
- });
});
};
diff --git a/test/chromium/browser.spec.js b/test/chromium/browser.spec.js
new file mode 100644
index 0000000000..3c07998c08
--- /dev/null
+++ b/test/chromium/browser.spec.js
@@ -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();
+ });
+ });
+};
diff --git a/test/firefox/browser.spec.js b/test/firefox/browser.spec.js
new file mode 100644
index 0000000000..91c8d2f1f9
--- /dev/null
+++ b/test/firefox/browser.spec.js
@@ -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();
+ });
+ });
+};
diff --git a/test/playwright.spec.js b/test/playwright.spec.js
index 22ee27383d..78b959698e 100644
--- a/test/playwright.spec.js
+++ b/test/playwright.spec.js
@@ -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.