diff --git a/package-lock.json b/package-lock.json index d3d770d3c7..fdf93d2e33 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1229,9 +1229,9 @@ } }, "@playwright/test-runner": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/@playwright/test-runner/-/test-runner-0.2.5.tgz", - "integrity": "sha512-gFQ+4Eiq4pY9menHX95r+QTOR2WMdsNebIbwoQhL2nJGjle9PwV1SiXl8P8+jJDOKmQ8+xW06+um1d5mSZTtRg==", + "version": "0.2.8", + "resolved": "https://registry.npmjs.org/@playwright/test-runner/-/test-runner-0.2.8.tgz", + "integrity": "sha512-FmUjAgVzVUhnHgC/j3hYZ5yOAhQXREYQtq0jbaV2oQk1b4KklDxo6lsf1nM2mb2SvBSv/gLbvbnpyciC4T/O7w==", "dev": true, "requires": { "@babel/code-frame": "^7.10.4", @@ -1242,6 +1242,7 @@ "commander": "^6.1.0", "expect": "^26.4.2", "jpeg-js": "^0.4.2", + "micromatch": "^4.0.2", "ms": "^2.1.2", "pirates": "^4.0.1", "pixelmatch": "^5.2.1", diff --git a/package.json b/package.json index 1c9da10753..3a03e20e22 100644 --- a/package.json +++ b/package.json @@ -54,7 +54,7 @@ "@babel/core": "^7.11.4", "@babel/preset-env": "^7.11.0", "@babel/preset-typescript": "^7.10.4", - "@playwright/test-runner": "^0.2.5", + "@playwright/test-runner": "^0.2.8", "@types/babel__core": "^7.1.9", "@types/debug": "^4.1.5", "@types/extract-zip": "^1.6.2", diff --git a/test/accessibility.spec.ts b/test/accessibility.spec.ts index fa98c37763..eded8623eb 100644 --- a/test/accessibility.spec.ts +++ b/test/accessibility.spec.ts @@ -14,7 +14,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { options } from './playwright.fixtures'; + +import { it, describe, options } from './playwright.fixtures'; it('should work', async function({page}) { await page.setContent(` diff --git a/test/autowaiting-basic.spec.ts b/test/autowaiting-basic.spec.ts index 3b5ba095d3..20dbd9e4c3 100644 --- a/test/autowaiting-basic.spec.ts +++ b/test/autowaiting-basic.spec.ts @@ -14,7 +14,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { options } from './playwright.fixtures'; + +import { it, options } from './playwright.fixtures'; it('should await navigation when clicking anchor', async ({page, server}) => { const messages = []; diff --git a/test/autowaiting-no-hang.spec.ts b/test/autowaiting-no-hang.spec.ts index d2b5f57a09..d8bf095660 100644 --- a/test/autowaiting-no-hang.spec.ts +++ b/test/autowaiting-no-hang.spec.ts @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import './playwright.fixtures'; +import { it } from './playwright.fixtures'; it('clicking on links which do not commit navigation', async ({page, server, httpsServer}) => { await page.goto(server.EMPTY_PAGE); diff --git a/test/browser.spec.ts b/test/browser.spec.ts index 960957e411..61379ac5e9 100644 --- a/test/browser.spec.ts +++ b/test/browser.spec.ts @@ -13,7 +13,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { options } from './playwright.fixtures'; + +import { it, options } from './playwright.fixtures'; it('should create new page', async function({browser}) { const page1 = await browser.newPage(); diff --git a/test/browsercontext-add-cookies.spec.ts b/test/browsercontext-add-cookies.spec.ts index e9da00c1a6..04c6d3c3b4 100644 --- a/test/browsercontext-add-cookies.spec.ts +++ b/test/browsercontext-add-cookies.spec.ts @@ -14,7 +14,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { options } from './playwright.fixtures'; + +import { it, options } from './playwright.fixtures'; it('should work', async ({context, page, server}) => { await page.goto(server.EMPTY_PAGE); diff --git a/test/browsercontext-basic.spec.ts b/test/browsercontext-basic.spec.ts index 380719ffdf..b1c879bd49 100644 --- a/test/browsercontext-basic.spec.ts +++ b/test/browsercontext-basic.spec.ts @@ -14,7 +14,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { options } from './playwright.fixtures'; + +import { it, options } from './playwright.fixtures'; import utils from './utils'; diff --git a/test/browsercontext-clearcookies.spec.ts b/test/browsercontext-clearcookies.spec.ts index 2cd7d86184..37c320d600 100644 --- a/test/browsercontext-clearcookies.spec.ts +++ b/test/browsercontext-clearcookies.spec.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import './playwright.fixtures'; +import { it } from './playwright.fixtures'; it('should clear cookies', async ({context, page, server}) => { await page.goto(server.EMPTY_PAGE); diff --git a/test/browsercontext-cookies.spec.ts b/test/browsercontext-cookies.spec.ts index efa5369e6b..d95920a154 100644 --- a/test/browsercontext-cookies.spec.ts +++ b/test/browsercontext-cookies.spec.ts @@ -14,7 +14,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { options } from './playwright.fixtures'; + +import { it, options } from './playwright.fixtures'; it('should return no cookies in pristine browser context', async ({context, page, server}) => { expect(await context.cookies()).toEqual([]); diff --git a/test/browsercontext-credentials.spec.ts b/test/browsercontext-credentials.spec.ts index 57e711bb77..126a5c74bb 100644 --- a/test/browsercontext-credentials.spec.ts +++ b/test/browsercontext-credentials.spec.ts @@ -14,7 +14,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { options } from './playwright.fixtures'; + +import { it, options } from './playwright.fixtures'; it('should fail without credentials', test => { test.fail(options.CHROMIUM && !options.HEADLESS); diff --git a/test/browsercontext-csp.spec.ts b/test/browsercontext-csp.spec.ts index d92e117e38..0cb2dd8c9a 100644 --- a/test/browsercontext-csp.spec.ts +++ b/test/browsercontext-csp.spec.ts @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import './playwright.fixtures'; +import { it } from './playwright.fixtures'; import * as utils from './utils'; diff --git a/test/browsercontext-device.spec.ts b/test/browsercontext-device.spec.ts index 4010386800..7ce197be5a 100644 --- a/test/browsercontext-device.spec.ts +++ b/test/browsercontext-device.spec.ts @@ -14,7 +14,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { options } from './playwright.fixtures'; + +import { it, describe, options } from './playwright.fixtures'; describe('device', suite => { suite.skip(options.FIREFOX); diff --git a/test/browsercontext-expose-function.spec.ts b/test/browsercontext-expose-function.spec.ts index 0329521476..b193a59a8c 100644 --- a/test/browsercontext-expose-function.spec.ts +++ b/test/browsercontext-expose-function.spec.ts @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import './playwright.fixtures'; +import { it } from './playwright.fixtures'; it('expose binding should work', async ({browser}) => { const context = await browser.newContext(); diff --git a/test/browsercontext-locale.spec.ts b/test/browsercontext-locale.spec.ts index 27646c60bb..abdb0b6fd0 100644 --- a/test/browsercontext-locale.spec.ts +++ b/test/browsercontext-locale.spec.ts @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import './playwright.fixtures'; +import { it } from './playwright.fixtures'; it('should affect accept-language header', async ({browser, server}) => { const context = await browser.newContext({ locale: 'fr-CH' }); diff --git a/test/browsercontext-page-event.spec.ts b/test/browsercontext-page-event.spec.ts index d2a1062238..ddd31a44bc 100644 --- a/test/browsercontext-page-event.spec.ts +++ b/test/browsercontext-page-event.spec.ts @@ -14,7 +14,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { options } from './playwright.fixtures'; + +import { it, options } from './playwright.fixtures'; it('should have url', async ({browser, server}) => { const context = await browser.newContext(); diff --git a/test/browsercontext-route.spec.ts b/test/browsercontext-route.spec.ts index 47b73dacaa..638692db0d 100644 --- a/test/browsercontext-route.spec.ts +++ b/test/browsercontext-route.spec.ts @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import './playwright.fixtures'; +import { it } from './playwright.fixtures'; it('should intercept', async ({browser, server}) => { const context = await browser.newContext(); diff --git a/test/browsercontext-timezone-id.spec.ts b/test/browsercontext-timezone-id.spec.ts index 84b61fc393..cdb9827e25 100644 --- a/test/browsercontext-timezone-id.spec.ts +++ b/test/browsercontext-timezone-id.spec.ts @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import './playwright.fixtures'; +import { it } from './playwright.fixtures'; it('should work', async ({ browser }) => { const func = () => new Date(1479579154987).toString(); diff --git a/test/browsercontext-user-agent.spec.ts b/test/browsercontext-user-agent.spec.ts index e964eb3693..adc088edbe 100644 --- a/test/browsercontext-user-agent.spec.ts +++ b/test/browsercontext-user-agent.spec.ts @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import './playwright.fixtures'; +import { it } from './playwright.fixtures'; import utils from './utils'; diff --git a/test/browsercontext-viewport-mobile.spec.ts b/test/browsercontext-viewport-mobile.spec.ts index 056e0a37b7..7e6085f39b 100644 --- a/test/browsercontext-viewport-mobile.spec.ts +++ b/test/browsercontext-viewport-mobile.spec.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import { options } from './playwright.fixtures'; +import { it, describe, options } from './playwright.fixtures'; describe('mobile viewport', suite => { suite.skip(options.FIREFOX); diff --git a/test/browsercontext-viewport.spec.ts b/test/browsercontext-viewport.spec.ts index dcf175b7a7..be8de82931 100644 --- a/test/browsercontext-viewport.spec.ts +++ b/test/browsercontext-viewport.spec.ts @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import './playwright.fixtures'; +import { it } from './playwright.fixtures'; import utils from './utils'; diff --git a/test/browsertype-basic.spec.ts b/test/browsertype-basic.spec.ts index 85c8cb8bfc..7627763b65 100644 --- a/test/browsertype-basic.spec.ts +++ b/test/browsertype-basic.spec.ts @@ -16,7 +16,7 @@ */ import fs from 'fs'; -import { options } from './playwright.fixtures'; +import { it, options } from './playwright.fixtures'; it('browserType.executablePath should work', test => { test.skip(Boolean(process.env.CRPATH || process.env.FFPATH || process.env.WKPATH)); diff --git a/test/browsertype-connect.spec.ts b/test/browsertype-connect.spec.ts index 5e89d2c4b5..4c84b9d36a 100644 --- a/test/browsertype-connect.spec.ts +++ b/test/browsertype-connect.spec.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import { options } from './playwright.fixtures'; +import { it, describe, options } from './playwright.fixtures'; import utils from './utils'; import './remoteServer.fixture'; diff --git a/test/browsertype-launch-server.spec.ts b/test/browsertype-launch-server.spec.ts index 0daef7d0b4..a098469cbc 100644 --- a/test/browsertype-launch-server.spec.ts +++ b/test/browsertype-launch-server.spec.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import { options } from './playwright.fixtures'; +import { it, describe, options } from './playwright.fixtures'; describe('lauch server', suite => { suite.skip(options.WIRE); diff --git a/test/browsertype-launch.spec.ts b/test/browsertype-launch.spec.ts index 2e3f28383e..c791b875b4 100644 --- a/test/browsertype-launch.spec.ts +++ b/test/browsertype-launch.spec.ts @@ -16,7 +16,7 @@ */ import path from 'path'; -import { options } from './playwright.fixtures'; +import { it, options } from './playwright.fixtures'; it('should reject all promises when browser is closed', async ({browserType, defaultBrowserOptions}) => { const browser = await browserType.launch(defaultBrowserOptions); diff --git a/test/capabilities.spec.ts b/test/capabilities.spec.ts index d6633b1533..7b596b7933 100644 --- a/test/capabilities.spec.ts +++ b/test/capabilities.spec.ts @@ -15,7 +15,7 @@ */ import url from 'url'; -import { options } from './playwright.fixtures'; +import { it, options } from './playwright.fixtures'; it('Web Assembly should work', test => { test.fail(options.WEBKIT && WIN); diff --git a/test/channels.spec.ts b/test/channels.spec.ts index 6ff3e402e3..9a3e23c7a3 100644 --- a/test/channels.spec.ts +++ b/test/channels.spec.ts @@ -14,7 +14,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { options } from './playwright.fixtures'; + +import { it, options } from './playwright.fixtures'; import type { ChromiumBrowser } from '..'; it('should work', async ({browser}) => { diff --git a/test/check.spec.ts b/test/check.spec.ts index 05f4b1afd1..95e7505b2c 100644 --- a/test/check.spec.ts +++ b/test/check.spec.ts @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import './playwright.fixtures'; +import { it } from './playwright.fixtures'; it('should check the box', async ({page}) => { await page.setContent(``); diff --git a/test/chromium-css-coverage.spec.ts b/test/chromium-css-coverage.spec.ts index ec55553a4c..2f9d8f9489 100644 --- a/test/chromium-css-coverage.spec.ts +++ b/test/chromium-css-coverage.spec.ts @@ -13,7 +13,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { options } from './playwright.fixtures'; + +import { it, describe, options } from './playwright.fixtures'; describe('oopif', suite => { suite.skip(!options.CHROMIUM); diff --git a/test/chromium-js-coverage.spec.ts b/test/chromium-js-coverage.spec.ts index dfa78b7500..2971bfa6b0 100644 --- a/test/chromium-js-coverage.spec.ts +++ b/test/chromium-js-coverage.spec.ts @@ -13,7 +13,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { options } from './playwright.fixtures'; + +import { it, describe, options } from './playwright.fixtures'; it('should be missing', test => { test.skip(options.CHROMIUM); diff --git a/test/chromium/chromium.spec.ts b/test/chromium/chromium.spec.ts index 50b076b10c..50ffdbf298 100644 --- a/test/chromium/chromium.spec.ts +++ b/test/chromium/chromium.spec.ts @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { options } from '../playwright.fixtures'; +import { it, describe, options } from '../playwright.fixtures'; import type { ChromiumBrowserContext } from '../..'; describe('chromium', suite => { diff --git a/test/chromium/launcher.spec.ts b/test/chromium/launcher.spec.ts index 21159f99cb..487239c880 100644 --- a/test/chromium/launcher.spec.ts +++ b/test/chromium/launcher.spec.ts @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { options } from '../playwright.fixtures'; +import { it, options } from '../playwright.fixtures'; import path from 'path'; import utils from '../utils'; diff --git a/test/chromium/oopif.spec.ts b/test/chromium/oopif.spec.ts index e79cee1f3a..7dbcb2abbc 100644 --- a/test/chromium/oopif.spec.ts +++ b/test/chromium/oopif.spec.ts @@ -15,7 +15,7 @@ */ import { options } from '../playwright.fixtures'; -import { registerWorkerFixture } from '@playwright/test-runner'; +import { it, describe, registerWorkerFixture } from '@playwright/test-runner'; registerWorkerFixture('browser', async ({browserType, defaultBrowserOptions}, test) => { const browser = await browserType.launch({ diff --git a/test/chromium/session.spec.ts b/test/chromium/session.spec.ts index 4a365af938..ea11a942f1 100644 --- a/test/chromium/session.spec.ts +++ b/test/chromium/session.spec.ts @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { options } from '../playwright.fixtures'; +import { it, describe, options } from '../playwright.fixtures'; import type { ChromiumBrowserContext, ChromiumBrowser } from '../../types/types'; describe('session', suite => { diff --git a/test/chromium/tracing.spec.ts b/test/chromium/tracing.spec.ts index 9faec67c24..ea004baeee 100644 --- a/test/chromium/tracing.spec.ts +++ b/test/chromium/tracing.spec.ts @@ -15,7 +15,7 @@ */ import { options } from '../playwright.fixtures'; -import { registerFixture } from '@playwright/test-runner'; +import { it, describe, registerFixture } from '@playwright/test-runner'; import fs from 'fs'; import path from 'path'; @@ -23,25 +23,25 @@ import type { ChromiumBrowser } from '../..'; declare global { interface TestState { - outputFile: string; + outputTraceFile: string; } } -registerFixture('outputFile', async ({tmpDir}, test) => { - const outputFile = path.join(tmpDir, `trace.json`); - await test(outputFile); - if (fs.existsSync(outputFile)) - fs.unlinkSync(outputFile); +registerFixture('outputTraceFile', async ({tmpDir}, test) => { + const outputTraceFile = path.join(tmpDir, `trace.json`); + await test(outputTraceFile); + if (fs.existsSync(outputTraceFile)) + fs.unlinkSync(outputTraceFile); }); describe('oopif', suite => { suite.skip(!options.CHROMIUM); }, () => { - it('should output a trace', async ({browser, page, server, outputFile}) => { - await (browser as ChromiumBrowser).startTracing(page, {screenshots: true, path: outputFile}); + it('should output a trace', async ({browser, page, server, outputTraceFile}) => { + await (browser as ChromiumBrowser).startTracing(page, {screenshots: true, path: outputTraceFile}); await page.goto(server.PREFIX + '/grid.html'); await (browser as ChromiumBrowser).stopTracing(); - expect(fs.existsSync(outputFile)).toBe(true); + expect(fs.existsSync(outputTraceFile)).toBe(true); }); it('should create directories as needed', async ({browser, page, server, tmpDir}) => { @@ -52,29 +52,29 @@ describe('oopif', suite => { expect(fs.existsSync(filePath)).toBe(true); }); - it('should run with custom categories if provided', async ({browser, page, outputFile}) => { - await (browser as ChromiumBrowser).startTracing(page, {path: outputFile, categories: ['disabled-by-default-v8.cpu_profiler.hires']}); + it('should run with custom categories if provided', async ({browser, page, outputTraceFile}) => { + await (browser as ChromiumBrowser).startTracing(page, {path: outputTraceFile, categories: ['disabled-by-default-v8.cpu_profiler.hires']}); await (browser as ChromiumBrowser).stopTracing(); - const traceJson = JSON.parse(fs.readFileSync(outputFile).toString()); + const traceJson = JSON.parse(fs.readFileSync(outputTraceFile).toString()); expect(traceJson.metadata['trace-config']).toContain('disabled-by-default-v8.cpu_profiler.hires'); }); - it('should throw if tracing on two pages', async ({browser, page, outputFile}) => { - await (browser as ChromiumBrowser).startTracing(page, {path: outputFile}); + it('should throw if tracing on two pages', async ({browser, page, outputTraceFile}) => { + await (browser as ChromiumBrowser).startTracing(page, {path: outputTraceFile}); const newPage = await browser.newPage(); let error = null; - await (browser as ChromiumBrowser).startTracing(newPage, {path: outputFile}).catch(e => error = e); + await (browser as ChromiumBrowser).startTracing(newPage, {path: outputTraceFile}).catch(e => error = e); await newPage.close(); expect(error).toBeTruthy(); await (browser as ChromiumBrowser).stopTracing(); }); - it('should return a buffer', async ({browser, page, server, outputFile}) => { - await (browser as ChromiumBrowser).startTracing(page, {screenshots: true, path: outputFile}); + it('should return a buffer', async ({browser, page, server, outputTraceFile}) => { + await (browser as ChromiumBrowser).startTracing(page, {screenshots: true, path: outputTraceFile}); await page.goto(server.PREFIX + '/grid.html'); const trace = await (browser as ChromiumBrowser).stopTracing(); - const buf = fs.readFileSync(outputFile); + const buf = fs.readFileSync(outputTraceFile); expect(trace.toString()).toEqual(buf.toString()); }); diff --git a/test/click-react.spec.ts b/test/click-react.spec.ts index 1dd697bcce..077c74a019 100644 --- a/test/click-react.spec.ts +++ b/test/click-react.spec.ts @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import './playwright.fixtures'; +import { it } from './playwright.fixtures'; declare const renderComponent; declare const e; diff --git a/test/click-timeout-1.spec.ts b/test/click-timeout-1.spec.ts index ace4ca8f33..a44ef96c59 100644 --- a/test/click-timeout-1.spec.ts +++ b/test/click-timeout-1.spec.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import { options } from './playwright.fixtures'; +import { it, options } from './playwright.fixtures'; it('should avoid side effects after timeout', test => { test.skip(options.WIRE); diff --git a/test/click-timeout-2.spec.ts b/test/click-timeout-2.spec.ts index e81b7039f6..ac8cf6d8ab 100644 --- a/test/click-timeout-2.spec.ts +++ b/test/click-timeout-2.spec.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import './playwright.fixtures'; +import { it } from './playwright.fixtures'; it('should timeout waiting for display:none to be gone', async ({page, server}) => { await page.goto(server.PREFIX + '/input/button.html'); diff --git a/test/click-timeout-3.spec.ts b/test/click-timeout-3.spec.ts index 1b1b1193c5..d8f1e0b46f 100644 --- a/test/click-timeout-3.spec.ts +++ b/test/click-timeout-3.spec.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import { options } from './playwright.fixtures'; +import { it, options } from './playwright.fixtures'; it('should fail when element jumps during hit testing', test => { test.skip(options.WIRE); diff --git a/test/click-timeout-4.spec.ts b/test/click-timeout-4.spec.ts index 05b0ee272a..b6447a08a8 100644 --- a/test/click-timeout-4.spec.ts +++ b/test/click-timeout-4.spec.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import './playwright.fixtures'; +import { it } from './playwright.fixtures'; it('should timeout waiting for stable position', async ({page, server}) => { await page.goto(server.PREFIX + '/input/button.html'); diff --git a/test/click.spec.ts b/test/click.spec.ts index 5d52b1a6ab..8f28fa62e2 100644 --- a/test/click.spec.ts +++ b/test/click.spec.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import { options } from './playwright.fixtures'; +import { it, options } from './playwright.fixtures'; import utils from './utils'; async function giveItAChanceToClick(page) { diff --git a/test/defaultbrowsercontext-1.spec.ts b/test/defaultbrowsercontext-1.spec.ts index b9bb7b7083..c93b0447ec 100644 --- a/test/defaultbrowsercontext-1.spec.ts +++ b/test/defaultbrowsercontext-1.spec.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import { options } from './playwright.fixtures'; +import { it, options } from './playwright.fixtures'; import fs from 'fs'; import utils from './utils'; diff --git a/test/defaultbrowsercontext-2.spec.ts b/test/defaultbrowsercontext-2.spec.ts index 93f36233be..b239bf66a6 100644 --- a/test/defaultbrowsercontext-2.spec.ts +++ b/test/defaultbrowsercontext-2.spec.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import { options } from './playwright.fixtures'; +import { it, options } from './playwright.fixtures'; import fs from 'fs'; import utils from './utils'; const { removeUserDataDir, makeUserDataDir } = utils; diff --git a/test/dialog.spec.ts b/test/dialog.spec.ts index a4903bce4a..eb1014a5fc 100644 --- a/test/dialog.spec.ts +++ b/test/dialog.spec.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import { options } from './playwright.fixtures'; +import { it, options } from './playwright.fixtures'; it('should fire', async ({page, server}) => { page.on('dialog', dialog => { diff --git a/test/dispatchevent.spec.ts b/test/dispatchevent.spec.ts index f6b986b861..a8228be847 100644 --- a/test/dispatchevent.spec.ts +++ b/test/dispatchevent.spec.ts @@ -13,7 +13,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { options } from './playwright.fixtures'; + +import { it, options } from './playwright.fixtures'; import utils from './utils'; diff --git a/test/download.spec.ts b/test/download.spec.ts index 811416d626..3f3af9b068 100644 --- a/test/download.spec.ts +++ b/test/download.spec.ts @@ -15,13 +15,13 @@ */ import { options } from './playwright.fixtures'; +import { it, beforeEach } from '@playwright/test-runner'; import './remoteServer.fixture'; import fs from 'fs'; import path from 'path'; import util from 'util'; - beforeEach(async ({server}) => { server.setRoute('/download', (req, res) => { res.setHeader('Content-Type', 'application/octet-stream'); diff --git a/test/downloads-path.spec.ts b/test/downloads-path.spec.ts index 5796f5fd7f..39f1d7b008 100644 --- a/test/downloads-path.spec.ts +++ b/test/downloads-path.spec.ts @@ -14,11 +14,9 @@ * limitations under the License. */ - +import { it, registerFixture } from '@playwright/test-runner'; import './playwright.fixtures'; -import { registerFixture } from '@playwright/test-runner'; - import path from 'path'; import fs from 'fs'; import os from 'os'; diff --git a/test/electron/electron-app.spec.ts b/test/electron/electron-app.spec.ts index 7ddacef1fa..82cd6db683 100644 --- a/test/electron/electron-app.spec.ts +++ b/test/electron/electron-app.spec.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import { options } from '../playwright.fixtures'; +import { it, describe, options } from '../playwright.fixtures'; import './electron.fixture'; import path from 'path'; diff --git a/test/electron/electron-window.spec.ts b/test/electron/electron-window.spec.ts index c249bb71e0..09fdcf9474 100644 --- a/test/electron/electron-window.spec.ts +++ b/test/electron/electron-window.spec.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import { options } from '../playwright.fixtures'; +import { it, describe, options } from '../playwright.fixtures'; import './electron.fixture'; describe('electron window', suite => { diff --git a/test/elementhandle-bounding-box.spec.ts b/test/elementhandle-bounding-box.spec.ts index 826d913288..97d48c9e9c 100644 --- a/test/elementhandle-bounding-box.spec.ts +++ b/test/elementhandle-bounding-box.spec.ts @@ -14,7 +14,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { options } from './playwright.fixtures'; + +import { it, options } from './playwright.fixtures'; it('should work', test => { diff --git a/test/elementhandle-click.spec.ts b/test/elementhandle-click.spec.ts index d5d1fad02b..698571fe93 100644 --- a/test/elementhandle-click.spec.ts +++ b/test/elementhandle-click.spec.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import './playwright.fixtures'; +import { it } from './playwright.fixtures'; it('should work', async ({ page, server }) => { await page.goto(server.PREFIX + '/input/button.html'); diff --git a/test/elementhandle-content-frame.spec.ts b/test/elementhandle-content-frame.spec.ts index 1461190de4..2bf6165d4b 100644 --- a/test/elementhandle-content-frame.spec.ts +++ b/test/elementhandle-content-frame.spec.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import './playwright.fixtures'; +import { it } from './playwright.fixtures'; import utils from './utils'; diff --git a/test/elementhandle-convenience.spec.ts b/test/elementhandle-convenience.spec.ts index 179731e03a..bdadea33fe 100644 --- a/test/elementhandle-convenience.spec.ts +++ b/test/elementhandle-convenience.spec.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import './playwright.fixtures'; +import { it } from './playwright.fixtures'; import utils from './utils'; it('should have a nice preview', async ({ page, server }) => { diff --git a/test/elementhandle-eval-on-selector.spec.ts b/test/elementhandle-eval-on-selector.spec.ts index 4034847b9c..08bfb31549 100644 --- a/test/elementhandle-eval-on-selector.spec.ts +++ b/test/elementhandle-eval-on-selector.spec.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import './playwright.fixtures'; +import { it } from './playwright.fixtures'; it('should work', async ({page, server}) => { await page.setContent('
100
10
'); diff --git a/test/elementhandle-misc.spec.ts b/test/elementhandle-misc.spec.ts index 6bb88e8db0..9c2e8186c7 100644 --- a/test/elementhandle-misc.spec.ts +++ b/test/elementhandle-misc.spec.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import './playwright.fixtures'; +import { it } from './playwright.fixtures'; it('should hover', async ({ page, server }) => { await page.goto(server.PREFIX + '/input/scrollable.html'); diff --git a/test/elementhandle-owner-frame.spec.ts b/test/elementhandle-owner-frame.spec.ts index 2e3f6ae89a..1e27251d4e 100644 --- a/test/elementhandle-owner-frame.spec.ts +++ b/test/elementhandle-owner-frame.spec.ts @@ -15,9 +15,8 @@ * limitations under the License. */ -import './playwright.fixtures'; import utils from './utils'; -import { options } from './playwright.fixtures'; +import { it, options } from './playwright.fixtures'; it('should work', async ({ page, server }) => { await page.goto(server.EMPTY_PAGE); diff --git a/test/elementhandle-press.spec.ts b/test/elementhandle-press.spec.ts index 5d6ad7409d..e6ffad3ab3 100644 --- a/test/elementhandle-press.spec.ts +++ b/test/elementhandle-press.spec.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import './playwright.fixtures'; +import { it } from './playwright.fixtures'; it('should work', async ({ page }) => { await page.setContent(``); diff --git a/test/elementhandle-query-selector.spec.ts b/test/elementhandle-query-selector.spec.ts index 19fe10d453..184b635360 100644 --- a/test/elementhandle-query-selector.spec.ts +++ b/test/elementhandle-query-selector.spec.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import './playwright.fixtures'; +import { it } from './playwright.fixtures'; it('should query existing element', async ({page, server}) => { await page.goto(server.PREFIX + '/playground.html'); diff --git a/test/elementhandle-screenshot.spec.ts b/test/elementhandle-screenshot.spec.ts index e7e2ca1771..6ad0a8e27f 100644 --- a/test/elementhandle-screenshot.spec.ts +++ b/test/elementhandle-screenshot.spec.ts @@ -14,7 +14,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { options } from './playwright.fixtures'; + +import { it, describe, options } from './playwright.fixtures'; import utils from './utils'; import {PNG} from 'pngjs'; diff --git a/test/elementhandle-scroll-into-view.spec.ts b/test/elementhandle-scroll-into-view.spec.ts index d949e4623e..b190d6b59f 100644 --- a/test/elementhandle-scroll-into-view.spec.ts +++ b/test/elementhandle-scroll-into-view.spec.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import './playwright.fixtures'; +import { it } from './playwright.fixtures'; it('should work', async ({ page, server }) => { await page.goto(server.PREFIX + '/offscreenbuttons.html'); diff --git a/test/elementhandle-select-text.spec.ts b/test/elementhandle-select-text.spec.ts index 2affe12983..39adfad304 100644 --- a/test/elementhandle-select-text.spec.ts +++ b/test/elementhandle-select-text.spec.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import { options } from './playwright.fixtures'; +import { it, options } from './playwright.fixtures'; it('should select textarea', async ({ page, server }) => { await page.goto(server.PREFIX + '/input/textarea.html'); diff --git a/test/elementhandle-type.spec.ts b/test/elementhandle-type.spec.ts index 96c3b67b90..3c91cf78e7 100644 --- a/test/elementhandle-type.spec.ts +++ b/test/elementhandle-type.spec.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import './playwright.fixtures'; +import { it } from './playwright.fixtures'; it('should work', async ({ page }) => { await page.setContent(``); diff --git a/test/elementhandle-wait-for-element-state.spec.ts b/test/elementhandle-wait-for-element-state.spec.ts index 4fab1e0868..b76e4d6b53 100644 --- a/test/elementhandle-wait-for-element-state.spec.ts +++ b/test/elementhandle-wait-for-element-state.spec.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import { options } from './playwright.fixtures'; +import { it, options } from './playwright.fixtures'; async function giveItAChanceToResolve(page) { for (let i = 0; i < 5; i++) diff --git a/test/emulation-focus.spec.ts b/test/emulation-focus.spec.ts index 607e76a2d1..2d515da3cc 100644 --- a/test/emulation-focus.spec.ts +++ b/test/emulation-focus.spec.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import { options } from './playwright.fixtures'; +import { it, options } from './playwright.fixtures'; import utils from './utils'; it('should think that it is focused by default', async ({page}) => { diff --git a/test/eval-on-selector-all.spec.ts b/test/eval-on-selector-all.spec.ts index f0519d42d8..3df47f2cd0 100644 --- a/test/eval-on-selector-all.spec.ts +++ b/test/eval-on-selector-all.spec.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import './playwright.fixtures'; +import { it } from './playwright.fixtures'; it('should work with css selector', async ({page, server}) => { await page.setContent('
hello
beautiful
world!
'); diff --git a/test/eval-on-selector.spec.ts b/test/eval-on-selector.spec.ts index 11aec2084a..aa15f5bf97 100644 --- a/test/eval-on-selector.spec.ts +++ b/test/eval-on-selector.spec.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import './playwright.fixtures'; +import { it } from './playwright.fixtures'; it('should work with css selector', async ({page, server}) => { await page.setContent('
43543
'); diff --git a/test/firefox/launcher.spec.ts b/test/firefox/launcher.spec.ts index 8d25b6ec57..3d11a2bff0 100644 --- a/test/firefox/launcher.spec.ts +++ b/test/firefox/launcher.spec.ts @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { options } from '../playwright.fixtures'; +import { it, options } from '../playwright.fixtures'; it('should pass firefox user preferences', test => { test.skip(!options.FIREFOX); diff --git a/test/fixtures.spec.ts b/test/fixtures.spec.ts index 6059640b05..f6e5c85538 100644 --- a/test/fixtures.spec.ts +++ b/test/fixtures.spec.ts @@ -14,7 +14,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { options } from './playwright.fixtures'; + +import { it, describe, options } from './playwright.fixtures'; import './remoteServer.fixture'; import { execSync } from 'child_process'; diff --git a/test/focus.spec.ts b/test/focus.spec.ts index edd85f8127..70751a7597 100644 --- a/test/focus.spec.ts +++ b/test/focus.spec.ts @@ -13,7 +13,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { options } from './playwright.fixtures'; + +import { it, options } from './playwright.fixtures'; it('should work', test => { test.skip(options.FIREFOX); diff --git a/test/frame-evaluate.spec.ts b/test/frame-evaluate.spec.ts index a35cce6a74..f40f359123 100644 --- a/test/frame-evaluate.spec.ts +++ b/test/frame-evaluate.spec.ts @@ -14,7 +14,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { options } from './playwright.fixtures'; + +import { it, options } from './playwright.fixtures'; import utils from './utils'; diff --git a/test/frame-frame-element.spec.ts b/test/frame-frame-element.spec.ts index ae48d66c9a..9459cb437d 100644 --- a/test/frame-frame-element.spec.ts +++ b/test/frame-frame-element.spec.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import './playwright.fixtures'; +import { it } from './playwright.fixtures'; import utils from './utils'; diff --git a/test/frame-goto.spec.ts b/test/frame-goto.spec.ts index be83951234..0e0ad9e45d 100644 --- a/test/frame-goto.spec.ts +++ b/test/frame-goto.spec.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import './playwright.fixtures'; +import { it } from './playwright.fixtures'; import utils from './utils'; diff --git a/test/frame-hierarchy.spec.ts b/test/frame-hierarchy.spec.ts index 67cb511a44..3142bd9622 100644 --- a/test/frame-hierarchy.spec.ts +++ b/test/frame-hierarchy.spec.ts @@ -14,7 +14,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { options } from './playwright.fixtures'; + +import { it, options } from './playwright.fixtures'; import utils from './utils'; it('should handle nested frames', async ({page, server}) => { diff --git a/test/geolocation.spec.ts b/test/geolocation.spec.ts index caebd57f8d..a7f949c658 100644 --- a/test/geolocation.spec.ts +++ b/test/geolocation.spec.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import './playwright.fixtures'; +import { it } from './playwright.fixtures'; it('should work', async ({page, server, context}) => { await context.grantPermissions(['geolocation']); diff --git a/test/headful.spec.ts b/test/headful.spec.ts index 171cce2dd1..bd4ba9fc27 100644 --- a/test/headful.spec.ts +++ b/test/headful.spec.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import { options } from './playwright.fixtures'; +import { it, options } from './playwright.fixtures'; import utils from './utils'; const { makeUserDataDir, removeUserDataDir } = utils; diff --git a/test/ignorehttpserrors.spec.ts b/test/ignorehttpserrors.spec.ts index 9fcd16c271..1e1711f013 100644 --- a/test/ignorehttpserrors.spec.ts +++ b/test/ignorehttpserrors.spec.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import './playwright.fixtures'; +import { it } from './playwright.fixtures'; it('should work', async ({browser, httpsServer}) => { let error = null; diff --git a/test/interception.spec.ts b/test/interception.spec.ts index 1e62bd1090..2cdf98c79d 100644 --- a/test/interception.spec.ts +++ b/test/interception.spec.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import './playwright.fixtures'; +import { it } from './playwright.fixtures'; import { globToRegex } from '../lib/client/clientHelper'; import vm from 'vm'; diff --git a/test/jshandle-as-element.spec.ts b/test/jshandle-as-element.spec.ts index 3e18bc301a..4bf6479e40 100644 --- a/test/jshandle-as-element.spec.ts +++ b/test/jshandle-as-element.spec.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import './playwright.fixtures'; +import { it } from './playwright.fixtures'; it('should work', async ({page}) => { const aHandle = await page.evaluateHandle(() => document.body); diff --git a/test/jshandle-evaluate.spec.ts b/test/jshandle-evaluate.spec.ts index ecf5ba83ea..3209ff6588 100644 --- a/test/jshandle-evaluate.spec.ts +++ b/test/jshandle-evaluate.spec.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import './playwright.fixtures'; +import { it } from './playwright.fixtures'; it('should work with function', async ({page}) => { const windowHandle = await page.evaluateHandle(() => { diff --git a/test/jshandle-json-value.spec.ts b/test/jshandle-json-value.spec.ts index cb76084faa..dd28996b5a 100644 --- a/test/jshandle-json-value.spec.ts +++ b/test/jshandle-json-value.spec.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import './playwright.fixtures'; +import { it } from './playwright.fixtures'; it('should work', async ({page}) => { const aHandle = await page.evaluateHandle(() => ({foo: 'bar'})); diff --git a/test/jshandle-properties.spec.ts b/test/jshandle-properties.spec.ts index fdc78a7760..5557ea5330 100644 --- a/test/jshandle-properties.spec.ts +++ b/test/jshandle-properties.spec.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import './playwright.fixtures'; +import { it } from './playwright.fixtures'; it('should work', async ({page}) => { const aHandle = await page.evaluateHandle(() => ({ diff --git a/test/jshandle-to-string.spec.ts b/test/jshandle-to-string.spec.ts index e946eb4e14..2ab5e0249c 100644 --- a/test/jshandle-to-string.spec.ts +++ b/test/jshandle-to-string.spec.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import { options } from './playwright.fixtures'; +import { it, options } from './playwright.fixtures'; it('should work for primitives', async ({page}) => { const numberHandle = await page.evaluateHandle(() => 2); diff --git a/test/keyboard.spec.ts b/test/keyboard.spec.ts index e27d902261..554f727492 100644 --- a/test/keyboard.spec.ts +++ b/test/keyboard.spec.ts @@ -14,7 +14,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { options } from './playwright.fixtures'; + +import { it, options } from './playwright.fixtures'; import utils from './utils'; it('should type into a textarea', async ({page}) => { diff --git a/test/launcher.spec.ts b/test/launcher.spec.ts index 01c1b4766b..56b778bd53 100644 --- a/test/launcher.spec.ts +++ b/test/launcher.spec.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import './playwright.fixtures'; +import { it } from './playwright.fixtures'; import path from 'path'; import utils from './utils'; diff --git a/test/logger.spec.ts b/test/logger.spec.ts index 2914936063..0142db8e4a 100644 --- a/test/logger.spec.ts +++ b/test/logger.spec.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import './playwright.fixtures'; +import { it } from './playwright.fixtures'; it('should log', async ({browserType, defaultBrowserOptions}) => { const log = []; diff --git a/test/mouse.spec.ts b/test/mouse.spec.ts index 1b91c70f4a..7b45193da7 100644 --- a/test/mouse.spec.ts +++ b/test/mouse.spec.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import { options } from './playwright.fixtures'; +import { it, xdescribe, options } from './playwright.fixtures'; function dimensions() { const rect = document.querySelector('textarea').getBoundingClientRect(); diff --git a/test/navigation.spec.ts b/test/navigation.spec.ts index 065525e680..f92cf82cf3 100644 --- a/test/navigation.spec.ts +++ b/test/navigation.spec.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import './playwright.fixtures'; +import { it } from './playwright.fixtures'; it('should work with _blank target', async ({page, server}) => { server.setRoute('/empty.html', (req, res) => { diff --git a/test/network-request.spec.ts b/test/network-request.spec.ts index e0952c972c..6f248d5cf4 100644 --- a/test/network-request.spec.ts +++ b/test/network-request.spec.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import { options } from './playwright.fixtures'; +import { it, options } from './playwright.fixtures'; import utils from './utils'; it('should work for main frame navigation request', async ({page, server}) => { diff --git a/test/network-response.spec.ts b/test/network-response.spec.ts index 2e7180f696..9a6625d8dc 100644 --- a/test/network-response.spec.ts +++ b/test/network-response.spec.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import './playwright.fixtures'; +import { it } from './playwright.fixtures'; import fs from 'fs'; import path from 'path'; diff --git a/test/page-add-init-script.spec.ts b/test/page-add-init-script.spec.ts index 90f8dc86c8..57463b3523 100644 --- a/test/page-add-init-script.spec.ts +++ b/test/page-add-init-script.spec.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import './playwright.fixtures'; +import { it } from './playwright.fixtures'; import path from 'path'; it('should evaluate before anything else on the page', async ({ page, server }) => { diff --git a/test/page-add-script-tag.spec.ts b/test/page-add-script-tag.spec.ts index ec4e773cda..0ed829daea 100644 --- a/test/page-add-script-tag.spec.ts +++ b/test/page-add-script-tag.spec.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import { options } from './playwright.fixtures'; +import { it, options } from './playwright.fixtures'; import path from 'path'; it('should throw an error if no options are provided', async ({page, server}) => { diff --git a/test/page-add-style-tag.spec.ts b/test/page-add-style-tag.spec.ts index 4afb6bb7c0..f79b3d96fb 100644 --- a/test/page-add-style-tag.spec.ts +++ b/test/page-add-style-tag.spec.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import './playwright.fixtures'; +import { it } from './playwright.fixtures'; import path from 'path'; it('should throw an error if no options are provided', async ({page, server}) => { diff --git a/test/page-basic.spec.ts b/test/page-basic.spec.ts index f8ea2bfb76..b3bbe038b9 100644 --- a/test/page-basic.spec.ts +++ b/test/page-basic.spec.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import { options } from './playwright.fixtures'; +import { it, options } from './playwright.fixtures'; it('should reject all promises when page is closed', async ({context}) => { const newPage = await context.newPage(); diff --git a/test/page-emulate-media.spec.ts b/test/page-emulate-media.spec.ts index e4e9ef5192..9c169463da 100644 --- a/test/page-emulate-media.spec.ts +++ b/test/page-emulate-media.spec.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import './playwright.fixtures'; +import { it } from './playwright.fixtures'; import utils from './utils'; it('should emulate type', async ({page, server}) => { diff --git a/test/page-evaluate-handle.spec.ts b/test/page-evaluate-handle.spec.ts index 7f7548392f..30a18f2695 100644 --- a/test/page-evaluate-handle.spec.ts +++ b/test/page-evaluate-handle.spec.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import './playwright.fixtures'; +import { it } from './playwright.fixtures'; it('should work', async ({page, server}) => { const windowHandle = await page.evaluateHandle(() => window); diff --git a/test/page-evaluate.spec.ts b/test/page-evaluate.spec.ts index f8a619154f..12fbe72755 100644 --- a/test/page-evaluate.spec.ts +++ b/test/page-evaluate.spec.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import { options } from './playwright.fixtures'; +import { it, options } from './playwright.fixtures'; it('should work', async ({ page, server }) => { const result = await page.evaluate(() => 7 * 3); diff --git a/test/page-event-console.spec.ts b/test/page-event-console.spec.ts index 9b6e3fb101..392c3915f6 100644 --- a/test/page-event-console.spec.ts +++ b/test/page-event-console.spec.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import './playwright.fixtures'; +import { it } from './playwright.fixtures'; import util from 'util'; it('should work', async ({page, server}) => { diff --git a/test/page-event-crash.spec.ts b/test/page-event-crash.spec.ts index cc0eeaa0aa..9a67cc0a55 100644 --- a/test/page-event-crash.spec.ts +++ b/test/page-event-crash.spec.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import { options } from './playwright.fixtures'; +import { it, describe, options } from './playwright.fixtures'; function crash(pageImpl, browserName) { if (browserName === 'chromium') diff --git a/test/page-event-network.spec.ts b/test/page-event-network.spec.ts index 5152b86ec1..36adb2ce25 100644 --- a/test/page-event-network.spec.ts +++ b/test/page-event-network.spec.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import { options } from './playwright.fixtures'; +import { it, options } from './playwright.fixtures'; it('Page.Events.Request', async ({page, server}) => { const requests = []; diff --git a/test/page-event-pageerror.spec.ts b/test/page-event-pageerror.spec.ts index 4e7ff6dde5..59c6ca5988 100644 --- a/test/page-event-pageerror.spec.ts +++ b/test/page-event-pageerror.spec.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import { options } from './playwright.fixtures'; +import { it, options } from './playwright.fixtures'; it('should fire', async ({page, server}) => { const [error] = await Promise.all([ diff --git a/test/page-event-popup.spec.ts b/test/page-event-popup.spec.ts index d84bdedf49..d4119cf0ef 100644 --- a/test/page-event-popup.spec.ts +++ b/test/page-event-popup.spec.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import './playwright.fixtures'; +import { it } from './playwright.fixtures'; it('should work', async ({browser}) => { const context = await browser.newContext(); diff --git a/test/page-event-request.spec.ts b/test/page-event-request.spec.ts index 8e3089a083..e7cfa68846 100644 --- a/test/page-event-request.spec.ts +++ b/test/page-event-request.spec.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import './playwright.fixtures'; +import { it } from './playwright.fixtures'; import utils from './utils'; it('should fire for navigation requests', async ({page, server}) => { diff --git a/test/page-expose-function.spec.ts b/test/page-expose-function.spec.ts index 126471d9c8..5659b7ef4f 100644 --- a/test/page-expose-function.spec.ts +++ b/test/page-expose-function.spec.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import './playwright.fixtures'; +import { it } from './playwright.fixtures'; it('exposeBinding should work', async ({browser}) => { const context = await browser.newContext(); diff --git a/test/page-fill.spec.ts b/test/page-fill.spec.ts index 24bd4af678..f3ad5e585a 100644 --- a/test/page-fill.spec.ts +++ b/test/page-fill.spec.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import { options } from './playwright.fixtures'; +import { it, options } from './playwright.fixtures'; async function giveItAChanceToFill(page) { for (let i = 0; i < 5; i++) diff --git a/test/page-goto.spec.ts b/test/page-goto.spec.ts index 055579487a..31ddc0c973 100644 --- a/test/page-goto.spec.ts +++ b/test/page-goto.spec.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import { options } from './playwright.fixtures'; +import { it, options } from './playwright.fixtures'; import utils from './utils'; import path from 'path'; diff --git a/test/page-history.spec.ts b/test/page-history.spec.ts index be08dc6041..500e2a5b12 100644 --- a/test/page-history.spec.ts +++ b/test/page-history.spec.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import { options } from './playwright.fixtures'; +import { it, options } from './playwright.fixtures'; import url from 'url'; it('page.goBack should work', async ({page, server}) => { diff --git a/test/page-network-idle.spec.ts b/test/page-network-idle.spec.ts index 93ffc396f0..d868a69fa2 100644 --- a/test/page-network-idle.spec.ts +++ b/test/page-network-idle.spec.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import './playwright.fixtures'; +import { it } from './playwright.fixtures'; import type { Frame, Page } from '..'; import { TestServer } from '../utils/testserver'; diff --git a/test/page-route.spec.ts b/test/page-route.spec.ts index 43ff4596a5..79146a72a1 100644 --- a/test/page-route.spec.ts +++ b/test/page-route.spec.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import { options } from './playwright.fixtures'; +import { it, options } from './playwright.fixtures'; it('should intercept', async ({page, server}) => { let intercepted = false; diff --git a/test/page-screenshot.spec.ts b/test/page-screenshot.spec.ts index 64d51952ec..745155642d 100644 --- a/test/page-screenshot.spec.ts +++ b/test/page-screenshot.spec.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import { options } from './playwright.fixtures'; +import { it, describe, options } from './playwright.fixtures'; import utils from './utils'; import path from 'path'; import fs from 'fs'; diff --git a/test/page-select-option.spec.ts b/test/page-select-option.spec.ts index 9ddaa9151a..aaa27a97fc 100644 --- a/test/page-select-option.spec.ts +++ b/test/page-select-option.spec.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import './playwright.fixtures'; +import { it } from './playwright.fixtures'; it('should select single option', async ({page, server}) => { await page.goto(server.PREFIX + '/input/select.html'); diff --git a/test/page-set-content.spec.ts b/test/page-set-content.spec.ts index 6662127843..947c855abe 100644 --- a/test/page-set-content.spec.ts +++ b/test/page-set-content.spec.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import './playwright.fixtures'; +import { it } from './playwright.fixtures'; const expectedOutput = '
hello
'; diff --git a/test/page-set-extra-http-headers.spec.ts b/test/page-set-extra-http-headers.spec.ts index 9999f400f9..b3fe3e262d 100644 --- a/test/page-set-extra-http-headers.spec.ts +++ b/test/page-set-extra-http-headers.spec.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import './playwright.fixtures'; +import { it } from './playwright.fixtures'; it('should work', async ({page, server}) => { await page.setExtraHTTPHeaders({ diff --git a/test/page-set-input-files.spec.ts b/test/page-set-input-files.spec.ts index f93eb1c80d..5ca8e54e84 100644 --- a/test/page-set-input-files.spec.ts +++ b/test/page-set-input-files.spec.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import './playwright.fixtures'; +import { it } from './playwright.fixtures'; import path from 'path'; import fs from 'fs'; diff --git a/test/page-wait-for-load-state.spec.ts b/test/page-wait-for-load-state.spec.ts index 1eb1f88929..1946632e2d 100644 --- a/test/page-wait-for-load-state.spec.ts +++ b/test/page-wait-for-load-state.spec.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import { options } from './playwright.fixtures'; +import { it, options } from './playwright.fixtures'; import type { Route } from '..'; it('should pick up ongoing navigation', async ({page, server}) => { diff --git a/test/page-wait-for-navigation.spec.ts b/test/page-wait-for-navigation.spec.ts index 783aea0526..a6787a8eb2 100644 --- a/test/page-wait-for-navigation.spec.ts +++ b/test/page-wait-for-navigation.spec.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import './playwright.fixtures'; +import { it } from './playwright.fixtures'; import utils from './utils'; import type { Frame } from '..'; diff --git a/test/page-wait-for-request.spec.ts b/test/page-wait-for-request.spec.ts index fb81982b81..1803a0ce5b 100644 --- a/test/page-wait-for-request.spec.ts +++ b/test/page-wait-for-request.spec.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import './playwright.fixtures'; +import { it } from './playwright.fixtures'; import vm from 'vm'; diff --git a/test/page-wait-for-response.spec.ts b/test/page-wait-for-response.spec.ts index ae3b5db379..a5c91a41a1 100644 --- a/test/page-wait-for-response.spec.ts +++ b/test/page-wait-for-response.spec.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import './playwright.fixtures'; +import { it } from './playwright.fixtures'; it('should work', async ({page, server}) => { await page.goto(server.EMPTY_PAGE); diff --git a/test/pdf.spec.ts b/test/pdf.spec.ts index 6a19708d99..d28d404668 100644 --- a/test/pdf.spec.ts +++ b/test/pdf.spec.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import { options } from './playwright.fixtures'; +import { it, options } from './playwright.fixtures'; import fs from 'fs'; import path from 'path'; diff --git a/test/permissions.spec.ts b/test/permissions.spec.ts index 1089bd496e..1c71e3bb9b 100644 --- a/test/permissions.spec.ts +++ b/test/permissions.spec.ts @@ -14,7 +14,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { options } from './playwright.fixtures'; + +import { it, describe, options } from './playwright.fixtures'; function getPermission(page, name) { return page.evaluate(name => navigator.permissions.query({name}).then(result => result.state), name); diff --git a/test/playwright.fixtures.ts b/test/playwright.fixtures.ts index b05262e299..eb3c2485bb 100644 --- a/test/playwright.fixtures.ts +++ b/test/playwright.fixtures.ts @@ -25,6 +25,7 @@ import { Transport } from '../lib/protocol/transport'; import { installCoverageHooks } from './coverage'; import { parameters, registerFixture, registerWorkerFixture } from '@playwright/test-runner'; import { mkdtempAsync, removeFolderAsync } from './utils'; +export { it, fit, xit, describe, fdescribe, xdescribe } from '@playwright/test-runner'; export const options = { CHROMIUM: parameters.browserName === 'chromium', @@ -43,6 +44,7 @@ declare global { defaultBrowserOptions: LaunchOptions; golden: (path: string) => string; playwright: typeof import('../index'); + browserName: string; browserType: BrowserType; browser: Browser; httpService: {server: TestServer, httpsServer: TestServer} @@ -56,9 +58,6 @@ declare global { browserServer: BrowserServer; launchPersistent: (options?: Parameters['launchPersistentContext']>[1]) => Promise<{context: BrowserContext, page: Page}>; } - interface FixtureParameters { - browserName: string; - } } declare global { diff --git a/test/popup.spec.ts b/test/popup.spec.ts index 4e95458bc8..636f005a12 100644 --- a/test/popup.spec.ts +++ b/test/popup.spec.ts @@ -13,7 +13,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { options } from './playwright.fixtures'; + +import { it, options } from './playwright.fixtures'; it('should inherit user agent from browser context', async function({browser, server}) { const context = await browser.newContext({ diff --git a/test/proxy.spec.ts b/test/proxy.spec.ts index c2b5dea757..adcde04dc6 100644 --- a/test/proxy.spec.ts +++ b/test/proxy.spec.ts @@ -15,7 +15,7 @@ */ import { parameters } from '@playwright/test-runner'; -import { options } from './playwright.fixtures'; +import { it, options } from './playwright.fixtures'; import socks from 'socksv5'; diff --git a/test/queryselector.spec.ts b/test/queryselector.spec.ts index 4f0f7fe104..e57c72e502 100644 --- a/test/queryselector.spec.ts +++ b/test/queryselector.spec.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import './playwright.fixtures'; +import { it } from './playwright.fixtures'; it('should throw for non-string selector', async ({page}) => { const error = await page.$(null).catch(e => e); diff --git a/test/request-continue.spec.ts b/test/request-continue.spec.ts index cb9268253c..0f94605ceb 100644 --- a/test/request-continue.spec.ts +++ b/test/request-continue.spec.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import './playwright.fixtures'; +import { it } from './playwright.fixtures'; it('should work', async ({page, server}) => { await page.route('**/*', route => route.continue()); diff --git a/test/request-fulfill.spec.ts b/test/request-fulfill.spec.ts index 9398fcf7df..35e1aac807 100644 --- a/test/request-fulfill.spec.ts +++ b/test/request-fulfill.spec.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import { options } from './playwright.fixtures'; +import { it, options } from './playwright.fixtures'; import fs from 'fs'; import path from 'path'; diff --git a/test/screencast.spec.ts b/test/screencast.spec.ts index 2457cdd03e..b685da3bf3 100644 --- a/test/screencast.spec.ts +++ b/test/screencast.spec.ts @@ -15,7 +15,7 @@ */ import { options } from './playwright.fixtures'; -import { registerFixture } from '@playwright/test-runner'; +import { it, describe, registerFixture } from '@playwright/test-runner'; import type { Page } from '..'; import fs from 'fs'; diff --git a/test/selectors-css.spec.ts b/test/selectors-css.spec.ts index a92b02450b..ec3e363373 100644 --- a/test/selectors-css.spec.ts +++ b/test/selectors-css.spec.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import './playwright.fixtures'; +import { it } from './playwright.fixtures'; it('should work for open shadow roots', async ({page, server}) => { await page.goto(server.PREFIX + '/deep-shadow.html'); diff --git a/test/selectors-misc.spec.ts b/test/selectors-misc.spec.ts index 3175ffbe35..01729d1d08 100644 --- a/test/selectors-misc.spec.ts +++ b/test/selectors-misc.spec.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import './playwright.fixtures'; +import { it } from './playwright.fixtures'; it('should work for open shadow roots', async ({page, server}) => { await page.goto(server.PREFIX + '/deep-shadow.html'); diff --git a/test/selectors-register.spec.ts b/test/selectors-register.spec.ts index 7ab767f7fb..a8f7b2fc6b 100644 --- a/test/selectors-register.spec.ts +++ b/test/selectors-register.spec.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import './playwright.fixtures'; +import { it } from './playwright.fixtures'; import path from 'path'; import utils from './utils'; diff --git a/test/selectors-text.spec.ts b/test/selectors-text.spec.ts index d5308921ae..73bd07fe3a 100644 --- a/test/selectors-text.spec.ts +++ b/test/selectors-text.spec.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import { options } from './playwright.fixtures'; +import { it, options } from './playwright.fixtures'; it('query', async ({page}) => { await page.setContent(`
yo
ya
\nye
`); diff --git a/test/slowmo.spec.ts b/test/slowmo.spec.ts index 3c0a037e92..6ea4be82f6 100644 --- a/test/slowmo.spec.ts +++ b/test/slowmo.spec.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import { options } from './playwright.fixtures'; +import { it, describe, options } from './playwright.fixtures'; import { attachFrame } from './utils'; async function checkSlowMo(toImpl, page, task) { diff --git a/test/snapshot.spec.ts b/test/snapshot.spec.ts index 678828f9e8..32be5a3793 100644 --- a/test/snapshot.spec.ts +++ b/test/snapshot.spec.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import { options } from './playwright.fixtures'; +import { it, options } from './playwright.fixtures'; it('should not throw', test => { test.skip(!options.TRACING); diff --git a/test/test-runner-helper.ts b/test/test-runner-helper.ts deleted file mode 100644 index 0a73f87528..0000000000 --- a/test/test-runner-helper.ts +++ /dev/null @@ -1,28 +0,0 @@ -/** - -* 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. - */ - -import { registerFixture } from '@playwright/test-runner'; - -declare global { - interface TestState { - helperFixture: string; - } -} - -registerFixture('helperFixture', async ({}, test) => { - await test('helperFixture'); -}); diff --git a/test/test-runner-overrides-1.spec.ts b/test/test-runner-overrides-1.spec.ts deleted file mode 100644 index c8253014c4..0000000000 --- a/test/test-runner-overrides-1.spec.ts +++ /dev/null @@ -1,26 +0,0 @@ -/** - * 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. - */ - -import './test-runner-helper'; -import { registerFixture } from '@playwright/test-runner'; - -registerFixture('helperFixture', async ({}, test) => { - await test('helperFixture - overridden'); -}); - -it('should override fixture from requires', async ({helperFixture}) => { - expect(helperFixture).toBe('helperFixture - overridden'); -}); diff --git a/test/test-runner-overrides-2.spec.ts b/test/test-runner-overrides-2.spec.ts deleted file mode 100644 index b29536f808..0000000000 --- a/test/test-runner-overrides-2.spec.ts +++ /dev/null @@ -1,21 +0,0 @@ -/** - * 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. - */ - -import './test-runner-helper'; - -it('override should have no side effects', async ({helperFixture}) => { - expect(helperFixture).toBe('helperFixture'); -}); diff --git a/test/test-runner.spec.ts b/test/test-runner.spec.ts deleted file mode 100644 index 08624e3ac9..0000000000 --- a/test/test-runner.spec.ts +++ /dev/null @@ -1,49 +0,0 @@ -/** - * 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. - */ - -import './test-runner-helper'; -import { registerFixture } from '@playwright/test-runner'; - -declare global { - interface TestState { - a: string; - b: string; - ab: string; - zero: number; - tear: string; - } -} - -let zero = 0; -registerFixture('zero', async ({}, test) => { - await test(zero++); -}); - -registerFixture('a', async ({zero}, test) => { - await test('a' + zero); -}); - -registerFixture('b', async ({zero}, test) => { - await test('b' + zero); -}); - -registerFixture('ab', async ({a, b}, test) => { - await test(a + b); -}); - -it('should eval fixture once', async ({ab}) => { - expect(ab).toBe('a0b0'); -}); diff --git a/test/wait-for-function.spec.ts b/test/wait-for-function.spec.ts index c6b82c76f7..383f286bbb 100644 --- a/test/wait-for-function.spec.ts +++ b/test/wait-for-function.spec.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import './playwright.fixtures'; +import { it } from './playwright.fixtures'; it('should timeout', async ({page}) => { const startTime = Date.now(); diff --git a/test/wait-for-selector-1.spec.ts b/test/wait-for-selector-1.spec.ts index 1140db499a..ecd0621b20 100644 --- a/test/wait-for-selector-1.spec.ts +++ b/test/wait-for-selector-1.spec.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import './playwright.fixtures'; +import { it } from './playwright.fixtures'; import utils from './utils'; async function giveItTimeToLog(frame) { diff --git a/test/wait-for-selector-2.spec.ts b/test/wait-for-selector-2.spec.ts index 4d86f4ab03..7698bbe429 100644 --- a/test/wait-for-selector-2.spec.ts +++ b/test/wait-for-selector-2.spec.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import './playwright.fixtures'; +import { it } from './playwright.fixtures'; import utils from './utils'; const addElement = tag => document.body.appendChild(document.createElement(tag)); diff --git a/test/workers.spec.ts b/test/workers.spec.ts index 023327dcfb..dc72bef465 100644 --- a/test/workers.spec.ts +++ b/test/workers.spec.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import './playwright.fixtures'; +import { it } from './playwright.fixtures'; import type { ConsoleMessage } from '..'; it('Page.workers', async function({page, server}) {