diff --git a/examples/github-api/package.json b/examples/github-api/package.json index 5f513f8cbe900..d280d3e53275c 100644 --- a/examples/github-api/package.json +++ b/examples/github-api/package.json @@ -2,12 +2,12 @@ "name": "github-api", "version": "0.0.1", "scripts": { - "test": "playwright test" + "test": "pw-recorder test" }, "keywords": [], "author": "", "license": "ISC", "devDependencies": { - "@playwright/test": "^1.17.1" + "@okep/test": "^1.17.1" } } diff --git a/examples/github-api/playwright.config.ts b/examples/github-api/playwright.config.ts index 55845b778f651..4dda1b2f10b16 100644 --- a/examples/github-api/playwright.config.ts +++ b/examples/github-api/playwright.config.ts @@ -1,6 +1,6 @@ /* eslint-disable notice/notice */ -import { defineConfig } from '@playwright/test'; +import { defineConfig } from '@okep/test'; /** * See https://playwright.dev/docs/test-configuration. diff --git a/examples/github-api/tests/test-api.spec.ts b/examples/github-api/tests/test-api.spec.ts index 947c38c18888f..b6aff5a8fa1ad 100644 --- a/examples/github-api/tests/test-api.spec.ts +++ b/examples/github-api/tests/test-api.spec.ts @@ -9,7 +9,7 @@ * 3. Delete the repo. */ -import { test, expect } from '@playwright/test'; +import { test, expect } from '@okep/test'; const user = process.env.GITHUB_USER; const repo = 'Test-Repo-1'; diff --git a/examples/mock-battery/package.json b/examples/mock-battery/package.json index dc78f0ca89b1f..e1fa434e3eb56 100644 --- a/examples/mock-battery/package.json +++ b/examples/mock-battery/package.json @@ -4,14 +4,14 @@ "description": "", "main": "index.js", "scripts": { - "test": "playwright test", + "test": "pw-recorder test", "start": "http-server -c-1 -p 9900 demo-battery-api" }, "keywords": [], "author": "", "license": "ISC", "devDependencies": { - "@playwright/test": "^1.19.1", + "@okep/test": "^1.19.1", "http-server": "^14.1.0" } } diff --git a/examples/mock-filesystem/package.json b/examples/mock-filesystem/package.json index 333f434d5897e..f1489d2b95167 100644 --- a/examples/mock-filesystem/package.json +++ b/examples/mock-filesystem/package.json @@ -4,14 +4,14 @@ "description": "", "main": "index.js", "scripts": { - "test": "playwright test", + "test": "pw-recorder test", "start": "http-server -c-1 -p 9900 src/" }, "keywords": [], "author": "", "license": "ISC", "devDependencies": { - "@playwright/test": "^1.19.1", + "@okep/test": "^1.19.1", "http-server": "^14.1.0" } } diff --git a/examples/svgomg/package.json b/examples/svgomg/package.json index 93302628c0d2f..d86b4d2562ca4 100644 --- a/examples/svgomg/package.json +++ b/examples/svgomg/package.json @@ -2,15 +2,15 @@ "name": "svgomg-tests", "version": "0.0.1", "scripts": { - "test": "playwright test", - "ctest": "playwright test --project=chromium", - "ftest": "playwright test --project=firefox", - "wtest": "playwright test --project=webkit" + "test": "pw-recorder test", + "ctest": "pw-recorder test --project=chromium", + "ftest": "pw-recorder test --project=firefox", + "wtest": "pw-recorder test --project=webkit" }, "keywords": [], "author": "", "license": "ISC", "devDependencies": { - "@playwright/test": "^1.17.1" + "@okep/test": "^1.17.1" } } diff --git a/examples/svgomg/playwright.config.ts b/examples/svgomg/playwright.config.ts index cb40327e3ddb4..21aed81d0b4de 100644 --- a/examples/svgomg/playwright.config.ts +++ b/examples/svgomg/playwright.config.ts @@ -1,6 +1,6 @@ /* eslint-disable notice/notice */ -import { defineConfig, devices } from '@playwright/test'; +import { defineConfig, devices } from '@okep/test'; /** * See https://playwright.dev/docs/test-configuration. diff --git a/examples/svgomg/tests/example.spec.ts b/examples/svgomg/tests/example.spec.ts index 331ec8c07b7c0..41199882459e5 100644 --- a/examples/svgomg/tests/example.spec.ts +++ b/examples/svgomg/tests/example.spec.ts @@ -1,6 +1,6 @@ /* eslint-disable notice/notice */ -import { test, expect } from '@playwright/test'; +import { test, expect } from '@okep/test'; import fs from 'fs'; test.describe.configure({ mode: 'parallel' }); diff --git a/examples/todomvc/package.json b/examples/todomvc/package.json index 1aa4392cb5095..8a6c4a3fcb0da 100644 --- a/examples/todomvc/package.json +++ b/examples/todomvc/package.json @@ -2,15 +2,15 @@ "name": "todomvc-test", "version": "0.0.1", "scripts": { - "test": "playwright test", - "ctest": "playwright test --project=chromium", - "ftest": "playwright test --project=firefox", - "wtest": "playwright test --project=webkit" + "test": "pw-recorder test", + "ctest": "pw-recorder test --project=chromium", + "ftest": "pw-recorder test --project=firefox", + "wtest": "pw-recorder test --project=webkit" }, "keywords": [], "author": "", "license": "ISC", "devDependencies": { - "@playwright/test": "^1.38.0" + "@okep/test": "^1.38.0" } } diff --git a/examples/todomvc/playwright.config.ts b/examples/todomvc/playwright.config.ts index 3d76370d4d30c..53e75de217fa1 100644 --- a/examples/todomvc/playwright.config.ts +++ b/examples/todomvc/playwright.config.ts @@ -1,6 +1,6 @@ /* eslint-disable notice/notice */ -import { defineConfig, devices } from '@playwright/test'; +import { defineConfig, devices } from '@okep/test'; /** * See https://playwright.dev/docs/test-configuration. diff --git a/examples/todomvc/tests/integration.spec.ts b/examples/todomvc/tests/integration.spec.ts index 007896bb2cd5e..2a9beae698d82 100644 --- a/examples/todomvc/tests/integration.spec.ts +++ b/examples/todomvc/tests/integration.spec.ts @@ -1,7 +1,7 @@ /* eslint-disable notice/notice */ -import { test, expect } from '@playwright/test'; -import type { Page } from '@playwright/test'; +import { test, expect } from '@okep/test'; +import type { Page } from '@okep/test'; test.describe.configure({ mode: 'parallel' }); diff --git a/package-lock.json b/package-lock.json index 879f5ef67118a..80310793d46d5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "pw-recorder-internal", - "version": "1.49.0-next", + "version": "1.49.3-alpha", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "pw-recorder-internal", - "version": "1.49.0-next", + "version": "1.49.3-alpha", "license": "Apache-2.0", "workspaces": [ "packages/*" @@ -48,7 +48,7 @@ "electron": "^30.1.2", "esbuild": "^0.18.11", "eslint": "^8.55.0", - "eslint-plugin-internal-playwright": "file:utils/eslint-plugin-internal-playwright", + "eslint-plugin-internal-pw-recorder": "file:utils/eslint-plugin-internal-pw-recorder", "eslint-plugin-notice": "^0.9.10", "eslint-plugin-react": "^7.35.0", "eslint-plugin-react-hooks": "^4.6.2", @@ -1472,51 +1472,47 @@ "node": ">= 8" } }, - "node_modules/@playwright/experimental-ct-core": { - "resolved": "packages/playwright-ct-core", - "link": true - }, - "node_modules/@pw-recorder/browser-chromium": { + "node_modules/@okep/browser-chromium": { "resolved": "packages/pw-recorder-browser-chromium", "link": true }, - "node_modules/@pw-recorder/browser-firefox": { + "node_modules/@okep/browser-firefox": { "resolved": "packages/pw-recorder-browser-firefox", "link": true }, - "node_modules/@pw-recorder/browser-webkit": { + "node_modules/@okep/browser-webkit": { "resolved": "packages/pw-recorder-browser-webkit", "link": true }, - "node_modules/@pw-recorder/experimental-ct-core": { + "node_modules/@okep/experimental-ct-core": { "resolved": "packages/pw-recorder-ct-core", "link": true }, - "node_modules/@pw-recorder/experimental-ct-react": { + "node_modules/@okep/experimental-ct-react": { "resolved": "packages/pw-recorder-ct-react", "link": true }, - "node_modules/@pw-recorder/experimental-ct-react17": { + "node_modules/@okep/experimental-ct-react17": { "resolved": "packages/pw-recorder-ct-react17", "link": true }, - "node_modules/@pw-recorder/experimental-ct-solid": { + "node_modules/@okep/experimental-ct-solid": { "resolved": "packages/pw-recorder-ct-solid", "link": true }, - "node_modules/@pw-recorder/experimental-ct-svelte": { + "node_modules/@okep/experimental-ct-svelte": { "resolved": "packages/pw-recorder-ct-svelte", "link": true }, - "node_modules/@pw-recorder/experimental-ct-vue": { + "node_modules/@okep/experimental-ct-vue": { "resolved": "packages/pw-recorder-ct-vue", "link": true }, - "node_modules/@pw-recorder/experimental-ct-vue2": { + "node_modules/@okep/experimental-ct-vue2": { "resolved": "packages/pw-recorder-ct-vue2", "link": true }, - "node_modules/@pw-recorder/test": { + "node_modules/@okep/test": { "resolved": "packages/pw-recorder-test", "link": true }, @@ -3684,8 +3680,8 @@ "url": "https://opencollective.com/eslint" } }, - "node_modules/eslint-plugin-internal-playwright": { - "resolved": "utils/eslint-plugin-internal-playwright", + "node_modules/eslint-plugin-internal-pw-recorder": { + "resolved": "utils/eslint-plugin-internal-pw-recorder", "link": true }, "node_modules/eslint-plugin-notice": { @@ -5899,14 +5895,6 @@ "node": ">=6" } }, - "node_modules/playwright": { - "resolved": "packages/playwright", - "link": true - }, - "node_modules/playwright-core": { - "resolved": "packages/playwright-core", - "link": true - }, "node_modules/possible-typed-array-names": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/possible-typed-array-names/-/possible-typed-array-names-1.0.0.tgz", @@ -7940,10 +7928,11 @@ }, "packages/playwright": { "name": "pw-recorder", - "version": "1.49.0-next", + "version": "1.49.2-next", + "extraneous": true, "license": "Apache-2.0", "dependencies": { - "playwright-core": "1.49.0-next" + "playwright-core": "1.49.2-next" }, "bin": { "playwright": "cli.js" @@ -7956,39 +7945,39 @@ } }, "packages/playwright-browser-chromium": { - "name": "@pw-recorder/browser-chromium", - "version": "1.49.0-next", + "name": "@okep/browser-chromium", + "version": "1.49.2-next", "extraneous": true, "hasInstallScript": true, "license": "Apache-2.0", "dependencies": { - "playwright-core": "1.49.0-next" + "playwright-core": "1.49.2-next" }, "engines": { "node": ">=18" } }, "packages/playwright-browser-firefox": { - "name": "@pw-recorder/browser-firefox", - "version": "1.49.0-next", + "name": "@okep/browser-firefox", + "version": "1.49.2-next", "extraneous": true, "hasInstallScript": true, "license": "Apache-2.0", "dependencies": { - "playwright-core": "1.49.0-next" + "playwright-core": "1.49.2-next" }, "engines": { "node": ">=18" } }, "packages/playwright-browser-webkit": { - "name": "@pw-recorder/browser-webkit", - "version": "1.49.0-next", + "name": "@okep/browser-webkit", + "version": "1.49.2-next", "extraneous": true, "hasInstallScript": true, "license": "Apache-2.0", "dependencies": { - "playwright-core": "1.49.0-next" + "playwright-core": "1.49.2-next" }, "engines": { "node": ">=18" @@ -7996,12 +7985,12 @@ }, "packages/playwright-chromium": { "name": "pw-recorder-chromium", - "version": "1.49.0-next", + "version": "1.49.2-next", "extraneous": true, "hasInstallScript": true, "license": "Apache-2.0", "dependencies": { - "playwright-core": "1.49.0-next" + "playwright-core": "1.49.2-next" }, "bin": { "playwright": "cli.js" @@ -8012,7 +8001,8 @@ }, "packages/playwright-core": { "name": "pw-recorder-core", - "version": "1.49.0-next", + "version": "1.49.2-next", + "extraneous": true, "license": "Apache-2.0", "bin": { "playwright-core": "cli.js" @@ -8022,12 +8012,13 @@ } }, "packages/playwright-ct-core": { - "name": "@pw-recorder/experimental-ct-core", - "version": "1.49.0-next", + "name": "@okep/experimental-ct-core", + "version": "1.49.2-next", + "extraneous": true, "license": "Apache-2.0", "dependencies": { - "playwright": "1.49.0-next", - "playwright-core": "1.49.0-next", + "playwright": "1.49.2-next", + "playwright-core": "1.49.2-next", "vite": "^5.2.8" }, "engines": { @@ -8035,12 +8026,12 @@ } }, "packages/playwright-ct-react": { - "name": "@pw-recorder/experimental-ct-react", - "version": "1.49.0-next", + "name": "@okep/experimental-ct-react", + "version": "1.49.2-next", "extraneous": true, "license": "Apache-2.0", "dependencies": { - "@playwright/experimental-ct-core": "1.49.0-next", + "@playwright/experimental-ct-core": "1.49.2-next", "@vitejs/plugin-react": "^4.2.1" }, "bin": { @@ -8051,12 +8042,12 @@ } }, "packages/playwright-ct-react17": { - "name": "@pw-recorder/experimental-ct-react17", - "version": "1.49.0-next", + "name": "@okep/experimental-ct-react17", + "version": "1.49.2-next", "extraneous": true, "license": "Apache-2.0", "dependencies": { - "@playwright/experimental-ct-core": "1.49.0-next", + "@playwright/experimental-ct-core": "1.49.2-next", "@vitejs/plugin-react": "^4.2.1" }, "bin": { @@ -8067,12 +8058,12 @@ } }, "packages/playwright-ct-solid": { - "name": "@pw-recorder/experimental-ct-solid", - "version": "1.49.0-next", + "name": "@okep/experimental-ct-solid", + "version": "1.49.2-next", "extraneous": true, "license": "Apache-2.0", "dependencies": { - "@playwright/experimental-ct-core": "1.49.0-next", + "@playwright/experimental-ct-core": "1.49.2-next", "vite-plugin-solid": "^2.7.0" }, "bin": { @@ -8086,12 +8077,12 @@ } }, "packages/playwright-ct-svelte": { - "name": "@pw-recorder/experimental-ct-svelte", - "version": "1.49.0-next", + "name": "@okep/experimental-ct-svelte", + "version": "1.49.2-next", "extraneous": true, "license": "Apache-2.0", "dependencies": { - "@playwright/experimental-ct-core": "1.49.0-next", + "@playwright/experimental-ct-core": "1.49.2-next", "@sveltejs/vite-plugin-svelte": "^3.0.1" }, "bin": { @@ -8105,12 +8096,12 @@ } }, "packages/playwright-ct-vue": { - "name": "@pw-recorder/experimental-ct-vue", - "version": "1.49.0-next", + "name": "@okep/experimental-ct-vue", + "version": "1.49.2-next", "extraneous": true, "license": "Apache-2.0", "dependencies": { - "@playwright/experimental-ct-core": "1.49.0-next", + "@playwright/experimental-ct-core": "1.49.2-next", "@vitejs/plugin-vue": "^4.2.1" }, "bin": { @@ -8121,12 +8112,12 @@ } }, "packages/playwright-ct-vue2": { - "name": "@pw-recorder/experimental-ct-vue2", - "version": "1.49.0-next", + "name": "@okep/experimental-ct-vue2", + "version": "1.49.2-next", "extraneous": true, "license": "Apache-2.0", "dependencies": { - "@playwright/experimental-ct-core": "1.49.0-next", + "@playwright/experimental-ct-core": "1.49.2-next", "@vitejs/plugin-vue2": "^2.2.0" }, "bin": { @@ -8141,12 +8132,12 @@ }, "packages/playwright-firefox": { "name": "pw-recorder-firefox", - "version": "1.49.0-next", + "version": "1.49.2-next", "extraneous": true, "hasInstallScript": true, "license": "Apache-2.0", "dependencies": { - "playwright-core": "1.49.0-next" + "playwright-core": "1.49.2-next" }, "bin": { "playwright": "cli.js" @@ -8156,12 +8147,12 @@ } }, "packages/playwright-test": { - "name": "@pw-recorder/test", - "version": "1.49.0-next", + "name": "@okep/test", + "version": "1.49.2-next", "extraneous": true, "license": "Apache-2.0", "dependencies": { - "playwright": "1.49.0-next" + "playwright": "1.49.2-next" }, "bin": { "playwright": "cli.js" @@ -8172,12 +8163,12 @@ }, "packages/playwright-webkit": { "name": "pw-recorder-webkit", - "version": "1.49.0-next", + "version": "1.49.2-next", "extraneous": true, "hasInstallScript": true, "license": "Apache-2.0", "dependencies": { - "playwright-core": "1.49.0-next" + "playwright-core": "1.49.2-next" }, "bin": { "playwright": "cli.js" @@ -8186,27 +8177,14 @@ "node": ">=18" } }, - "packages/playwright/node_modules/fsevents": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", - "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", - "hasInstallScript": true, - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": "^8.16.0 || ^10.6.0 || >=11.0.0" - } - }, "packages/pw-recorder": { - "version": "1.49.0-next", + "version": "1.49.3-alpha", "license": "Apache-2.0", "dependencies": { - "playwright-core": "1.49.0-next" + "pw-recorder-core": "1.49.3-alpha" }, "bin": { - "playwright": "cli.js" + "pw-recorder": "cli.js" }, "engines": { "node": ">=18" @@ -8216,72 +8194,72 @@ } }, "packages/pw-recorder-browser-chromium": { - "name": "@pw-recorder/browser-chromium", - "version": "1.49.0-next", + "name": "@okep/browser-chromium", + "version": "1.49.3-alpha", "hasInstallScript": true, "license": "Apache-2.0", "dependencies": { - "playwright-core": "1.49.0-next" + "pw-recorder-core": "1.49.3-alpha" }, "engines": { "node": ">=18" } }, "packages/pw-recorder-browser-firefox": { - "name": "@pw-recorder/browser-firefox", - "version": "1.49.0-next", + "name": "@okep/browser-firefox", + "version": "1.49.3-alpha", "hasInstallScript": true, "license": "Apache-2.0", "dependencies": { - "playwright-core": "1.49.0-next" + "pw-recorder-core": "1.49.3-alpha" }, "engines": { "node": ">=18" } }, "packages/pw-recorder-browser-webkit": { - "name": "@pw-recorder/browser-webkit", - "version": "1.49.0-next", + "name": "@okep/browser-webkit", + "version": "1.49.3-alpha", "hasInstallScript": true, "license": "Apache-2.0", "dependencies": { - "playwright-core": "1.49.0-next" + "pw-recorder-core": "1.49.3-alpha" }, "engines": { "node": ">=18" } }, "packages/pw-recorder-chromium": { - "version": "1.49.0-next", + "version": "1.49.3-alpha", "hasInstallScript": true, "license": "Apache-2.0", "dependencies": { - "playwright-core": "1.49.0-next" + "pw-recorder-core": "1.49.3-alpha" }, "bin": { - "playwright": "cli.js" + "pw-recorder": "cli.js" }, "engines": { "node": ">=18" } }, "packages/pw-recorder-core": { - "version": "1.49.0-next", + "version": "1.49.3-alpha", "license": "Apache-2.0", "bin": { - "playwright-core": "cli.js" + "pw-recorder-core": "cli.js" }, "engines": { "node": ">=18" } }, "packages/pw-recorder-ct-core": { - "name": "@pw-recorder/experimental-ct-core", - "version": "1.49.0-next", + "name": "@okep/experimental-ct-core", + "version": "1.49.3-alpha", "license": "Apache-2.0", "dependencies": { - "playwright": "1.49.0-next", - "playwright-core": "1.49.0-next", + "pw-recorder": "1.49.3-alpha", + "pw-recorder-core": "1.49.3-alpha", "vite": "^5.2.8" }, "engines": { @@ -8289,45 +8267,45 @@ } }, "packages/pw-recorder-ct-react": { - "name": "@pw-recorder/experimental-ct-react", - "version": "1.49.0-next", + "name": "@okep/experimental-ct-react", + "version": "1.49.3-alpha", "license": "Apache-2.0", "dependencies": { - "@playwright/experimental-ct-core": "1.49.0-next", + "@okep/experimental-ct-core": "1.49.3-alpha", "@vitejs/plugin-react": "^4.2.1" }, "bin": { - "playwright": "cli.js" + "pw-recorder": "cli.js" }, "engines": { "node": ">=18" } }, "packages/pw-recorder-ct-react17": { - "name": "@pw-recorder/experimental-ct-react17", - "version": "1.49.0-next", + "name": "@okep/experimental-ct-react17", + "version": "1.49.3-alpha", "license": "Apache-2.0", "dependencies": { - "@playwright/experimental-ct-core": "1.49.0-next", + "@okep/experimental-ct-core": "1.49.3-alpha", "@vitejs/plugin-react": "^4.2.1" }, "bin": { - "playwright": "cli.js" + "pw-recorder": "cli.js" }, "engines": { "node": ">=18" } }, "packages/pw-recorder-ct-solid": { - "name": "@pw-recorder/experimental-ct-solid", - "version": "1.49.0-next", + "name": "@okep/experimental-ct-solid", + "version": "1.49.3-alpha", "license": "Apache-2.0", "dependencies": { - "@playwright/experimental-ct-core": "1.49.0-next", + "@okep/experimental-ct-core": "1.49.3-alpha", "vite-plugin-solid": "^2.7.0" }, "bin": { - "playwright": "cli.js" + "pw-recorder": "cli.js" }, "devDependencies": { "solid-js": "^1.7.0" @@ -8337,15 +8315,15 @@ } }, "packages/pw-recorder-ct-svelte": { - "name": "@pw-recorder/experimental-ct-svelte", - "version": "1.49.0-next", + "name": "@okep/experimental-ct-svelte", + "version": "1.49.3-alpha", "license": "Apache-2.0", "dependencies": { - "@playwright/experimental-ct-core": "1.49.0-next", + "@okep/experimental-ct-core": "1.49.3-alpha", "@sveltejs/vite-plugin-svelte": "^3.0.1" }, "bin": { - "playwright": "cli.js" + "pw-recorder": "cli.js" }, "devDependencies": { "svelte": "^4.2.19" @@ -8355,30 +8333,30 @@ } }, "packages/pw-recorder-ct-vue": { - "name": "@pw-recorder/experimental-ct-vue", - "version": "1.49.0-next", + "name": "@okep/experimental-ct-vue", + "version": "1.49.3-alpha", "license": "Apache-2.0", "dependencies": { - "@playwright/experimental-ct-core": "1.49.0-next", + "@okep/experimental-ct-core": "1.49.3-alpha", "@vitejs/plugin-vue": "^4.2.1" }, "bin": { - "playwright": "cli.js" + "pw-recorder": "cli.js" }, "engines": { "node": ">=18" } }, "packages/pw-recorder-ct-vue2": { - "name": "@pw-recorder/experimental-ct-vue2", - "version": "1.49.0-next", + "name": "@okep/experimental-ct-vue2", + "version": "1.49.3-alpha", "license": "Apache-2.0", "dependencies": { - "@playwright/experimental-ct-core": "1.49.0-next", + "@okep/experimental-ct-core": "1.49.3-alpha", "@vitejs/plugin-vue2": "^2.2.0" }, "bin": { - "playwright": "cli.js" + "pw-recorder": "cli.js" }, "devDependencies": { "vue": "^2.7.14" @@ -8425,14 +8403,14 @@ } }, "packages/pw-recorder-firefox": { - "version": "1.49.0-next", + "version": "1.49.3-alpha", "hasInstallScript": true, "license": "Apache-2.0", "dependencies": { - "playwright-core": "1.49.0-next" + "pw-recorder-core": "1.49.3-alpha" }, "bin": { - "playwright": "cli.js" + "pw-recorder": "cli.js" }, "engines": { "node": ">=18" @@ -8448,14 +8426,14 @@ "version": "0.0.0" }, "packages/pw-recorder-test": { - "name": "@pw-recorder/test", - "version": "1.49.0-next", + "name": "@okep/test", + "version": "1.49.3-alpha", "license": "Apache-2.0", "dependencies": { - "playwright": "1.49.0-next" + "pw-recorder": "1.49.3-alpha" }, "bin": { - "playwright": "cli.js" + "pw-recorder": "cli.js" }, "engines": { "node": ">=18" @@ -8473,14 +8451,14 @@ } }, "packages/pw-recorder-webkit": { - "version": "1.49.0-next", + "version": "1.49.3-alpha", "hasInstallScript": true, "license": "Apache-2.0", "dependencies": { - "playwright-core": "1.49.0-next" + "pw-recorder-core": "1.49.3-alpha" }, "bin": { - "playwright": "cli.js" + "pw-recorder": "cli.js" }, "engines": { "node": ">=18" @@ -8521,7 +8499,11 @@ } }, "utils/eslint-plugin-internal-playwright": { + "name": "eslint-plugin-internal-pw-recorder", "version": "0.0.1", + "extraneous": true + }, + "utils/eslint-plugin-internal-pw-recorder": { "dev": true } } diff --git a/package.json b/package.json index 38267667ffe68..4992a5333016b 100644 --- a/package.json +++ b/package.json @@ -1,13 +1,13 @@ { "name": "pw-recorder-internal", "private": false, - "version": "1.49.0-next", + "version": "1.49.3-alpha", "description": "A high-level API to automate web browsers", "repository": { "type": "git", - "url": "git+https://github.com/microsoft/playwright.git" + "url": "git+https://github.com/microsoft/pw-recorder.git" }, - "homepage": "https://playwright.dev", + "homepage": "https://pw-recorder.dev", "engines": { "node": ">=18" }, @@ -16,20 +16,20 @@ }, "license": "Apache-2.0", "scripts": { - "ctest": "playwright test --config=tests/library/playwright.config.ts --project=chromium-*", - "ftest": "playwright test --config=tests/library/playwright.config.ts --project=firefox-*", - "wtest": "playwright test --config=tests/library/playwright.config.ts --project=webkit-*", - "atest": "playwright test --config=tests/android/playwright.config.ts", - "etest": "playwright test --config=tests/electron/playwright.config.ts", - "webview2test": "playwright test --config=tests/webview2/playwright.config.ts", - "itest": "playwright test --config=tests/installation/playwright.config.ts", - "stest": "playwright test --config=tests/stress/playwright.config.ts", - "biditest": "playwright test --config=tests/bidi/playwright.config.ts", - "test-html-reporter": "playwright test --config=packages/html-reporter", - "test-web": "playwright test --config=packages/web", - "ttest": "node ./tests/playwright-test/stable-test-runner/node_modules/@playwright/test/cli test --config=tests/playwright-test/playwright.config.ts", - "ct": "playwright test tests/components/test-all.spec.js --reporter=list", - "test": "playwright test --config=tests/library/playwright.config.ts", + "ctest": "pw-recorder test --config=tests/library/pw-recorder.config.ts --project=chromium-*", + "ftest": "pw-recorder test --config=tests/library/pw-recorder.config.ts --project=firefox-*", + "wtest": "pw-recorder test --config=tests/library/pw-recorder.config.ts --project=webkit-*", + "atest": "pw-recorder test --config=tests/android/pw-recorder.config.ts", + "etest": "pw-recorder test --config=tests/electron/pw-recorder.config.ts", + "webview2test": "pw-recorder test --config=tests/webview2/pw-recorder.config.ts", + "itest": "pw-recorder test --config=tests/installation/pw-recorder.config.ts", + "stest": "pw-recorder test --config=tests/stress/pw-recorder.config.ts", + "biditest": "pw-recorder test --config=tests/bidi/pw-recorder.config.ts", + "test-html-reporter": "pw-recorder test --config=packages/html-reporter", + "test-web": "pw-recorder test --config=packages/web", + "ttest": "node ./tests/pw-recorder-test/stable-test-runner/node_modules/@okep/test/cli test --config=tests/pw-recorder-test/pw-recorder.config.ts", + "ct": "pw-recorder test tests/components/test-all.spec.js --reporter=list", + "test": "pw-recorder test --config=tests/library/pw-recorder.config.ts", "eslint": "eslint --cache --report-unused-disable-directives --ext ts,tsx,js,jsx,mjs .", "tsc": "tsc -p . && tsc -p packages/html-reporter/", "build-installer": "babel -s --extensions \".ts\" --out-dir packages/pw-recorder-core/lib/utils/ packages/pw-recorder-core/src/utils", @@ -45,7 +45,7 @@ "roll": "node utils/roll_browser.js", "check-deps": "node utils/check_deps.js", "build-android-driver": "./utils/build_android_driver.sh", - "innerloop": "playwright run-server --reuse-browser" + "innerloop": "pw-recorder run-server --reuse-browser" }, "workspaces": [ "packages/*" @@ -87,7 +87,7 @@ "electron": "^30.1.2", "esbuild": "^0.18.11", "eslint": "^8.55.0", - "eslint-plugin-internal-playwright": "file:utils/eslint-plugin-internal-playwright", + "eslint-plugin-internal-pw-recorder": "file:utils/eslint-plugin-internal-pw-recorder", "eslint-plugin-notice": "^0.9.10", "eslint-plugin-react": "^7.35.0", "eslint-plugin-react-hooks": "^4.6.2", diff --git a/packages/pw-recorder-browser-chromium/package.json b/packages/pw-recorder-browser-chromium/package.json index 48321c6ddddc8..4c01a3a2524dd 100644 --- a/packages/pw-recorder-browser-chromium/package.json +++ b/packages/pw-recorder-browser-chromium/package.json @@ -1,12 +1,12 @@ { - "name": "@pw-recorder/browser-chromium", - "version": "1.49.0-next", + "name": "@okep/browser-chromium", + "version": "1.49.3-alpha", "description": "Playwright package that automatically installs Chromium", "repository": { "type": "git", - "url": "git+https://github.com/microsoft/playwright.git" + "url": "git+https://github.com/microsoft/pw-recorder.git" }, - "homepage": "https://playwright.dev", + "homepage": "https://pw-recorder.dev", "engines": { "node": ">=18" }, @@ -27,6 +27,6 @@ "install": "node install.js" }, "dependencies": { - "playwright-core": "1.49.0-next" + "pw-recorder-core": "1.49.3-alpha" } } diff --git a/packages/pw-recorder-browser-firefox/package.json b/packages/pw-recorder-browser-firefox/package.json index 21c7253fdc8c2..ad3e4ed78a460 100644 --- a/packages/pw-recorder-browser-firefox/package.json +++ b/packages/pw-recorder-browser-firefox/package.json @@ -1,12 +1,12 @@ { - "name": "@pw-recorder/browser-firefox", - "version": "1.49.0-next", + "name": "@okep/browser-firefox", + "version": "1.49.3-alpha", "description": "Playwright package that automatically installs Firefox", "repository": { "type": "git", - "url": "git+https://github.com/microsoft/playwright.git" + "url": "git+https://github.com/microsoft/pw-recorder.git" }, - "homepage": "https://playwright.dev", + "homepage": "https://pw-recorder.dev", "engines": { "node": ">=18" }, @@ -27,6 +27,6 @@ "install": "node install.js" }, "dependencies": { - "playwright-core": "1.49.0-next" + "pw-recorder-core": "1.49.3-alpha" } } diff --git a/packages/pw-recorder-browser-webkit/package.json b/packages/pw-recorder-browser-webkit/package.json index dd3a734ef8f39..df378db45aac9 100644 --- a/packages/pw-recorder-browser-webkit/package.json +++ b/packages/pw-recorder-browser-webkit/package.json @@ -1,12 +1,12 @@ { - "name": "@pw-recorder/browser-webkit", - "version": "1.49.0-next", + "name": "@okep/browser-webkit", + "version": "1.49.3-alpha", "description": "Playwright package that automatically installs WebKit", "repository": { "type": "git", - "url": "git+https://github.com/microsoft/playwright.git" + "url": "git+https://github.com/microsoft/pw-recorder.git" }, - "homepage": "https://playwright.dev", + "homepage": "https://pw-recorder.dev", "engines": { "node": ">=18" }, @@ -27,6 +27,6 @@ "install": "node install.js" }, "dependencies": { - "playwright-core": "1.49.0-next" + "pw-recorder-core": "1.49.3-alpha" } } diff --git a/packages/pw-recorder-chromium/package.json b/packages/pw-recorder-chromium/package.json index 9cf48cbd14160..36527b4a47bcc 100644 --- a/packages/pw-recorder-chromium/package.json +++ b/packages/pw-recorder-chromium/package.json @@ -1,12 +1,12 @@ { "name": "pw-recorder-chromium", - "version": "1.49.0-next", + "version": "1.49.3-alpha", "description": "A high-level API to automate Chromium", "repository": { "type": "git", - "url": "git+https://github.com/microsoft/playwright.git" + "url": "git+https://github.com/microsoft/pw-recorder.git" }, - "homepage": "https://playwright.dev", + "homepage": "https://pw-recorder.dev", "engines": { "node": ">=18" }, @@ -24,12 +24,12 @@ "./package.json": "./package.json" }, "bin": { - "playwright": "cli.js" + "pw-recorder": "cli.js" }, "scripts": { "install": "node install.js" }, "dependencies": { - "playwright-core": "1.49.0-next" + "pw-recorder-core": "1.49.3-alpha" } } diff --git a/packages/pw-recorder-core/package.json b/packages/pw-recorder-core/package.json index c59b101779961..524479a502517 100644 --- a/packages/pw-recorder-core/package.json +++ b/packages/pw-recorder-core/package.json @@ -1,12 +1,12 @@ { "name": "pw-recorder-core", - "version": "1.49.0-next", + "version": "1.49.3-alpha", "description": "A high-level API to automate web browsers", "repository": { "type": "git", - "url": "git+https://github.com/microsoft/playwright.git" + "url": "git+https://github.com/microsoft/pw-recorder.git" }, - "homepage": "https://playwright.dev", + "homepage": "https://pw-recorder.dev", "engines": { "node": ">=18" }, @@ -38,7 +38,7 @@ "./types/structs": "./types/structs.d.ts" }, "bin": { - "playwright-core": "cli.js" + "pw-recorder-core": "cli.js" }, "types": "types/types.d.ts" } diff --git a/packages/pw-recorder-core/src/cli/program.ts b/packages/pw-recorder-core/src/cli/program.ts index db3a830ab8b0d..7579352e85a0d 100644 --- a/packages/pw-recorder-core/src/cli/program.ts +++ b/packages/pw-recorder-core/src/cli/program.ts @@ -131,10 +131,10 @@ program ` npx playwright install`, ``, `If your project does not yet depend on Playwright, first install the`, - `applicable npm package (most commonly @playwright/test), and`, + `applicable npm package (most commonly @okep/test), and`, `then run Playwright's install command to download the browsers:`, ``, - ` npm install @playwright/test`, + ` npm install @okep/test`, ` npx playwright install`, ``, ].join('\n'), 1)); diff --git a/packages/pw-recorder-core/src/cli/programWithTestStub.ts b/packages/pw-recorder-core/src/cli/programWithTestStub.ts index 1c11c14ec2773..f50ff38842f91 100644 --- a/packages/pw-recorder-core/src/cli/programWithTestStub.ts +++ b/packages/pw-recorder-core/src/cli/programWithTestStub.ts @@ -33,17 +33,17 @@ function printPlaywrightTestError(command: string) { packages.push('playwright'); const packageManager = getPackageManager(); if (packageManager === 'yarn') { - console.error(`Please install @playwright/test package before running "yarn playwright ${command}"`); + console.error(`Please install @okep/test package before running "yarn playwright ${command}"`); console.error(` yarn remove ${packages.join(' ')}`); - console.error(' yarn add -D @playwright/test'); + console.error(' yarn add -D @okep/test'); } else if (packageManager === 'pnpm') { - console.error(`Please install @playwright/test package before running "pnpm exec playwright ${command}"`); + console.error(`Please install @okep/test package before running "pnpm exec playwright ${command}"`); console.error(` pnpm remove ${packages.join(' ')}`); - console.error(' pnpm add -D @playwright/test'); + console.error(' pnpm add -D @okep/test'); } else { - console.error(`Please install @playwright/test package before running "npx playwright ${command}"`); + console.error(`Please install @okep/test package before running "npx playwright ${command}"`); console.error(` npm uninstall ${packages.join(' ')}`); - console.error(' npm install -D @playwright/test'); + console.error(' npm install -D @okep/test'); } } @@ -55,7 +55,7 @@ const kExternalPlaywrightTestCommands = [ function addExternalPlaywrightTestCommands() { for (const [command, description] of kExternalPlaywrightTestCommands) { const playwrightTest = program.command(command).allowUnknownOption(true); - playwrightTest.description(`${description} Available in @playwright/test package.`); + playwrightTest.description(`${description} Available in @okep/test package.`); playwrightTest.action(async () => { printPlaywrightTestError(command); gracefullyProcessExitDoNotHang(1); diff --git a/packages/pw-recorder-core/src/client/browser.ts b/packages/pw-recorder-core/src/client/browser.ts index be47ddeb51dd1..e4e83e76c9476 100644 --- a/packages/pw-recorder-core/src/client/browser.ts +++ b/packages/pw-recorder-core/src/client/browser.ts @@ -38,7 +38,7 @@ export class Browser extends ChannelOwner implements ap readonly _name: string; private _path: string | undefined; - // Used from @playwright/test fixtures. + // Used from @okep/test fixtures. _connectHeaders?: HeadersArray; _closeReason: string | undefined; diff --git a/packages/pw-recorder-core/src/server/codegen/javascript.ts b/packages/pw-recorder-core/src/server/codegen/javascript.ts index 17f627b601e22..d57f302be3988 100644 --- a/packages/pw-recorder-core/src/server/codegen/javascript.ts +++ b/packages/pw-recorder-core/src/server/codegen/javascript.ts @@ -140,7 +140,7 @@ export class JavaScriptLanguageGenerator implements LanguageGenerator { const formatter = new JavaScriptFormatter(); const useText = formatContextOptions(options.contextOptions, options.deviceName); formatter.add(` - import { test, expect${options.deviceName ? ', devices' : ''} } from '@playwright/test'; + import { test, expect${options.deviceName ? ', devices' : ''} } from '@okep/test'; ${useText ? '\ntest.use(' + useText + ');\n' : ''} test('test', async ({ page }) => {`); return formatter.format(); diff --git a/packages/pw-recorder-core/src/server/recorder/recorderApp.ts b/packages/pw-recorder-core/src/server/recorder/recorderApp.ts index 30149f9816ca2..5ce382461421b 100644 --- a/packages/pw-recorder-core/src/server/recorder/recorderApp.ts +++ b/packages/pw-recorder-core/src/server/recorder/recorderApp.ts @@ -62,10 +62,11 @@ export class RecorderApp extends EventEmitter implements IRecorderApp { await syncLocalStorageWithSettings(this._page, 'recorder'); await this._page._setServerRequestInterceptor(route => { - if (!route.request().url().startsWith('https://playwright/')) + if (!route.request().url().startsWith('https://pw-recorder/')) return false; - const uri = route.request().url().substring('https://playwright/'.length); + const uri = route.request().url().substring('https://pw-recorder/'.length); + console.log(uri) const file = require.resolve('../../vite/recorder/' + uri); fs.promises.readFile(file).then(buffer => { route.fulfill({ @@ -88,7 +89,7 @@ export class RecorderApp extends EventEmitter implements IRecorderApp { }); const mainFrame = this._page.mainFrame(); - await mainFrame.goto(serverSideCallMetadata(), 'https://playwright/index.html'); + await mainFrame.goto(serverSideCallMetadata(), 'https://pw-recorder/index.html'); } static factory(context: BrowserContext): IRecorderAppFactory { diff --git a/packages/pw-recorder-ct-core/package.json b/packages/pw-recorder-ct-core/package.json index fffe21da067e4..dd856b22400a9 100644 --- a/packages/pw-recorder-ct-core/package.json +++ b/packages/pw-recorder-ct-core/package.json @@ -1,12 +1,12 @@ { - "name": "@pw-recorder/experimental-ct-core", - "version": "1.49.0-next", + "name": "@okep/experimental-ct-core", + "version": "1.49.3-alpha", "description": "Playwright Component Testing Helpers", "repository": { "type": "git", - "url": "git+https://github.com/microsoft/playwright.git" + "url": "git+https://github.com/microsoft/pw-recorder.git" }, - "homepage": "https://playwright.dev", + "homepage": "https://pw-recorder.dev", "engines": { "node": ">=18" }, @@ -26,8 +26,8 @@ } }, "dependencies": { - "playwright-core": "1.49.0-next", + "pw-recorder-core": "1.49.3-alpha", "vite": "^5.2.8", - "playwright": "1.49.0-next" + "pw-recorder": "1.49.3-alpha" } } diff --git a/packages/pw-recorder-ct-core/src/devServer.ts b/packages/pw-recorder-ct-core/src/devServer.ts index 2152a672b3fd5..52d421c98f31a 100644 --- a/packages/pw-recorder-ct-core/src/devServer.ts +++ b/packages/pw-recorder-ct-core/src/devServer.ts @@ -16,7 +16,7 @@ import fs from 'fs'; import path from 'path'; -import { Watcher } from 'playwright/lib/fsWatcher'; +import { Watcher } from 'pw-recorder/lib/fsWatcher'; import type { PluginContext } from 'rollup'; import { source as injectedSource } from './generated/indexSource'; import { createConfig, populateComponentsFromTests, resolveDirs, transformIndexFile, frameworkConfig } from './viteUtils'; diff --git a/packages/pw-recorder-ct-core/src/program.ts b/packages/pw-recorder-ct-core/src/program.ts index 3014578d6964a..e43ffd1555fb5 100644 --- a/packages/pw-recorder-ct-core/src/program.ts +++ b/packages/pw-recorder-ct-core/src/program.ts @@ -14,4 +14,4 @@ * limitations under the License. */ -export { program } from 'playwright/lib/program'; +export { program } from 'pw-recorder/lib/program'; diff --git a/packages/pw-recorder-ct-core/src/tsxTransform.ts b/packages/pw-recorder-ct-core/src/tsxTransform.ts index 003eccc77cc54..7570729ffb1b1 100644 --- a/packages/pw-recorder-ct-core/src/tsxTransform.ts +++ b/packages/pw-recorder-ct-core/src/tsxTransform.ts @@ -16,8 +16,8 @@ import path from 'path'; import type { T, BabelAPI, PluginObj } from 'playwright/src/transform/babelBundle'; -import { types, declare, traverse } from 'playwright/lib/transform/babelBundle'; -import { setTransformData } from 'playwright/lib/transform/transform'; +import { types, declare, traverse } from 'pw-recorder/lib/transform/babelBundle'; +import { setTransformData } from 'pw-recorder/lib/transform/transform'; const t: typeof T = types; let jsxComponentNames: Set; diff --git a/packages/pw-recorder-ct-core/src/vitePlugin.ts b/packages/pw-recorder-ct-core/src/vitePlugin.ts index de0309d4f6687..1b5ac773e3ffb 100644 --- a/packages/pw-recorder-ct-core/src/vitePlugin.ts +++ b/packages/pw-recorder-ct-core/src/vitePlugin.ts @@ -20,8 +20,8 @@ import type { AddressInfo } from 'net'; import path from 'path'; import { assert, calculateSha1, getPlaywrightVersion, isURLAvailable } from 'pw-recorder-core/lib/utils'; import { debug } from 'pw-recorder-core/lib/utilsBundle'; -import { setExternalDependencies } from 'playwright/lib/transform/compilationCache'; -import { stoppable } from 'playwright/lib/utilsBundle'; +import { setExternalDependencies } from 'pw-recorder/lib/transform/compilationCache'; +import { stoppable } from 'pw-recorder/lib/utilsBundle'; import type { FullConfig, Suite } from 'playwright/types/testReporter'; import type { PluginContext } from 'rollup'; import type { Plugin, ResolveFn, ResolvedConfig } from 'vite'; @@ -30,9 +30,9 @@ import { source as injectedSource } from './generated/indexSource'; import type { ImportInfo } from './tsxTransform'; import type { ComponentRegistry } from './viteUtils'; import { createConfig, frameworkConfig, hasJSComponents, populateComponentsFromTests, resolveDirs, resolveEndpoint, transformIndexFile } from './viteUtils'; -import { resolveHook } from 'playwright/lib/transform/transform'; +import { resolveHook } from 'pw-recorder/lib/transform/transform'; import { runDevServer } from './devServer'; -import { removeDirAndLogToConsole } from 'playwright/lib/util'; +import { removeDirAndLogToConsole } from 'pw-recorder/lib/util'; const log = debug('pw:vite'); diff --git a/packages/pw-recorder-ct-core/src/viteUtils.ts b/packages/pw-recorder-ct-core/src/viteUtils.ts index 7c1181295e74d..1c52d8bc98a30 100644 --- a/packages/pw-recorder-ct-core/src/viteUtils.ts +++ b/packages/pw-recorder-ct-core/src/viteUtils.ts @@ -17,12 +17,12 @@ import fs from 'fs'; import path from 'path'; import { debug } from 'pw-recorder-core/lib/utilsBundle'; -import { getUserData } from 'playwright/lib/transform/compilationCache'; +import { getUserData } from 'pw-recorder/lib/transform/compilationCache'; import type { PlaywrightTestConfig as BasePlaywrightTestConfig } from 'playwright/types/test'; import type { FullConfig } from 'playwright/types/testReporter'; import type { InlineConfig, Plugin, TransformResult, UserConfig } from 'vite'; import type { ImportInfo } from './tsxTransform'; -import { resolveHook } from 'playwright/lib/transform/transform'; +import { resolveHook } from 'pw-recorder/lib/transform/transform'; const log = debug('pw:vite'); @@ -195,5 +195,5 @@ export function transformIndexFile(id: string, content: string, templateDir: str } export function frameworkConfig(config: FullConfig): { registerSourceFile: string, frameworkPluginFactory?: () => Promise } { - return (config as any)['@playwright/experimental-ct-core']; + return (config as any)['@okep/experimental-ct-core']; } diff --git a/packages/pw-recorder-ct-react/cli.js b/packages/pw-recorder-ct-react/cli.js index 9cc834ee95e85..5f4c18d46bedb 100755 --- a/packages/pw-recorder-ct-react/cli.js +++ b/packages/pw-recorder-ct-react/cli.js @@ -15,6 +15,6 @@ * limitations under the License. */ -const { program } = require('@playwright/experimental-ct-core/lib/program'); +const { program } = require('@okep/experimental-ct-core/lib/program'); program.parse(process.argv); diff --git a/packages/pw-recorder-ct-react/index.d.ts b/packages/pw-recorder-ct-react/index.d.ts index c5e6d6d2da311..4f22a50367700 100644 --- a/packages/pw-recorder-ct-react/index.d.ts +++ b/packages/pw-recorder-ct-react/index.d.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import type { TestType, Locator } from '@playwright/experimental-ct-core'; +import type { TestType, Locator } from '@okep/experimental-ct-core'; export interface MountOptions { hooksConfig?: HooksConfig; @@ -32,4 +32,4 @@ export const test: TestType<{ ): Promise; }>; -export { defineConfig, PlaywrightTestConfig, expect, devices } from '@playwright/experimental-ct-core'; +export { defineConfig, PlaywrightTestConfig, expect, devices } from '@okep/experimental-ct-core'; diff --git a/packages/pw-recorder-ct-react/package.json b/packages/pw-recorder-ct-react/package.json index d4ba8b040434b..93d7d3f36e2cb 100644 --- a/packages/pw-recorder-ct-react/package.json +++ b/packages/pw-recorder-ct-react/package.json @@ -1,12 +1,12 @@ { - "name": "@pw-recorder/experimental-ct-react", - "version": "1.49.0-next", + "name": "@okep/experimental-ct-react", + "version": "1.49.3-alpha", "description": "Playwright Component Testing for React", "repository": { "type": "git", - "url": "git+https://github.com/microsoft/playwright.git" + "url": "git+https://github.com/microsoft/pw-recorder.git" }, - "homepage": "https://playwright.dev", + "homepage": "https://pw-recorder.dev", "engines": { "node": ">=18" }, @@ -30,10 +30,10 @@ "./package.json": "./package.json" }, "dependencies": { - "@playwright/experimental-ct-core": "1.49.0-next", + "@okep/experimental-ct-core": "1.49.3-alpha", "@vitejs/plugin-react": "^4.2.1" }, "bin": { - "playwright": "cli.js" + "pw-recorder": "cli.js" } } diff --git a/packages/pw-recorder-ct-react17/cli.js b/packages/pw-recorder-ct-react17/cli.js index 9cc834ee95e85..5f4c18d46bedb 100755 --- a/packages/pw-recorder-ct-react17/cli.js +++ b/packages/pw-recorder-ct-react17/cli.js @@ -15,6 +15,6 @@ * limitations under the License. */ -const { program } = require('@playwright/experimental-ct-core/lib/program'); +const { program } = require('@okep/experimental-ct-core/lib/program'); program.parse(process.argv); diff --git a/packages/pw-recorder-ct-react17/index.d.ts b/packages/pw-recorder-ct-react17/index.d.ts index 748212c45ed6f..28e6f386664c4 100644 --- a/packages/pw-recorder-ct-react17/index.d.ts +++ b/packages/pw-recorder-ct-react17/index.d.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import type { TestType, Locator} from '@playwright/experimental-ct-core'; +import type { TestType, Locator} from '@okep/experimental-ct-core'; export interface MountOptions { hooksConfig?: HooksConfig; @@ -32,4 +32,4 @@ export const test: TestType<{ ): Promise; }>; -export { defineConfig, PlaywrightTestConfig, expect, devices } from '@playwright/experimental-ct-core'; +export { defineConfig, PlaywrightTestConfig, expect, devices } from '@okep/experimental-ct-core'; diff --git a/packages/pw-recorder-ct-react17/package.json b/packages/pw-recorder-ct-react17/package.json index 58a334573f42b..ae0399be387a1 100644 --- a/packages/pw-recorder-ct-react17/package.json +++ b/packages/pw-recorder-ct-react17/package.json @@ -1,12 +1,12 @@ { - "name": "@pw-recorder/experimental-ct-react17", - "version": "1.49.0-next", + "name": "@okep/experimental-ct-react17", + "version": "1.49.3-alpha", "description": "Playwright Component Testing for React", "repository": { "type": "git", - "url": "git+https://github.com/microsoft/playwright.git" + "url": "git+https://github.com/microsoft/pw-recorder.git" }, - "homepage": "https://playwright.dev", + "homepage": "https://pw-recorder.dev", "engines": { "node": ">=18" }, @@ -30,10 +30,10 @@ "./package.json": "./package.json" }, "dependencies": { - "@playwright/experimental-ct-core": "1.49.0-next", + "@okep/experimental-ct-core": "1.49.3-alpha", "@vitejs/plugin-react": "^4.2.1" }, "bin": { - "playwright": "cli.js" + "pw-recorder": "cli.js" } } diff --git a/packages/pw-recorder-ct-solid/cli.js b/packages/pw-recorder-ct-solid/cli.js index 9cc834ee95e85..5f4c18d46bedb 100755 --- a/packages/pw-recorder-ct-solid/cli.js +++ b/packages/pw-recorder-ct-solid/cli.js @@ -15,6 +15,6 @@ * limitations under the License. */ -const { program } = require('@playwright/experimental-ct-core/lib/program'); +const { program } = require('@okep/experimental-ct-core/lib/program'); program.parse(process.argv); diff --git a/packages/pw-recorder-ct-solid/index.d.ts b/packages/pw-recorder-ct-solid/index.d.ts index c5e6d6d2da311..4f22a50367700 100644 --- a/packages/pw-recorder-ct-solid/index.d.ts +++ b/packages/pw-recorder-ct-solid/index.d.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import type { TestType, Locator } from '@playwright/experimental-ct-core'; +import type { TestType, Locator } from '@okep/experimental-ct-core'; export interface MountOptions { hooksConfig?: HooksConfig; @@ -32,4 +32,4 @@ export const test: TestType<{ ): Promise; }>; -export { defineConfig, PlaywrightTestConfig, expect, devices } from '@playwright/experimental-ct-core'; +export { defineConfig, PlaywrightTestConfig, expect, devices } from '@okep/experimental-ct-core'; diff --git a/packages/pw-recorder-ct-solid/package.json b/packages/pw-recorder-ct-solid/package.json index 80cf600b47690..e77cbd571089b 100644 --- a/packages/pw-recorder-ct-solid/package.json +++ b/packages/pw-recorder-ct-solid/package.json @@ -1,12 +1,12 @@ { - "name": "@pw-recorder/experimental-ct-solid", - "version": "1.49.0-next", + "name": "@okep/experimental-ct-solid", + "version": "1.49.3-alpha", "description": "Playwright Component Testing for Solid", "repository": { "type": "git", - "url": "git+https://github.com/microsoft/playwright.git" + "url": "git+https://github.com/microsoft/pw-recorder.git" }, - "homepage": "https://playwright.dev", + "homepage": "https://pw-recorder.dev", "engines": { "node": ">=18" }, @@ -30,13 +30,13 @@ "./package.json": "./package.json" }, "dependencies": { - "@playwright/experimental-ct-core": "1.49.0-next", + "@okep/experimental-ct-core": "1.49.3-alpha", "vite-plugin-solid": "^2.7.0" }, "devDependencies": { "solid-js": "^1.7.0" }, "bin": { - "playwright": "cli.js" + "pw-recorder": "cli.js" } } diff --git a/packages/pw-recorder-ct-svelte/cli.js b/packages/pw-recorder-ct-svelte/cli.js index 9cc834ee95e85..5f4c18d46bedb 100755 --- a/packages/pw-recorder-ct-svelte/cli.js +++ b/packages/pw-recorder-ct-svelte/cli.js @@ -15,6 +15,6 @@ * limitations under the License. */ -const { program } = require('@playwright/experimental-ct-core/lib/program'); +const { program } = require('@okep/experimental-ct-core/lib/program'); program.parse(process.argv); diff --git a/packages/pw-recorder-ct-svelte/index.d.ts b/packages/pw-recorder-ct-svelte/index.d.ts index 761831f3315d0..8c676ec3686f4 100644 --- a/packages/pw-recorder-ct-svelte/index.d.ts +++ b/packages/pw-recorder-ct-svelte/index.d.ts @@ -15,7 +15,7 @@ */ import type { SvelteComponent, ComponentProps } from 'svelte/types/runtime'; -import type { TestType, Locator } from '@playwright/experimental-ct-core'; +import type { TestType, Locator } from '@okep/experimental-ct-core'; type ComponentSlot = string | string[]; type ComponentSlots = Record & { default?: ComponentSlot }; @@ -43,4 +43,4 @@ export const test: TestType<{ ): Promise>; }>; -export { defineConfig, PlaywrightTestConfig, expect, devices } from '@playwright/experimental-ct-core'; +export { defineConfig, PlaywrightTestConfig, expect, devices } from '@okep/experimental-ct-core'; diff --git a/packages/pw-recorder-ct-svelte/package.json b/packages/pw-recorder-ct-svelte/package.json index 601422b5f0fd6..48b61aeebc3c2 100644 --- a/packages/pw-recorder-ct-svelte/package.json +++ b/packages/pw-recorder-ct-svelte/package.json @@ -1,12 +1,12 @@ { - "name": "@pw-recorder/experimental-ct-svelte", - "version": "1.49.0-next", + "name": "@okep/experimental-ct-svelte", + "version": "1.49.3-alpha", "description": "Playwright Component Testing for Svelte", "repository": { "type": "git", - "url": "git+https://github.com/microsoft/playwright.git" + "url": "git+https://github.com/microsoft/pw-recorder.git" }, - "homepage": "https://playwright.dev", + "homepage": "https://pw-recorder.dev", "engines": { "node": ">=18" }, @@ -30,13 +30,13 @@ "./package.json": "./package.json" }, "dependencies": { - "@playwright/experimental-ct-core": "1.49.0-next", + "@okep/experimental-ct-core": "1.49.3-alpha", "@sveltejs/vite-plugin-svelte": "^3.0.1" }, "devDependencies": { "svelte": "^4.2.19" }, "bin": { - "playwright": "cli.js" + "pw-recorder": "cli.js" } } diff --git a/packages/pw-recorder-ct-vue/cli.js b/packages/pw-recorder-ct-vue/cli.js index 9cc834ee95e85..5f4c18d46bedb 100755 --- a/packages/pw-recorder-ct-vue/cli.js +++ b/packages/pw-recorder-ct-vue/cli.js @@ -15,6 +15,6 @@ * limitations under the License. */ -const { program } = require('@playwright/experimental-ct-core/lib/program'); +const { program } = require('@okep/experimental-ct-core/lib/program'); program.parse(process.argv); diff --git a/packages/pw-recorder-ct-vue/index.d.ts b/packages/pw-recorder-ct-vue/index.d.ts index 822711f4b6660..e9be88e9f1a97 100644 --- a/packages/pw-recorder-ct-vue/index.d.ts +++ b/packages/pw-recorder-ct-vue/index.d.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import type { TestType, Locator } from '@playwright/experimental-ct-core'; +import type { TestType, Locator } from '@okep/experimental-ct-core'; type ComponentSlot = string | string[]; type ComponentSlots = Record & { default?: ComponentSlot }; @@ -63,4 +63,4 @@ export const test: TestType<{ ): Promise>; }>; -export { defineConfig, PlaywrightTestConfig, expect, devices } from '@playwright/experimental-ct-core'; +export { defineConfig, PlaywrightTestConfig, expect, devices } from '@okep/experimental-ct-core'; diff --git a/packages/pw-recorder-ct-vue/package.json b/packages/pw-recorder-ct-vue/package.json index 5282fc7f8b62f..67dde12a2dccc 100644 --- a/packages/pw-recorder-ct-vue/package.json +++ b/packages/pw-recorder-ct-vue/package.json @@ -1,12 +1,12 @@ { - "name": "@pw-recorder/experimental-ct-vue", - "version": "1.49.0-next", + "name": "@okep/experimental-ct-vue", + "version": "1.49.3-alpha", "description": "Playwright Component Testing for Vue", "repository": { "type": "git", - "url": "git+https://github.com/microsoft/playwright.git" + "url": "git+https://github.com/microsoft/pw-recorder.git" }, - "homepage": "https://playwright.dev", + "homepage": "https://pw-recorder.dev", "engines": { "node": ">=18" }, @@ -30,10 +30,10 @@ "./package.json": "./package.json" }, "dependencies": { - "@playwright/experimental-ct-core": "1.49.0-next", + "@okep/experimental-ct-core": "1.49.3-alpha", "@vitejs/plugin-vue": "^4.2.1" }, "bin": { - "playwright": "cli.js" + "pw-recorder": "cli.js" } } diff --git a/packages/pw-recorder-ct-vue2/cli.js b/packages/pw-recorder-ct-vue2/cli.js index 9cc834ee95e85..5f4c18d46bedb 100755 --- a/packages/pw-recorder-ct-vue2/cli.js +++ b/packages/pw-recorder-ct-vue2/cli.js @@ -15,6 +15,6 @@ * limitations under the License. */ -const { program } = require('@playwright/experimental-ct-core/lib/program'); +const { program } = require('@okep/experimental-ct-core/lib/program'); program.parse(process.argv); diff --git a/packages/pw-recorder-ct-vue2/index.d.ts b/packages/pw-recorder-ct-vue2/index.d.ts index 133b4a60f20d4..120b30c70e823 100644 --- a/packages/pw-recorder-ct-vue2/index.d.ts +++ b/packages/pw-recorder-ct-vue2/index.d.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import type { TestType, Locator } from '@playwright/experimental-ct-core'; +import type { TestType, Locator } from '@okep/experimental-ct-core'; type Slot = string | string[]; type ComponentSlots = Record & { default?: Slot }; @@ -63,4 +63,4 @@ export const test: TestType<{ ): Promise>; }>; -export { defineConfig, PlaywrightTestConfig, expect, devices } from '@playwright/experimental-ct-core'; +export { defineConfig, PlaywrightTestConfig, expect, devices } from '@okep/experimental-ct-core'; diff --git a/packages/pw-recorder-ct-vue2/package.json b/packages/pw-recorder-ct-vue2/package.json index 8fd66eacc0c50..0a5b7196b9f9c 100644 --- a/packages/pw-recorder-ct-vue2/package.json +++ b/packages/pw-recorder-ct-vue2/package.json @@ -1,12 +1,12 @@ { - "name": "@pw-recorder/experimental-ct-vue2", - "version": "1.49.0-next", + "name": "@okep/experimental-ct-vue2", + "version": "1.49.3-alpha", "description": "Playwright Component Testing for Vue2", "repository": { "type": "git", - "url": "git+https://github.com/microsoft/playwright.git" + "url": "git+https://github.com/microsoft/pw-recorder.git" }, - "homepage": "https://playwright.dev", + "homepage": "https://pw-recorder.dev", "engines": { "node": ">=18" }, @@ -30,13 +30,13 @@ "./package.json": "./package.json" }, "dependencies": { - "@playwright/experimental-ct-core": "1.49.0-next", + "@okep/experimental-ct-core": "1.49.3-alpha", "@vitejs/plugin-vue2": "^2.2.0" }, "devDependencies": { "vue": "^2.7.14" }, "bin": { - "playwright": "cli.js" + "pw-recorder": "cli.js" } } diff --git a/packages/pw-recorder-firefox/package.json b/packages/pw-recorder-firefox/package.json index 4de53ff2e3c87..45cadbe50bdd8 100644 --- a/packages/pw-recorder-firefox/package.json +++ b/packages/pw-recorder-firefox/package.json @@ -1,12 +1,12 @@ { "name": "pw-recorder-firefox", - "version": "1.49.0-next", + "version": "1.49.3-alpha", "description": "A high-level API to automate Firefox", "repository": { "type": "git", - "url": "git+https://github.com/microsoft/playwright.git" + "url": "git+https://github.com/microsoft/pw-recorder.git" }, - "homepage": "https://playwright.dev", + "homepage": "https://pw-recorder.dev", "engines": { "node": ">=18" }, @@ -24,12 +24,12 @@ "./package.json": "./package.json" }, "bin": { - "playwright": "cli.js" + "pw-recorder": "cli.js" }, "scripts": { "install": "node install.js" }, "dependencies": { - "playwright-core": "1.49.0-next" + "pw-recorder-core": "1.49.3-alpha" } } diff --git a/packages/pw-recorder-html-reporter/playwright.config.ts b/packages/pw-recorder-html-reporter/playwright.config.ts index 1e6cb8b8a3c74..3e3f4f6cb5891 100644 --- a/packages/pw-recorder-html-reporter/playwright.config.ts +++ b/packages/pw-recorder-html-reporter/playwright.config.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import { devices, defineConfig } from '@playwright/experimental-ct-react'; +import { devices, defineConfig } from '@okep/experimental-ct-react'; import path from 'path'; import url from 'url'; diff --git a/packages/pw-recorder-html-reporter/src/types.ts b/packages/pw-recorder-html-reporter/src/types.ts index 733e88e8b91f5..6c296c2626105 100644 --- a/packages/pw-recorder-html-reporter/src/types.ts +++ b/packages/pw-recorder-html-reporter/src/types.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import type { Metadata } from '@playwright/test'; +import type { Metadata } from '@okep/test'; export type Stats = { total: number; diff --git a/packages/pw-recorder-html-reporter/vite.config.ts b/packages/pw-recorder-html-reporter/vite.config.ts index bdde2574d59f9..fdb254e91e2b6 100644 --- a/packages/pw-recorder-html-reporter/vite.config.ts +++ b/packages/pw-recorder-html-reporter/vite.config.ts @@ -27,7 +27,7 @@ export default defineConfig({ ], resolve: { alias: { - '@web': path.resolve(__dirname, '../web/src'), + '@web': path.resolve(__dirname, '../pw-recorder-web/src'), }, }, build: { diff --git a/packages/pw-recorder-recorder/vite.config.ts b/packages/pw-recorder-recorder/vite.config.ts index 4085e7185a00d..8cd5b7b339c02 100644 --- a/packages/pw-recorder-recorder/vite.config.ts +++ b/packages/pw-recorder-recorder/vite.config.ts @@ -26,8 +26,8 @@ export default defineConfig({ resolve: { alias: { '@isomorphic': path.resolve(__dirname, '../pw-recorder-core/src/utils/isomorphic'), - '@protocol': path.resolve(__dirname, '../protocol/src'), - '@web': path.resolve(__dirname, '../web/src'), + '@protocol': path.resolve(__dirname, '../pw-recorder-protocol/src'), + '@web': path.resolve(__dirname, '../pw-recorder-web/src'), }, }, build: { diff --git a/packages/pw-recorder-test/package.json b/packages/pw-recorder-test/package.json index 2bdacbee99e19..59deed92d8e3d 100644 --- a/packages/pw-recorder-test/package.json +++ b/packages/pw-recorder-test/package.json @@ -1,12 +1,12 @@ { - "name": "@pw-recorder/test", - "version": "1.49.0-next", + "name": "@okep/test", + "version": "1.49.3-alpha", "description": "A high-level API to automate web browsers", "repository": { "type": "git", - "url": "git+https://github.com/microsoft/playwright.git" + "url": "git+https://github.com/microsoft/pw-recorder.git" }, - "homepage": "https://playwright.dev", + "homepage": "https://pw-recorder.dev", "engines": { "node": ">=18" }, @@ -26,10 +26,10 @@ "./reporter": "./reporter.js" }, "bin": { - "playwright": "cli.js" + "pw-recorder": "cli.js" }, "scripts": {}, "dependencies": { - "playwright": "1.49.0-next" + "pw-recorder": "1.49.3-alpha" } } diff --git a/packages/pw-recorder-trace-viewer/vite.config.ts b/packages/pw-recorder-trace-viewer/vite.config.ts index 83037470fdfb2..78e6bedacf18c 100644 --- a/packages/pw-recorder-trace-viewer/vite.config.ts +++ b/packages/pw-recorder-trace-viewer/vite.config.ts @@ -30,10 +30,10 @@ export default defineConfig({ alias: { '@injected': path.resolve(__dirname, '../pw-recorder-core/src/server/injected'), '@isomorphic': path.resolve(__dirname, '../pw-recorder-core/src/utils/isomorphic'), - '@protocol': path.resolve(__dirname, '../protocol/src'), - '@testIsomorphic': path.resolve(__dirname, '../playwright/src/isomorphic'), - '@trace': path.resolve(__dirname, '../trace/src'), - '@web': path.resolve(__dirname, '../web/src'), + '@protocol': path.resolve(__dirname, '../pw-recorder-protocol/src'), + '@testIsomorphic': path.resolve(__dirname, '../pw-recorder/src/isomorphic'), + '@trace': path.resolve(__dirname, '../pw-recorder-trace/src'), + '@web': path.resolve(__dirname, '../pw-recorder-web/src'), }, }, build: { diff --git a/packages/pw-recorder-trace-viewer/vite.sw.config.ts b/packages/pw-recorder-trace-viewer/vite.sw.config.ts index 1c9e5cb913919..61f2c1230a50d 100644 --- a/packages/pw-recorder-trace-viewer/vite.sw.config.ts +++ b/packages/pw-recorder-trace-viewer/vite.sw.config.ts @@ -29,10 +29,10 @@ export default defineConfig({ resolve: { alias: { '@isomorphic': path.resolve(__dirname, '../pw-recorder-core/src/utils/isomorphic'), - '@protocol': path.resolve(__dirname, '../protocol/src'), + '@protocol': path.resolve(__dirname, '../pw-recorder-protocol/src'), '@testIsomorphic': path.resolve(__dirname, '../pw-recorder-core/src/utils/testIsomorphic'), - '@trace': path.resolve(__dirname, '../trace/src'), - '@web': path.resolve(__dirname, '../web/src'), + '@trace': path.resolve(__dirname, '../pw-recorder-trace/src'), + '@web': path.resolve(__dirname, '../pw-recorder-web/src'), }, }, build: { diff --git a/packages/pw-recorder-web/playwright.config.ts b/packages/pw-recorder-web/playwright.config.ts index 8169cfa66114a..7d4b1d133e143 100644 --- a/packages/pw-recorder-web/playwright.config.ts +++ b/packages/pw-recorder-web/playwright.config.ts @@ -14,8 +14,8 @@ * limitations under the License. */ -import { devices, defineConfig } from '@playwright/experimental-ct-react'; -import type { ReporterDescription } from '@playwright/test'; +import { devices, defineConfig } from '@okep/experimental-ct-react'; +import type { ReporterDescription } from '@okep/test'; const reporters = () => { const result: ReporterDescription[] = process.env.CI ? [ diff --git a/packages/pw-recorder-webkit/package.json b/packages/pw-recorder-webkit/package.json index 46db3a6032c1c..2712dfba0548a 100644 --- a/packages/pw-recorder-webkit/package.json +++ b/packages/pw-recorder-webkit/package.json @@ -1,12 +1,12 @@ { "name": "pw-recorder-webkit", - "version": "1.49.0-next", + "version": "1.49.3-alpha", "description": "A high-level API to automate WebKit", "repository": { "type": "git", - "url": "git+https://github.com/microsoft/playwright.git" + "url": "git+https://github.com/microsoft/pw-recorder.git" }, - "homepage": "https://playwright.dev", + "homepage": "https://pw-recorder.dev", "engines": { "node": ">=18" }, @@ -24,12 +24,12 @@ "./package.json": "./package.json" }, "bin": { - "playwright": "cli.js" + "pw-recorder": "cli.js" }, "scripts": { "install": "node install.js" }, "dependencies": { - "playwright-core": "1.49.0-next" + "pw-recorder-core": "1.49.3-alpha" } } diff --git a/packages/pw-recorder/bundles/babel/package.json b/packages/pw-recorder/bundles/babel/package.json index cd3b8073673f8..c2abb6fe1ed57 100644 --- a/packages/pw-recorder/bundles/babel/package.json +++ b/packages/pw-recorder/bundles/babel/package.json @@ -3,7 +3,7 @@ "version": "0.0.1", "private": false, "scripts": { - "esbuild": "esbuild ./src/babelBundleImpl.ts --bundle --outdir=../../lib/transform --format=cjs --platform=node --target=ES2019 --external:playwright", + "esbuild": "esbuild ./src/babelBundleImpl.ts --bundle --outdir=../../lib/transform --format=cjs --platform=node --target=ES2019 --external:pw-recorder", "build": "npm run esbuild -- --minify", "watch": "npm run esbuild -- --watch --sourcemap", "generate-license": "node ../../../../utils/generate_third_party_notice.js" diff --git a/packages/pw-recorder/package.json b/packages/pw-recorder/package.json index 69327ea955981..6f3491780bd91 100644 --- a/packages/pw-recorder/package.json +++ b/packages/pw-recorder/package.json @@ -1,12 +1,12 @@ { "name": "pw-recorder", - "version": "1.49.0-next", + "version": "1.49.3-alpha", "description": "A high-level API to automate web browsers", "repository": { "type": "git", - "url": "git+https://github.com/microsoft/playwright.git" + "url": "git+https://github.com/microsoft/pw-recorder.git" }, - "homepage": "https://playwright.dev", + "homepage": "https://pw-recorder.dev", "engines": { "node": ">=18" }, @@ -49,14 +49,14 @@ } }, "bin": { - "playwright": "cli.js" + "pw-recorder": "cli.js" }, "author": { "name": "Microsoft Corporation" }, "license": "Apache-2.0", "dependencies": { - "playwright-core": "1.49.0-next" + "pw-recorder-core": "1.49.3-alpha" }, "optionalDependencies": { "fsevents": "2.3.2" diff --git a/packages/pw-recorder/src/common/config.ts b/packages/pw-recorder/src/common/config.ts index d7fb49964581b..faf2ee327d1c3 100644 --- a/packages/pw-recorder/src/common/config.ts +++ b/packages/pw-recorder/src/common/config.ts @@ -67,7 +67,7 @@ export class FullConfigInternal { this.configDir = configDir; this.configCLIOverrides = configCLIOverrides; - const privateConfiguration = (userConfig as any)['@playwright/test']; + const privateConfiguration = (userConfig as any)['@okep/test']; this.plugins = (privateConfiguration?.plugins || []).map((p: any) => ({ factory: p })); this.config = { @@ -289,4 +289,4 @@ const configInternalSymbol = Symbol('configInternalSymbol'); export function getProjectId(project: FullProject): string { return (project as any).__projectId!; -} \ No newline at end of file +} diff --git a/packages/pw-recorder/src/common/configLoader.ts b/packages/pw-recorder/src/common/configLoader.ts index 06e0bb1abd190..5948d770186cb 100644 --- a/packages/pw-recorder/src/common/configLoader.ts +++ b/packages/pw-recorder/src/common/configLoader.ts @@ -115,7 +115,7 @@ export async function loadConfig(location: ConfigLocation, overrides?: ConfigCLI } // 3. Load transform options from the playwright config. - const babelPlugins = (userConfig as any)['@playwright/test']?.babelPlugins || []; + const babelPlugins = (userConfig as any)['@okep/test']?.babelPlugins || []; const external = userConfig.build?.external || []; setTransformConfig({ babelPlugins, external }); diff --git a/packages/pw-recorder/src/common/testType.ts b/packages/pw-recorder/src/common/testType.ts index 40b00913e9785..1024512fb5691 100644 --- a/packages/pw-recorder/src/common/testType.ts +++ b/packages/pw-recorder/src/common/testType.ts @@ -74,8 +74,8 @@ export class TestTypeImpl { `Most common reasons include:`, `- You are calling ${title} in a configuration file.`, `- You are calling ${title} in a file that is imported by the configuration file.`, - `- You have two different versions of @playwright/test. This usually happens`, - ` when one of the dependencies in your package.json depends on @playwright/test.`, + `- You have two different versions of @okep/test. This usually happens`, + ` when one of the dependencies in your package.json depends on @okep/test.`, ].join('\n')); } if (suite._testTypeImpl && suite._testTypeImpl !== this) { diff --git a/packages/pw-recorder/src/index.ts b/packages/pw-recorder/src/index.ts index 0f016c5f59fb7..e567a84891c0a 100644 --- a/packages/pw-recorder/src/index.ts +++ b/packages/pw-recorder/src/index.ts @@ -34,7 +34,7 @@ if ((process as any)['__pw_initiator__']) { const originalStackTraceLimit = Error.stackTraceLimit; Error.stackTraceLimit = 200; try { - throw new Error('Requiring @playwright/test second time, \nFirst:\n' + (process as any)['__pw_initiator__'] + '\n\nSecond: '); + throw new Error('Requiring @okep/test second time, \nFirst:\n' + (process as any)['__pw_initiator__'] + '\n\nSecond: '); } finally { Error.stackTraceLimit = originalStackTraceLimit; } diff --git a/packages/pw-recorder/src/reporters/html.ts b/packages/pw-recorder/src/reporters/html.ts index c08967805d0ed..f8e1c2a0f3bd8 100644 --- a/packages/pw-recorder/src/reporters/html.ts +++ b/packages/pw-recorder/src/reporters/html.ts @@ -29,7 +29,7 @@ import type { Metadata } from '../../types/test'; import type { ZipFile } from 'pw-recorder-core/lib/zipBundle'; import { yazl } from 'pw-recorder-core/lib/zipBundle'; import { mime } from 'pw-recorder-core/lib/utilsBundle'; -import type { HTMLReport, Stats, TestAttachment, TestCase, TestCaseSummary, TestFile, TestFileSummary, TestResult, TestStep } from '@pw-recorder-html-reporter/types'; +import type { HTMLReport, Stats, TestAttachment, TestCase, TestCaseSummary, TestFile, TestFileSummary, TestResult, TestStep } from '@okep-html-reporter/types'; import type { ReporterV2 } from './reporterV2'; type TestEntry = { diff --git a/packages/pw-recorder/src/transform/esmUtils.ts b/packages/pw-recorder/src/transform/esmUtils.ts index 31851f61d3567..9f015c033d7df 100644 --- a/packages/pw-recorder/src/transform/esmUtils.ts +++ b/packages/pw-recorder/src/transform/esmUtils.ts @@ -18,7 +18,7 @@ import url from 'url'; const kExperimentalLoaderOptions = [ '--no-warnings', - `--experimental-loader=${url.pathToFileURL(require.resolve('playwright/lib/transform/esmLoader')).toString()}`, + `--experimental-loader=${url.pathToFileURL(require.resolve('pw-recorder/lib/transform/esmLoader')).toString()}`, ]; export function execArgvWithExperimentalLoaderOptions() { diff --git a/tests/android/androidTest.ts b/tests/android/androidTest.ts index 3f4c5b9232981..62053f79210f6 100644 --- a/tests/android/androidTest.ts +++ b/tests/android/androidTest.ts @@ -17,7 +17,7 @@ import { baseTest } from '../config/baseTest'; import type { PageTestFixtures, PageWorkerFixtures } from '../page/pageTestApi'; import type { AndroidDevice, BrowserContext } from 'pw-recorder-core'; -export { expect } from '@pw-recorder/test'; +export { expect } from '@okep/test'; type AndroidWorkerFixtures = PageWorkerFixtures & { androidDevice: AndroidDevice; diff --git a/tests/android/playwright.config.ts b/tests/android/playwright.config.ts index db9e62c68447a..8c231a7cae060 100644 --- a/tests/android/playwright.config.ts +++ b/tests/android/playwright.config.ts @@ -17,7 +17,7 @@ import { config as loadEnv } from 'dotenv'; loadEnv({ path: path.join(__dirname, '..', '..', '.env') }); -import type { Config, PlaywrightTestOptions, PlaywrightWorkerOptions } from '@pw-recorder/test'; +import type { Config, PlaywrightTestOptions, PlaywrightWorkerOptions } from '@okep/test'; import * as path from 'path'; import type { ServerWorkerOptions } from '../config/serverFixtures'; diff --git a/tests/bidi/expectationReporter.ts b/tests/bidi/expectationReporter.ts index 3ace552cf1f40..34e7b4511875a 100644 --- a/tests/bidi/expectationReporter.ts +++ b/tests/bidi/expectationReporter.ts @@ -16,7 +16,7 @@ import type { FullConfig, FullResult, Reporter, Suite, TestCase -} from '@pw-recorder/test/reporter'; +} from '@okep/test/reporter'; import fs from 'fs'; import { parseBidiExpectations as parseExpectations, projectExpectationPath } from './expectationUtil'; import type { TestExpectation } from './expectationUtil'; diff --git a/tests/bidi/playwright.config.ts b/tests/bidi/playwright.config.ts index 8a7caedcd6242..1ef45dba8bd56 100644 --- a/tests/bidi/playwright.config.ts +++ b/tests/bidi/playwright.config.ts @@ -17,7 +17,7 @@ import { config as loadEnv } from 'dotenv'; loadEnv({ path: path.join(__dirname, '..', '..', '.env'), override: true }); -import { type Config, type PlaywrightTestOptions, type PlaywrightWorkerOptions, type ReporterDescription } from '@pw-recorder/test'; +import { type Config, type PlaywrightTestOptions, type PlaywrightWorkerOptions, type ReporterDescription } from '@okep/test'; import * as path from 'path'; import type { TestModeWorkerOptions } from '../config/testModeFixtures'; diff --git a/tests/components/ct-react-vite/playwright.config.ts b/tests/components/ct-react-vite/playwright.config.ts index 63d909ae2717b..71fb9c30c685b 100644 --- a/tests/components/ct-react-vite/playwright.config.ts +++ b/tests/components/ct-react-vite/playwright.config.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import { defineConfig, devices } from '@playwright/experimental-ct-react'; +import { defineConfig, devices } from '@okep/experimental-ct-react'; import { resolve } from 'path'; export default defineConfig({ diff --git a/tests/components/ct-react17/playwright.config.ts b/tests/components/ct-react17/playwright.config.ts index b46debe592666..ae2e5f00ca00b 100644 --- a/tests/components/ct-react17/playwright.config.ts +++ b/tests/components/ct-react17/playwright.config.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import { defineConfig, devices } from '@pw-recorder/experimental-ct-react17'; +import { defineConfig, devices } from '@okep/experimental-ct-react17'; import { resolve } from 'path'; export default defineConfig({ diff --git a/tests/components/ct-solid/playwright.config.ts b/tests/components/ct-solid/playwright.config.ts index e330eebebcff0..10e39e2f7dce7 100644 --- a/tests/components/ct-solid/playwright.config.ts +++ b/tests/components/ct-solid/playwright.config.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import { defineConfig, devices } from '@pw-recorder/experimental-ct-solid'; +import { defineConfig, devices } from '@okep/experimental-ct-solid'; import { resolve } from 'path'; export default defineConfig({ diff --git a/tests/components/ct-svelte-vite/playwright.config.ts b/tests/components/ct-svelte-vite/playwright.config.ts index 90b547e158361..6f3f0adec1cb2 100644 --- a/tests/components/ct-svelte-vite/playwright.config.ts +++ b/tests/components/ct-svelte-vite/playwright.config.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import { defineConfig, devices } from '@playwright/experimental-ct-svelte'; +import { defineConfig, devices } from '@okep/experimental-ct-svelte'; import { resolve } from 'path'; export default defineConfig({ diff --git a/tests/components/ct-svelte-vite/playwright/index.ts b/tests/components/ct-svelte-vite/playwright/index.ts index dcbcd47225bd0..ac0365d4c2904 100644 --- a/tests/components/ct-svelte-vite/playwright/index.ts +++ b/tests/components/ct-svelte-vite/playwright/index.ts @@ -1,5 +1,5 @@ import '../src/assets/index.css'; -import { beforeMount, afterMount } from '@playwright/experimental-ct-svelte/hooks'; +import { beforeMount, afterMount } from '@okep/experimental-ct-svelte/hooks'; export type HooksConfig = { context?: string; diff --git a/tests/components/ct-svelte-vite/tests/events.spec.ts b/tests/components/ct-svelte-vite/tests/events.spec.ts index f2f2593515464..42e09c07d7330 100644 --- a/tests/components/ct-svelte-vite/tests/events.spec.ts +++ b/tests/components/ct-svelte-vite/tests/events.spec.ts @@ -1,4 +1,4 @@ -import { test, expect } from '@playwright/experimental-ct-svelte'; +import { test, expect } from '@okep/experimental-ct-svelte'; import Button from '@/components/Button.svelte'; test('emit an submit event when the button is clicked', async ({ mount }) => { diff --git a/tests/components/ct-svelte-vite/tests/render.spec.ts b/tests/components/ct-svelte-vite/tests/render.spec.ts index bf830dd7152a8..6e30230d1a2b9 100644 --- a/tests/components/ct-svelte-vite/tests/render.spec.ts +++ b/tests/components/ct-svelte-vite/tests/render.spec.ts @@ -1,4 +1,4 @@ -import { test, expect } from '@playwright/experimental-ct-svelte'; +import { test, expect } from '@okep/experimental-ct-svelte'; import type { HooksConfig } from '../playwright'; import Button from '@/components/Button.svelte'; import Empty from '@/components/Empty.svelte'; diff --git a/tests/components/ct-svelte-vite/tests/router.spec.ts b/tests/components/ct-svelte-vite/tests/router.spec.ts index 127620b3c9fb5..c3bee7184707c 100644 --- a/tests/components/ct-svelte-vite/tests/router.spec.ts +++ b/tests/components/ct-svelte-vite/tests/router.spec.ts @@ -1,4 +1,4 @@ -import { test, expect } from '@playwright/experimental-ct-svelte'; +import { test, expect } from '@okep/experimental-ct-svelte'; import App from '@/App.svelte'; test('navigate to a page by clicking a link', async ({ page, mount }) => { diff --git a/tests/components/ct-svelte-vite/tests/slots.spec.ts b/tests/components/ct-svelte-vite/tests/slots.spec.ts index 4d6823abe75a5..b9869aec6b126 100644 --- a/tests/components/ct-svelte-vite/tests/slots.spec.ts +++ b/tests/components/ct-svelte-vite/tests/slots.spec.ts @@ -1,4 +1,4 @@ -import { test, expect } from '@playwright/experimental-ct-svelte'; +import { test, expect } from '@okep/experimental-ct-svelte'; import DefaultSlot from '@/components/DefaultSlot.svelte'; import NamedSlots from '@/components/NamedSlots.svelte'; diff --git a/tests/components/ct-svelte-vite/tests/unmount.spec.ts b/tests/components/ct-svelte-vite/tests/unmount.spec.ts index 946fc659e55e6..cfb4d78cd323c 100644 --- a/tests/components/ct-svelte-vite/tests/unmount.spec.ts +++ b/tests/components/ct-svelte-vite/tests/unmount.spec.ts @@ -1,4 +1,4 @@ -import { test, expect } from '@playwright/experimental-ct-svelte'; +import { test, expect } from '@okep/experimental-ct-svelte'; import Button from '@/components/Button.svelte'; import MultiRoot from '@/components/MultiRoot.svelte'; diff --git a/tests/components/ct-svelte-vite/tests/update.spec.ts b/tests/components/ct-svelte-vite/tests/update.spec.ts index 358204edfaed6..d59011fb907ec 100644 --- a/tests/components/ct-svelte-vite/tests/update.spec.ts +++ b/tests/components/ct-svelte-vite/tests/update.spec.ts @@ -1,4 +1,4 @@ -import { test, expect } from '@playwright/experimental-ct-svelte'; +import { test, expect } from '@okep/experimental-ct-svelte'; import Counter from '@/components/Counter.svelte'; test('update props without remounting', async ({ mount }) => { diff --git a/tests/components/ct-svelte/playwright.config.ts b/tests/components/ct-svelte/playwright.config.ts index 1d882df0784e4..0645a61e050f6 100644 --- a/tests/components/ct-svelte/playwright.config.ts +++ b/tests/components/ct-svelte/playwright.config.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import { defineConfig, devices } from '@pw-recorder/experimental-ct-svelte'; +import { defineConfig, devices } from '@okep/experimental-ct-svelte'; import { resolve } from 'path'; export default defineConfig({ diff --git a/tests/components/ct-svelte/playwright/index.ts b/tests/components/ct-svelte/playwright/index.ts index 4ee0daca28258..ceb10be681793 100644 --- a/tests/components/ct-svelte/playwright/index.ts +++ b/tests/components/ct-svelte/playwright/index.ts @@ -1,6 +1,6 @@ // @ts-check import '../src/assets/index.css'; -import { beforeMount, afterMount } from '@pw-recorder/experimental-ct-svelte/hooks'; +import { beforeMount, afterMount } from '@okep/experimental-ct-svelte/hooks'; export type HooksConfig = { route: string; diff --git a/tests/components/ct-svelte/tests/events.spec.ts b/tests/components/ct-svelte/tests/events.spec.ts index 93dd5ed2cd93f..42e09c07d7330 100644 --- a/tests/components/ct-svelte/tests/events.spec.ts +++ b/tests/components/ct-svelte/tests/events.spec.ts @@ -1,4 +1,4 @@ -import { test, expect } from '@pw-recorder/experimental-ct-svelte'; +import { test, expect } from '@okep/experimental-ct-svelte'; import Button from '@/components/Button.svelte'; test('emit an submit event when the button is clicked', async ({ mount }) => { diff --git a/tests/components/ct-svelte/tests/render.spec.ts b/tests/components/ct-svelte/tests/render.spec.ts index 6bea2beba229c..90be6507c2451 100644 --- a/tests/components/ct-svelte/tests/render.spec.ts +++ b/tests/components/ct-svelte/tests/render.spec.ts @@ -1,4 +1,4 @@ -import { test, expect } from '@pw-recorder/experimental-ct-svelte'; +import { test, expect } from '@okep/experimental-ct-svelte'; import Button from '@/components/Button.svelte'; import Component from '@/components/Component.svelte'; import Empty from '@/components/Empty.svelte'; diff --git a/tests/components/ct-svelte/tests/router.spec.ts b/tests/components/ct-svelte/tests/router.spec.ts index 9bb2015d1de3c..c3bee7184707c 100644 --- a/tests/components/ct-svelte/tests/router.spec.ts +++ b/tests/components/ct-svelte/tests/router.spec.ts @@ -1,4 +1,4 @@ -import { test, expect } from '@pw-recorder/experimental-ct-svelte'; +import { test, expect } from '@okep/experimental-ct-svelte'; import App from '@/App.svelte'; test('navigate to a page by clicking a link', async ({ page, mount }) => { diff --git a/tests/components/ct-svelte/tests/slots.spec.ts b/tests/components/ct-svelte/tests/slots.spec.ts index ceb46a66bbea3..b9869aec6b126 100644 --- a/tests/components/ct-svelte/tests/slots.spec.ts +++ b/tests/components/ct-svelte/tests/slots.spec.ts @@ -1,4 +1,4 @@ -import { test, expect } from '@pw-recorder/experimental-ct-svelte'; +import { test, expect } from '@okep/experimental-ct-svelte'; import DefaultSlot from '@/components/DefaultSlot.svelte'; import NamedSlots from '@/components/NamedSlots.svelte'; diff --git a/tests/components/ct-svelte/tests/unmount.spec.ts b/tests/components/ct-svelte/tests/unmount.spec.ts index 5acc9e33f08d6..b8687b6c84163 100644 --- a/tests/components/ct-svelte/tests/unmount.spec.ts +++ b/tests/components/ct-svelte/tests/unmount.spec.ts @@ -1,4 +1,4 @@ -import { test, expect } from '@pw-recorder/experimental-ct-svelte'; +import { test, expect } from '@okep/experimental-ct-svelte'; import Button from '@/components/Button.svelte'; import MultiRoot from '@/components/MultiRoot.svelte'; diff --git a/tests/components/ct-svelte/tests/update.spec.ts b/tests/components/ct-svelte/tests/update.spec.ts index 0281694131de6..d59011fb907ec 100644 --- a/tests/components/ct-svelte/tests/update.spec.ts +++ b/tests/components/ct-svelte/tests/update.spec.ts @@ -1,4 +1,4 @@ -import { test, expect } from '@pw-recorder/experimental-ct-svelte'; +import { test, expect } from '@okep/experimental-ct-svelte'; import Counter from '@/components/Counter.svelte'; test('update props without remounting', async ({ mount }) => { diff --git a/tests/components/ct-vue-cli/playwright.config.ts b/tests/components/ct-vue-cli/playwright.config.ts index d21f76ad530b2..08c6fdb937908 100644 --- a/tests/components/ct-vue-cli/playwright.config.ts +++ b/tests/components/ct-vue-cli/playwright.config.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import { defineConfig, devices } from '@pw-recorder/experimental-ct-vue'; +import { defineConfig, devices } from '@okep/experimental-ct-vue'; import { resolve } from 'path'; export default defineConfig({ diff --git a/tests/components/ct-vue-cli/playwright/index.ts b/tests/components/ct-vue-cli/playwright/index.ts index 8940db58b8167..62c24cb1272dc 100644 --- a/tests/components/ct-vue-cli/playwright/index.ts +++ b/tests/components/ct-vue-cli/playwright/index.ts @@ -1,4 +1,4 @@ -import { beforeMount, afterMount } from '@playwright/experimental-ct-vue/hooks'; +import { beforeMount, afterMount } from '@okep/experimental-ct-vue/hooks'; import { router } from '../src/router'; import Button from '../src/components/Button.vue'; import '../src/assets/index.css'; diff --git a/tests/components/ct-vue-cli/tests/events/events.spec.ts b/tests/components/ct-vue-cli/tests/events/events.spec.ts index 698e887e39cf6..e94cf9180f706 100644 --- a/tests/components/ct-vue-cli/tests/events/events.spec.ts +++ b/tests/components/ct-vue-cli/tests/events/events.spec.ts @@ -1,4 +1,4 @@ -import { test, expect } from '@playwright/experimental-ct-vue'; +import { test, expect } from '@okep/experimental-ct-vue'; import Button from '@/components/Button.vue'; test('emit an submit event when the button is clicked', async ({ mount }) => { diff --git a/tests/components/ct-vue-cli/tests/render/render.spec.ts b/tests/components/ct-vue-cli/tests/render/render.spec.ts index ab0ac290a25a0..a674376f83dcf 100644 --- a/tests/components/ct-vue-cli/tests/render/render.spec.ts +++ b/tests/components/ct-vue-cli/tests/render/render.spec.ts @@ -1,4 +1,4 @@ -import { test, expect } from '@pw-recorder/experimental-ct-vue'; +import { test, expect } from '@okep/experimental-ct-vue'; import Button from '@/components/Button.vue'; import Component from '@/components/Component.vue'; import EmptyTemplate from '@/components/EmptyTemplate.vue'; diff --git a/tests/components/ct-vue-cli/tests/slots/slots.spec.ts b/tests/components/ct-vue-cli/tests/slots/slots.spec.ts index 1efcbdd08d88a..11d253ff19c5e 100644 --- a/tests/components/ct-vue-cli/tests/slots/slots.spec.ts +++ b/tests/components/ct-vue-cli/tests/slots/slots.spec.ts @@ -1,4 +1,4 @@ -import { test, expect } from '@pw-recorder/experimental-ct-vue'; +import { test, expect } from '@okep/experimental-ct-vue'; import DefaultSlot from '@/components/DefaultSlot.vue'; import NamedSlots from '@/components/NamedSlots.vue'; diff --git a/tests/components/ct-vue-cli/tests/unmount/unmount.spec.ts b/tests/components/ct-vue-cli/tests/unmount/unmount.spec.ts index 81e4686173e2c..d62f8f059abaa 100644 --- a/tests/components/ct-vue-cli/tests/unmount/unmount.spec.ts +++ b/tests/components/ct-vue-cli/tests/unmount/unmount.spec.ts @@ -1,4 +1,4 @@ -import { test, expect } from '@playwright/experimental-ct-vue'; +import { test, expect } from '@okep/experimental-ct-vue'; import Button from '@/components/Button.vue'; import MultiRoot from '@/components/MultiRoot.vue'; diff --git a/tests/components/ct-vue-cli/tests/update/update.spec.ts b/tests/components/ct-vue-cli/tests/update/update.spec.ts index 114a1274c04dc..8af39e9bac79f 100644 --- a/tests/components/ct-vue-cli/tests/update/update.spec.ts +++ b/tests/components/ct-vue-cli/tests/update/update.spec.ts @@ -1,4 +1,4 @@ -import { test, expect } from '@playwright/experimental-ct-vue'; +import { test, expect } from '@okep/experimental-ct-vue'; import Counter from '@/components/Counter.vue'; test('update props without remounting', async ({ mount }) => { diff --git a/tests/components/ct-vue-cli/tests/vue-router/vue-router.spec.ts b/tests/components/ct-vue-cli/tests/vue-router/vue-router.spec.ts index c268b2fbfbadd..8eaa010d1be79 100644 --- a/tests/components/ct-vue-cli/tests/vue-router/vue-router.spec.ts +++ b/tests/components/ct-vue-cli/tests/vue-router/vue-router.spec.ts @@ -1,4 +1,4 @@ -import { test, expect } from '@playwright/experimental-ct-vue'; +import { test, expect } from '@okep/experimental-ct-vue'; import App from '@/App.vue'; import type { HooksConfig } from '../../playwright'; diff --git a/tests/components/ct-vue-vite/playwright.config.ts b/tests/components/ct-vue-vite/playwright.config.ts index c95f2ff33871d..08c6fdb937908 100644 --- a/tests/components/ct-vue-vite/playwright.config.ts +++ b/tests/components/ct-vue-vite/playwright.config.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import { defineConfig, devices } from '@playwright/experimental-ct-vue'; +import { defineConfig, devices } from '@okep/experimental-ct-vue'; import { resolve } from 'path'; export default defineConfig({ diff --git a/tests/components/ct-vue-vite/playwright/index.ts b/tests/components/ct-vue-vite/playwright/index.ts index f23ab5a90a8e7..a175f7f02f89a 100644 --- a/tests/components/ct-vue-vite/playwright/index.ts +++ b/tests/components/ct-vue-vite/playwright/index.ts @@ -1,4 +1,4 @@ -import { beforeMount, afterMount } from '@playwright/experimental-ct-vue/hooks'; +import { beforeMount, afterMount } from '@okep/experimental-ct-vue/hooks'; import { router } from '../src/router'; import Button from '../src/components/Button.vue'; import '../src/assets/index.css'; diff --git a/tests/components/ct-vue-vite/tests/events/events.spec.ts b/tests/components/ct-vue-vite/tests/events/events.spec.ts index 4cb3149219124..e3e7dd271747d 100644 --- a/tests/components/ct-vue-vite/tests/events/events.spec.ts +++ b/tests/components/ct-vue-vite/tests/events/events.spec.ts @@ -1,4 +1,4 @@ -import { test, expect } from '@playwright/experimental-ct-vue'; +import { test, expect } from '@okep/experimental-ct-vue'; import Button from '@/components/Button.vue'; test('emit a submit event when the button is clicked', async ({ mount }) => { diff --git a/tests/components/ct-vue-vite/tests/render/render.spec.ts b/tests/components/ct-vue-vite/tests/render/render.spec.ts index f0af3a2cdf499..0d50ebf66cbb3 100644 --- a/tests/components/ct-vue-vite/tests/render/render.spec.ts +++ b/tests/components/ct-vue-vite/tests/render/render.spec.ts @@ -1,4 +1,4 @@ -import { test, expect } from '@playwright/experimental-ct-vue'; +import { test, expect } from '@okep/experimental-ct-vue'; import Button from '@/components/Button.vue'; import EmptyTemplate from '@/components/EmptyTemplate.vue'; import Component from '@/components/Component.vue'; diff --git a/tests/components/ct-vue-vite/tests/slots/slots.spec.ts b/tests/components/ct-vue-vite/tests/slots/slots.spec.ts index a33c9dac920fa..3e0569105fc43 100644 --- a/tests/components/ct-vue-vite/tests/slots/slots.spec.ts +++ b/tests/components/ct-vue-vite/tests/slots/slots.spec.ts @@ -1,4 +1,4 @@ -import { test, expect } from '@playwright/experimental-ct-vue'; +import { test, expect } from '@okep/experimental-ct-vue'; import DefaultSlot from '@/components/DefaultSlot.vue'; import NamedSlots from '@/components/NamedSlots.vue'; import Button from '@/components/Button.vue'; diff --git a/tests/components/ct-vue-vite/tests/unmount/unmount.spec.ts b/tests/components/ct-vue-vite/tests/unmount/unmount.spec.ts index 322460f7aaf10..b09b9b78fad91 100644 --- a/tests/components/ct-vue-vite/tests/unmount/unmount.spec.ts +++ b/tests/components/ct-vue-vite/tests/unmount/unmount.spec.ts @@ -1,4 +1,4 @@ -import { test, expect } from '@playwright/experimental-ct-vue'; +import { test, expect } from '@okep/experimental-ct-vue'; import Button from '@/components/Button.vue'; import MultiRoot from '@/components/MultiRoot.vue'; diff --git a/tests/components/ct-vue-vite/tests/update/update.spec.ts b/tests/components/ct-vue-vite/tests/update/update.spec.ts index 114a1274c04dc..8af39e9bac79f 100644 --- a/tests/components/ct-vue-vite/tests/update/update.spec.ts +++ b/tests/components/ct-vue-vite/tests/update/update.spec.ts @@ -1,4 +1,4 @@ -import { test, expect } from '@playwright/experimental-ct-vue'; +import { test, expect } from '@okep/experimental-ct-vue'; import Counter from '@/components/Counter.vue'; test('update props without remounting', async ({ mount }) => { diff --git a/tests/components/ct-vue-vite/tests/vue-router/vue-router.spec.ts b/tests/components/ct-vue-vite/tests/vue-router/vue-router.spec.ts index 000715b368d05..1d5af2867dcbe 100644 --- a/tests/components/ct-vue-vite/tests/vue-router/vue-router.spec.ts +++ b/tests/components/ct-vue-vite/tests/vue-router/vue-router.spec.ts @@ -1,4 +1,4 @@ -import { test, expect } from '@playwright/experimental-ct-vue'; +import { test, expect } from '@okep/experimental-ct-vue'; import type { HooksConfig } from '../../playwright'; import App from '@/App.vue'; diff --git a/tests/components/ct-vue2-cli/playwright.config.ts b/tests/components/ct-vue2-cli/playwright.config.ts index 307bc9726d368..631fb0e5d1c15 100644 --- a/tests/components/ct-vue2-cli/playwright.config.ts +++ b/tests/components/ct-vue2-cli/playwright.config.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import { defineConfig, devices } from '@playwright/experimental-ct-vue2'; +import { defineConfig, devices } from '@okep/experimental-ct-vue2'; import { resolve } from 'path'; export default defineConfig({ diff --git a/tests/components/ct-vue2-cli/tests/events/events.spec.ts b/tests/components/ct-vue2-cli/tests/events/events.spec.ts index 71c4c958a9d80..588eaf2826eee 100644 --- a/tests/components/ct-vue2-cli/tests/events/events.spec.ts +++ b/tests/components/ct-vue2-cli/tests/events/events.spec.ts @@ -1,4 +1,4 @@ -import { test, expect } from '@playwright/experimental-ct-vue2'; +import { test, expect } from '@okep/experimental-ct-vue2'; import Button from '@/components/Button.vue'; test('emit an submit event when the button is clicked', async ({ mount }) => { diff --git a/tests/components/ct-vue2-cli/tests/render/render.spec.ts b/tests/components/ct-vue2-cli/tests/render/render.spec.ts index dcb3284f3c64a..08163c9b2ca80 100644 --- a/tests/components/ct-vue2-cli/tests/render/render.spec.ts +++ b/tests/components/ct-vue2-cli/tests/render/render.spec.ts @@ -1,4 +1,4 @@ -import { test, expect } from '@playwright/experimental-ct-vue2'; +import { test, expect } from '@okep/experimental-ct-vue2'; import Button from '@/components/Button.vue'; import Component from '@/components/Component.vue'; import EmptyTemplate from '@/components/EmptyTemplate.vue'; diff --git a/tests/components/ct-vue2-cli/tests/slots/slots.spec.ts b/tests/components/ct-vue2-cli/tests/slots/slots.spec.ts index afc121007496f..b898168a56122 100644 --- a/tests/components/ct-vue2-cli/tests/slots/slots.spec.ts +++ b/tests/components/ct-vue2-cli/tests/slots/slots.spec.ts @@ -1,4 +1,4 @@ -import { test, expect } from '@playwright/experimental-ct-vue2'; +import { test, expect } from '@okep/experimental-ct-vue2'; import DefaultSlot from '@/components/DefaultSlot.vue'; import NamedSlots from '@/components/NamedSlots.vue'; diff --git a/tests/components/ct-vue2-cli/tests/unmount/unmount.spec.ts b/tests/components/ct-vue2-cli/tests/unmount/unmount.spec.ts index d110f443589f1..6aa31e4871d60 100644 --- a/tests/components/ct-vue2-cli/tests/unmount/unmount.spec.ts +++ b/tests/components/ct-vue2-cli/tests/unmount/unmount.spec.ts @@ -1,4 +1,4 @@ -import { test, expect } from '@playwright/experimental-ct-vue2'; +import { test, expect } from '@okep/experimental-ct-vue2'; import Button from '@/components/Button.vue'; test('unmount', async ({ page, mount }) => { diff --git a/tests/components/ct-vue2-cli/tests/update/update.spec.ts b/tests/components/ct-vue2-cli/tests/update/update.spec.ts index 0c45587b8f693..136619815aceb 100644 --- a/tests/components/ct-vue2-cli/tests/update/update.spec.ts +++ b/tests/components/ct-vue2-cli/tests/update/update.spec.ts @@ -1,4 +1,4 @@ -import { test, expect } from '@playwright/experimental-ct-vue2'; +import { test, expect } from '@okep/experimental-ct-vue2'; import Counter from '@/components/Counter.vue'; test('update props without remounting', async ({ mount }) => { diff --git a/tests/components/ct-vue2-cli/tests/vue-router/vue-router.spec.ts b/tests/components/ct-vue2-cli/tests/vue-router/vue-router.spec.ts index 53615f8f01257..8f32a050a9d0a 100644 --- a/tests/components/ct-vue2-cli/tests/vue-router/vue-router.spec.ts +++ b/tests/components/ct-vue2-cli/tests/vue-router/vue-router.spec.ts @@ -1,4 +1,4 @@ -import { test, expect } from '@playwright/experimental-ct-vue2'; +import { test, expect } from '@okep/experimental-ct-vue2'; import App from '@/App.vue'; test('navigate to a page by clicking a link', async ({ page, mount }) => { diff --git a/tests/config/baseTest.ts b/tests/config/baseTest.ts index f35c594ecea24..8eb54875cf3ac 100644 --- a/tests/config/baseTest.ts +++ b/tests/config/baseTest.ts @@ -14,8 +14,8 @@ * limitations under the License. */ -import { mergeTests } from '@pw-recorder/test'; -import { test } from '@pw-recorder/test'; +import { mergeTests } from '@okep/test'; +import { test } from '@okep/test'; import type { CommonFixtures, CommonWorkerFixtures } from './commonFixtures'; import { commonFixtures } from './commonFixtures'; import type { ServerFixtures, ServerWorkerOptions } from './serverFixtures'; diff --git a/tests/config/browserTest.ts b/tests/config/browserTest.ts index ce865cfa51a55..514627b801e62 100644 --- a/tests/config/browserTest.ts +++ b/tests/config/browserTest.ts @@ -25,7 +25,7 @@ import { type RemoteServerOptions, type PlaywrightServer, RunServer, RemoteServe import type { Log } from '../../packages/trace/src/har'; import { parseHar } from '../config/utils'; import { createSkipTestPredicate } from '../bidi/expectationUtil'; -import type { TestInfo } from '@pw-recorder/test'; +import type { TestInfo } from '@okep/test'; export type BrowserTestWorkerFixtures = PageWorkerFixtures & { browserVersion: string; @@ -197,4 +197,4 @@ export const playwrightTest = test; export const browserTest = test; export const contextTest = test; -export { expect } from '@pw-recorder/test'; +export { expect } from '@okep/test'; diff --git a/tests/config/commonFixtures.ts b/tests/config/commonFixtures.ts index de8f77f0fba2e..ded6fbc4443fb 100644 --- a/tests/config/commonFixtures.ts +++ b/tests/config/commonFixtures.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import type { Fixtures } from '@pw-recorder/test'; +import type { Fixtures } from '@okep/test'; import type { ChildProcess } from 'child_process'; import { execSync, spawn } from 'child_process'; import net from 'net'; diff --git a/tests/config/platformFixtures.ts b/tests/config/platformFixtures.ts index cba4e8f01dd1d..b026315352cc2 100644 --- a/tests/config/platformFixtures.ts +++ b/tests/config/platformFixtures.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import { test } from '@pw-recorder/test'; +import { test } from '@okep/test'; import os from 'os'; export type PlatformWorkerFixtures = { diff --git a/tests/config/serverFixtures.ts b/tests/config/serverFixtures.ts index 3e63efed80308..3dd67e9c7cbac 100644 --- a/tests/config/serverFixtures.ts +++ b/tests/config/serverFixtures.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import type { Fixtures } from '@pw-recorder/test'; +import type { Fixtures } from '@okep/test'; import path from 'path'; import { TestServer } from './testserver'; import { TestProxy } from './proxy'; diff --git a/tests/config/testModeFixtures.ts b/tests/config/testModeFixtures.ts index bd72f505e0655..0ed08257cc393 100644 --- a/tests/config/testModeFixtures.ts +++ b/tests/config/testModeFixtures.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import { test } from '@pw-recorder/test'; +import { test } from '@okep/test'; import type { TestModeName } from './testMode'; import { DefaultTestMode, DriverTestMode } from './testMode'; import * as playwrightLibrary from 'pw-recorder-core'; @@ -30,7 +30,7 @@ export type TestModeTestFixtures = { export type TestModeWorkerFixtures = { toImplInWorkerScope: (rpcObject?: any) => any; - playwright: typeof import('@pw-recorder/test'); + playwright: typeof import('@okep/test'); }; export const testModeTest = test.extend({ diff --git a/tests/config/traceViewerFixtures.ts b/tests/config/traceViewerFixtures.ts index f9927a24d7ae0..edf7982b99d45 100644 --- a/tests/config/traceViewerFixtures.ts +++ b/tests/config/traceViewerFixtures.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import type { Fixtures, FrameLocator, Locator, Page, Browser, BrowserContext } from '@pw-recorder/test'; +import type { Fixtures, FrameLocator, Locator, Page, Browser, BrowserContext } from '@okep/test'; import { step } from './baseTest'; import { runTraceViewerApp } from '../../packages/pw-recorder-core/lib/server'; @@ -26,7 +26,7 @@ type BaseWorkerFixtures = { headless: boolean; browser: Browser; browserName: 'chromium' | 'firefox' | 'webkit'; - playwright: typeof import('@pw-recorder/test'); + playwright: typeof import('@okep/test'); }; export type TraceViewerFixtures = { diff --git a/tests/config/utils.ts b/tests/config/utils.ts index 1a82c490b662b..dbc8f456da013 100644 --- a/tests/config/utils.ts +++ b/tests/config/utils.ts @@ -45,7 +45,7 @@ export async function detachFrame(page: Page, frameId: string) { export async function verifyViewport(page: Page, width: number, height: number) { // `expect` may clash in test runner tests if imported eagerly. - const { expect } = require('@pw-recorder/test'); + const { expect } = require('@okep/test'); expect(page.viewportSize()!.width).toBe(width); expect(page.viewportSize()!.height).toBe(height); expect(await page.evaluate('window.innerWidth')).toBe(width); diff --git a/tests/electron/electronTest.ts b/tests/electron/electronTest.ts index 136a3de6cdc10..42e7f3f2ab3a5 100644 --- a/tests/electron/electronTest.ts +++ b/tests/electron/electronTest.ts @@ -16,11 +16,11 @@ import { baseTest } from '../config/baseTest'; import * as path from 'path'; -import type { ElectronApplication, Page, Electron } from '@pw-recorder/test'; +import type { ElectronApplication, Page, Electron } from '@okep/test'; import type { PageTestFixtures, PageWorkerFixtures } from '../page/pageTestApi'; import type { TraceViewerFixtures } from '../config/traceViewerFixtures'; import { traceViewerFixtures } from '../config/traceViewerFixtures'; -export { expect } from '@pw-recorder/test'; +export { expect } from '@okep/test'; type ElectronTestFixtures = PageTestFixtures & { electronApp: ElectronApplication; diff --git a/tests/electron/playwright.config.ts b/tests/electron/playwright.config.ts index cecd362daa56c..b0f02bbbd5a3d 100644 --- a/tests/electron/playwright.config.ts +++ b/tests/electron/playwright.config.ts @@ -17,7 +17,7 @@ import { config as loadEnv } from 'dotenv'; loadEnv({ path: path.join(__dirname, '..', '..', '.env') }); -import type { Config, PlaywrightTestOptions, PlaywrightWorkerOptions } from '@pw-recorder/test'; +import type { Config, PlaywrightTestOptions, PlaywrightWorkerOptions } from '@okep/test'; import * as path from 'path'; process.env.PWPAGE_IMPL = 'electron'; diff --git a/tests/installation/fixture-scripts/playwright-test-plugin-types.ts b/tests/installation/fixture-scripts/playwright-test-plugin-types.ts index 89c9eae0d7c7a..884da3511677b 100644 --- a/tests/installation/fixture-scripts/playwright-test-plugin-types.ts +++ b/tests/installation/fixture-scripts/playwright-test-plugin-types.ts @@ -1,5 +1,5 @@ -import { test as test1, expect as expect1, mergeTests, mergeExpects } from '@playwright/test'; -import type { Page } from '@playwright/test'; +import { test as test1, expect as expect1, mergeTests, mergeExpects } from '@okep/test'; +import type { Page } from '@okep/test'; import { test as test2, expect as expect2 } from 'pw-recorder-test-plugin'; const test = mergeTests(test1, test2); diff --git a/tests/installation/fixture-scripts/playwright-test-types.ts b/tests/installation/fixture-scripts/playwright-test-types.ts index de1c557802dcb..620569c6c1d8f 100644 --- a/tests/installation/fixture-scripts/playwright-test-types.ts +++ b/tests/installation/fixture-scripts/playwright-test-types.ts @@ -14,8 +14,8 @@ * limitations under the License. */ -import { test, expect } from '@playwright/test'; -import type { Reporter, TestCase } from '@playwright/test/reporter'; +import { test, expect } from '@okep/test'; +import type { Reporter, TestCase } from '@okep/test/reporter'; test.use({ locale: 'en-US' }); diff --git a/tests/installation/fixture-scripts/plugin.spec.ts b/tests/installation/fixture-scripts/plugin.spec.ts index 19f178624e14e..38dfc6032699e 100644 --- a/tests/installation/fixture-scripts/plugin.spec.ts +++ b/tests/installation/fixture-scripts/plugin.spec.ts @@ -1,4 +1,4 @@ -import { test as test1, expect as expect1, mergeTests, mergeExpects } from '@playwright/test'; +import { test as test1, expect as expect1, mergeTests, mergeExpects } from '@okep/test'; import { test as test2, expect as expect2 } from 'pw-recorder-test-plugin'; const test = mergeTests(test1, test2); diff --git a/tests/installation/globalSetup.ts b/tests/installation/globalSetup.ts index 06b3fb410ca4d..af2c484937b8a 100644 --- a/tests/installation/globalSetup.ts +++ b/tests/installation/globalSetup.ts @@ -46,16 +46,16 @@ async function globalSetup() { const builds = await Promise.all([ build('pw-recorder-core'), - build('pw-recorder-test', '@playwright/test'), + build('pw-recorder-test', '@okep/test'), build('pw-recorder'), build('pw-recorder-chromium'), build('pw-recorder-firefox'), build('pw-recorder-webkit'), - build('pw-recorder-browser-chromium', '@playwright/browser-chromium'), - build('pw-recorder-browser-firefox', '@playwright/browser-firefox'), - build('pw-recorder-browser-webkit', '@playwright/browser-webkit'), - build('pw-recorder-ct-react', '@playwright/experimental-ct-react'), - build('pw-recorder-ct-core', '@playwright/experimental-ct-core'), + build('pw-recorder-browser-chromium', '@okep/browser-chromium'), + build('pw-recorder-browser-firefox', '@okep/browser-firefox'), + build('pw-recorder-browser-webkit', '@okep/browser-webkit'), + build('pw-recorder-ct-react', '@okep/experimental-ct-react'), + build('pw-recorder-ct-core', '@okep/experimental-ct-core'), ]); const buildPlaywrightTestPlugin = async () => { diff --git a/tests/installation/npm-installs-local-packages.spec.ts b/tests/installation/npm-installs-local-packages.spec.ts index 66975ff8e59ff..d4e43cae595b1 100755 --- a/tests/installation/npm-installs-local-packages.spec.ts +++ b/tests/installation/npm-installs-local-packages.spec.ts @@ -18,7 +18,7 @@ import { test, expect } from './npmTest'; import fs from 'fs'; test('installs local packages', async ({ registry, exec, tmpWorkspace }) => { - const packages = ['pw-recorder', 'pw-recorder-core', 'pw-recorder-chromium', 'pw-recorder-firefox', 'pw-recorder-webkit', '@playwright/test', '@playwright/browser-chromium', '@playwright/browser-firefox', '@playwright/browser-webkit']; + const packages = ['pw-recorder', 'pw-recorder-core', 'pw-recorder-chromium', 'pw-recorder-firefox', 'pw-recorder-webkit', '@okep/test', '@okep/browser-chromium', '@okep/browser-firefox', '@okep/browser-webkit']; await exec('npm i --foreground-scripts', ...packages, { env: { PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: '1' } }); const output = await exec('node', path.join(__dirname, '..', '..', 'utils', 'workspace.js'), '--get-version'); diff --git a/tests/installation/npmTest.ts b/tests/installation/npmTest.ts index d3c5012abdef0..ddd1113aa1225 100644 --- a/tests/installation/npmTest.ts +++ b/tests/installation/npmTest.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import { _baseTest as _test, expect as _expect } from '@playwright/test'; +import { _baseTest as _test, expect as _expect } from '@okep/test'; import fs from 'fs'; import os from 'os'; import path from 'path'; diff --git a/tests/installation/playwright-cli-install-should-work.spec.ts b/tests/installation/playwright-cli-install-should-work.spec.ts index 1ff8f7a3145ce..e9e8bd9a005ea 100755 --- a/tests/installation/playwright-cli-install-should-work.spec.ts +++ b/tests/installation/playwright-cli-install-should-work.spec.ts @@ -36,12 +36,12 @@ test('install command should work', async ({ exec, installedSoftwareOnDisk }) => await exec('node sanity.js playwright', { env: { PLAYWRIGHT_BROWSERS_PATH: '0' } }); await exec('node sanity.js playwright chromium firefox webkit'); - const packages = ['pw-recorder-chromium', 'pw-recorder-firefox', 'pw-recorder-webkit', '@playwright/browser-chromium', '@playwright/browser-firefox', '@playwright/browser-webkit']; + const packages = ['pw-recorder-chromium', 'pw-recorder-firefox', 'pw-recorder-webkit', '@okep/browser-chromium', '@okep/browser-firefox', '@okep/browser-webkit']; for (const pkg of packages) { await test.step(pkg, async () => { const result = await exec(`npm i ${pkg}`); expect(result).toHaveLoggedSoftwareDownload([]); - if (!pkg.includes('@playwright/browser-')) + if (!pkg.includes('@okep/browser-')) await exec('node sanity.js', pkg, 'chromium firefox webkit'); }); } @@ -81,13 +81,13 @@ test('should print the right install command without browsers', async ({ exec }) test('subsequent installs works', async ({ exec }) => { test.info().annotations.push({ type: 'issue', description: 'https://github.com/microsoft/playwright/issues/1651' }); - await exec('npm i @playwright/browser-chromium'); + await exec('npm i @okep/browser-chromium'); // Note: the `npm install` would not actually crash, the error // is merely logged to the console. To reproduce the error, we should make // sure that script's install.js can be run subsequently without unhandled promise rejections. // Note: the flag `--unhandled-rejections=strict` will force node to terminate in case // of UnhandledPromiseRejection. - await exec('node --unhandled-rejections=strict', path.join('node_modules', '@playwright', 'browser-chromium', 'install.js')); + await exec('node --unhandled-rejections=strict', path.join('node_modules', '@okep', 'browser-chromium', 'install.js')); }); test('install playwright-chromium should work', async ({ exec, installedSoftwareOnDisk }) => { diff --git a/tests/installation/playwright-cli.spec.ts b/tests/installation/playwright-cli.spec.ts index 939780d7a4775..7fcedd4e9f0cd 100755 --- a/tests/installation/playwright-cli.spec.ts +++ b/tests/installation/playwright-cli.spec.ts @@ -25,7 +25,7 @@ test('cli should work', async ({ exec, tmpWorkspace }) => { const result = await exec('npx playwright codegen', { env: { PWTEST_CLI_IS_UNDER_TEST: '1', - PWTEST_CLI_AUTO_EXIT_WHEN: '@playwright/test', + PWTEST_CLI_AUTO_EXIT_WHEN: '@okep/test', } }); expect(result).toContain(`{ page }`); diff --git a/tests/installation/playwright-component-testing.spec.ts b/tests/installation/playwright-component-testing.spec.ts index 7bee17746752a..94fe0cb05559a 100755 --- a/tests/installation/playwright-component-testing.spec.ts +++ b/tests/installation/playwright-component-testing.spec.ts @@ -18,12 +18,12 @@ import path from 'path'; test.slow(); -test('pnpm: @playwright/experimental-ct-react should work', async ({ exec, tmpWorkspace, writeFiles }) => { - await exec('pnpm add @playwright/experimental-ct-react react react-dom'); +test('pnpm: @okep/experimental-ct-react should work', async ({ exec, tmpWorkspace, writeFiles }) => { + await exec('pnpm add @okep/experimental-ct-react react react-dom'); await exec('pnpm exec playwright install'); await writeFiles({ 'pw-recorder.config.ts': ` - import { defineConfig } from '@playwright/experimental-ct-react'; + import { defineConfig } from '@okep/experimental-ct-react'; export default defineConfig({}); `, 'pw-recorder/index.html': ``, @@ -34,7 +34,7 @@ test('pnpm: @playwright/experimental-ct-react should work', async ({ exec, tmpWo } `, 'example.spec.tsx': ` - import { test, expect } from '@playwright/experimental-ct-react'; + import { test, expect } from '@okep/experimental-ct-react'; import { Button } from './Button'; test('sample test', async ({ page, mount }) => { @@ -52,8 +52,8 @@ test('pnpm: @playwright/experimental-ct-react should work', async ({ exec, tmpWo await exec('node read-json-report.js', path.join(tmpWorkspace, 'report.json'), '--validate-chromium-project-only'); }); -test('pnpm: JSX inside a @playwright/test should work', async ({ exec, tmpWorkspace, writeFiles }) => { - await exec('pnpm add @playwright/test'); +test('pnpm: JSX inside a @okep/test should work', async ({ exec, tmpWorkspace, writeFiles }) => { + await exec('pnpm add @okep/test'); await exec('pnpm exec playwright install'); await writeFiles({ 'Button.tsx': ` @@ -62,7 +62,7 @@ test('pnpm: JSX inside a @playwright/test should work', async ({ exec, tmpWorksp } `, 'example.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; import { Button } from './Button'; test('sample test', async ({ page }) => { @@ -70,6 +70,6 @@ test('pnpm: JSX inside a @playwright/test should work', async ({ exec, tmpWorksp }); `, }); - await exec(`node node_modules/@playwright/test/cli.js test --browser=chromium --reporter=list,json example.spec.ts`, { env: { PLAYWRIGHT_JSON_OUTPUT_NAME: 'report.json' } }); + await exec(`node node_modules/@okep/test/cli.js test --browser=chromium --reporter=list,json example.spec.ts`, { env: { PLAYWRIGHT_JSON_OUTPUT_NAME: 'report.json' } }); await exec('node read-json-report.js', path.join(tmpWorkspace, 'report.json'), '--validate-chromium-project-only'); }); diff --git a/tests/installation/playwright-electron-should-work.spec.ts b/tests/installation/playwright-electron-should-work.spec.ts index 9ebd508d6b97e..6ff6673b90dd7 100755 --- a/tests/installation/playwright-electron-should-work.spec.ts +++ b/tests/installation/playwright-electron-should-work.spec.ts @@ -41,11 +41,11 @@ test('electron should work with special characters in path', async ({ exec, tmpW }); }); -test('should work when wrapped inside @playwright/test and trace is enabled', async ({ exec, tmpWorkspace, writeFiles }) => { - await exec('npm i -D @playwright/test electron@31'); +test('should work when wrapped inside @okep/test and trace is enabled', async ({ exec, tmpWorkspace, writeFiles }) => { + await exec('npm i -D @okep/test electron@31'); await writeFiles({ 'electron-with-tracing.spec.ts': ` - import { test, expect, _electron } from '@playwright/test'; + import { test, expect, _electron } from '@okep/test'; test('should work', async ({ trace }) => { const electronApp = await _electron.launch({ args: [${JSON.stringify(path.join(__dirname, '../electron/electron-window-app.js'))}] }); diff --git a/tests/installation/playwright-packages-install-behavior.spec.ts b/tests/installation/playwright-packages-install-behavior.spec.ts index aa758e2e5a460..64e23753c4c7c 100755 --- a/tests/installation/playwright-packages-install-behavior.spec.ts +++ b/tests/installation/playwright-packages-install-behavior.spec.ts @@ -35,8 +35,8 @@ for (const browser of ['chromium', 'firefox', 'webkit']) { } for (const browser of ['chromium', 'firefox', 'webkit']) { - test(`@playwright/browser-${browser} should work`, async ({ exec, installedSoftwareOnDisk }) => { - const pkg = `@playwright/browser-${browser}`; + test(`@okep/browser-${browser} should work`, async ({ exec, installedSoftwareOnDisk }) => { + const pkg = `@okep/browser-${browser}`; const expectedSoftware = [browser]; if (browser === 'chromium') expectedSoftware.push('ffmpeg'); @@ -60,7 +60,7 @@ test(`pw-recorder-core should work`, async ({ exec, installedSoftwareOnDisk }) = expect(result1).toHaveLoggedSoftwareDownload([]); expect(await installedSoftwareOnDisk()).toEqual([]); const stdio = await exec('npx pw-recorder-core', 'test', '-c', '.', { expectToExitWithError: true }); - expect(stdio).toContain(`Please install @playwright/test package`); + expect(stdio).toContain(`Please install @okep/test package`); }); test(`playwright should work`, async ({ exec, installedSoftwareOnDisk }) => { @@ -76,8 +76,8 @@ test(`playwright should work`, async ({ exec, installedSoftwareOnDisk }) => { await exec('node esm-playwright.mjs'); }); -test('@playwright/test should work', async ({ exec, installedSoftwareOnDisk }) => { - const result1 = await exec('npm i --foreground-scripts @playwright/test'); +test('@okep/test should work', async ({ exec, installedSoftwareOnDisk }) => { + const result1 = await exec('npm i --foreground-scripts @okep/test'); expect(result1).toHaveLoggedSoftwareDownload([]); expect(await installedSoftwareOnDisk()).toEqual([]); @@ -87,7 +87,7 @@ test('@playwright/test should work', async ({ exec, installedSoftwareOnDisk }) = expect(result2).toHaveLoggedSoftwareDownload(['chromium', 'ffmpeg', 'firefox', 'webkit']); expect(await installedSoftwareOnDisk()).toEqual(['chromium', 'ffmpeg', 'firefox', 'webkit']); - await exec('node sanity.js @playwright/test chromium firefox webkit'); + await exec('node sanity.js @okep/test chromium firefox webkit'); await exec('node', 'esm-playwright-test.mjs'); const result3 = await exec('npx playwright test -c . --browser=all --reporter=list sample.spec.js'); diff --git a/tests/installation/playwright-should-work-with-relative-home-path.spec.ts b/tests/installation/playwright-should-work-with-relative-home-path.spec.ts index 3f3f0cf9ec74c..ee289345a537e 100755 --- a/tests/installation/playwright-should-work-with-relative-home-path.spec.ts +++ b/tests/installation/playwright-should-work-with-relative-home-path.spec.ts @@ -20,7 +20,7 @@ test('pw-recorder should work with relative home path', async ({ exec }) => { test.skip(os.platform().startsWith('win')); const env = { PLAYWRIGHT_BROWSERS_PATH: '0', HOME: '.' }; - await exec('npm i playwright @playwright/browser-chromium @playwright/browser-webkit', { env }); + await exec('npm i playwright @okep/browser-chromium @okep/browser-webkit', { env }); // Firefox does not work with relative HOME. await exec('node sanity.js playwright chromium webkit', { env }); }); diff --git a/tests/installation/playwright-test-package-managers.spec.ts b/tests/installation/playwright-test-package-managers.spec.ts index a255f76708372..6df535e24255a 100755 --- a/tests/installation/playwright-test-package-managers.spec.ts +++ b/tests/installation/playwright-test-package-managers.spec.ts @@ -16,62 +16,62 @@ import { test, expect } from './npmTest'; import path from 'path'; -test('npm: @playwright/test should work', async ({ exec, tmpWorkspace }) => { - await exec('npm i @playwright/test'); +test('npm: @okep/test should work', async ({ exec, tmpWorkspace }) => { + await exec('npm i @okep/test'); await exec('npx playwright install'); await exec('npx playwright test -c . --browser=all --reporter=list,json sample.spec.js', { env: { PLAYWRIGHT_JSON_OUTPUT_NAME: 'report.json' } }); await exec('node read-json-report.js', path.join(tmpWorkspace, 'report.json')); - await exec('node sanity.js @playwright/test chromium firefox webkit'); + await exec('node sanity.js @okep/test chromium firefox webkit'); await exec('node', 'esm-playwright-test.mjs'); }); -test('npm: playwright + @playwright/test should work', async ({ exec, tmpWorkspace }) => { +test('npm: playwright + @okep/test should work', async ({ exec, tmpWorkspace }) => { await exec('npm i playwright'); - await exec('npm i @playwright/test'); + await exec('npm i @okep/test'); await exec('npx playwright install'); await exec('npx playwright test -c . --browser=all --reporter=list,json sample.spec.js', { env: { PLAYWRIGHT_JSON_OUTPUT_NAME: 'report.json' } }); await exec('node read-json-report.js', path.join(tmpWorkspace, 'report.json')); - await exec('node sanity.js @playwright/test chromium firefox webkit'); + await exec('node sanity.js @okep/test chromium firefox webkit'); await exec('node', 'esm-playwright-test.mjs'); }); -test('npm: @playwright/test + pw-recorder-core should work', async ({ exec, tmpWorkspace }) => { - await exec('npm i @playwright/test'); +test('npm: @okep/test + pw-recorder-core should work', async ({ exec, tmpWorkspace }) => { + await exec('npm i @okep/test'); await exec('npm i pw-recorder-core'); await exec('npx playwright install'); await exec('npx playwright test -c . --browser=all --reporter=list,json sample.spec.js', { env: { PLAYWRIGHT_JSON_OUTPUT_NAME: 'report.json' } }); await exec('node read-json-report.js', path.join(tmpWorkspace, 'report.json')); - await exec('node sanity.js @playwright/test chromium firefox webkit'); + await exec('node sanity.js @okep/test chromium firefox webkit'); await exec('node', 'esm-playwright-test.mjs'); }); -test('npm: @playwright/test should install pw-recorder-core bin', async ({ exec, tmpWorkspace }) => { - await exec('npm i @playwright/test'); +test('npm: @okep/test should install pw-recorder-core bin', async ({ exec, tmpWorkspace }) => { + await exec('npm i @okep/test'); const result = await exec('npx pw-recorder-core --version'); expect(result).toContain('Version 1.'); }); test('npm: uninstalling ct removes playwright bin', async ({ exec, tmpWorkspace }) => { - await exec('npm i @playwright/test'); - await exec('npm i @playwright/experimental-ct-react'); - await exec('npm uninstall @playwright/experimental-ct-react'); + await exec('npm i @okep/test'); + await exec('npm i @okep/experimental-ct-react'); + await exec('npm uninstall @okep/experimental-ct-react'); await exec('npx playwright test', { expectToExitWithError: true, message: 'command not found' }); }); -test('yarn: @playwright/test should work', async ({ exec, tmpWorkspace }) => { - await exec('yarn add @playwright/test'); +test('yarn: @okep/test should work', async ({ exec, tmpWorkspace }) => { + await exec('yarn add @okep/test'); await exec('yarn playwright install'); await exec('yarn playwright test -c . --browser=all --reporter=list,json sample.spec.js', { env: { PLAYWRIGHT_JSON_OUTPUT_NAME: 'report.json' } }); await exec('node read-json-report.js', path.join(tmpWorkspace, 'report.json')); - await exec('node sanity.js @playwright/test chromium firefox webkit'); + await exec('node sanity.js @okep/test chromium firefox webkit'); await exec('node', 'esm-playwright-test.mjs'); }); -test('pnpm: @playwright/test should work', async ({ exec, tmpWorkspace }) => { - await exec('pnpm add @playwright/test'); +test('pnpm: @okep/test should work', async ({ exec, tmpWorkspace }) => { + await exec('pnpm add @okep/test'); await exec('pnpm exec playwright install'); await exec('pnpm exec playwright test -c . --browser=all --reporter=list,json sample.spec.js', { env: { PLAYWRIGHT_JSON_OUTPUT_NAME: 'report.json' } }); await exec('node read-json-report.js', path.join(tmpWorkspace, 'report.json')); - await exec('node sanity.js @playwright/test chromium firefox webkit'); + await exec('node sanity.js @okep/test chromium firefox webkit'); await exec('node', 'esm-playwright-test.mjs'); }); diff --git a/tests/installation/playwright-test-plugin.spec.ts b/tests/installation/playwright-test-plugin.spec.ts index 5762b49900bb2..dacf11150b01a 100755 --- a/tests/installation/playwright-test-plugin.spec.ts +++ b/tests/installation/playwright-test-plugin.spec.ts @@ -25,15 +25,15 @@ function patchPackageJsonForPreReleaseIfNeeded(tmpWorkspace: string) { // // Workaround per https://stackoverflow.com/questions/71479750/npm-install-pre-release-versions-for-peer-dependency. const pkg = JSON.parse(fs.readFileSync(path.resolve(tmpWorkspace, 'package.json'), 'utf-8')); - if (pkg.dependencies['@playwright/test'].match(/\d+\.\d+-\w+/)) { + if (pkg.dependencies['@okep/test'].match(/\d+\.\d+-\w+/)) { console.log(`Setting overrides in package.json to make pre-release version of peer dependency work.`); - pkg.overrides = { '@playwright/test': '$@playwright/test' }; + pkg.overrides = { '@okep/test': '$@okep/test' }; fs.writeFileSync(path.resolve(tmpWorkspace, 'package.json'), JSON.stringify(pkg, null, 2)); } } -test('npm: @playwright/test plugin should work', async ({ exec, tmpWorkspace }) => { - await exec('npm i @playwright/test'); +test('npm: @okep/test plugin should work', async ({ exec, tmpWorkspace }) => { + await exec('npm i @okep/test'); patchPackageJsonForPreReleaseIfNeeded(tmpWorkspace); await exec('npm i playwright-test-plugin'); await exec('npx playwright install chromium'); @@ -46,8 +46,8 @@ test('npm: @playwright/test plugin should work', async ({ exec, tmpWorkspace }) await exec('npx tsc playwright-test-plugin-types.ts'); }); -test('pnpm: @playwright/test plugin should work', async ({ exec, tmpWorkspace }) => { - await exec('pnpm add @playwright/test'); +test('pnpm: @okep/test plugin should work', async ({ exec, tmpWorkspace }) => { + await exec('pnpm add @okep/test'); patchPackageJsonForPreReleaseIfNeeded(tmpWorkspace); await exec('pnpm add playwright-test-plugin'); await exec('pnpm exec playwright install chromium'); @@ -60,8 +60,8 @@ test('pnpm: @playwright/test plugin should work', async ({ exec, tmpWorkspace }) await exec('pnpm exec tsc playwright-test-plugin-types.ts'); }); -test('yarn: @playwright/test plugin should work', async ({ exec, tmpWorkspace }) => { - await exec('yarn add @playwright/test'); +test('yarn: @okep/test plugin should work', async ({ exec, tmpWorkspace }) => { + await exec('yarn add @okep/test'); patchPackageJsonForPreReleaseIfNeeded(tmpWorkspace); await exec('yarn add playwright-test-plugin'); await exec('yarn playwright install chromium'); diff --git a/tests/installation/playwright-test-plugin/index.ts b/tests/installation/playwright-test-plugin/index.ts index 258a722f9b1a3..7f03486f1383d 100644 --- a/tests/installation/playwright-test-plugin/index.ts +++ b/tests/installation/playwright-test-plugin/index.ts @@ -14,8 +14,8 @@ * limitations under the License. */ -import { test as baseTest, expect as expectBase } from '@playwright/test'; -import type { Page } from '@playwright/test'; +import { test as baseTest, expect as expectBase } from '@okep/test'; +import type { Page } from '@okep/test'; export const test = baseTest.extend<{ plugin: string }>({ plugin: async ({}, use) => { diff --git a/tests/installation/playwright-test-plugin/package.json b/tests/installation/playwright-test-plugin/package.json index 4fac36726e81f..92af8ab23872a 100644 --- a/tests/installation/playwright-test-plugin/package.json +++ b/tests/installation/playwright-test-plugin/package.json @@ -1,5 +1,5 @@ { - "name": "playwright-test-plugin", + "name": "pw-recorder-test-plugin", "version": "1.0.0", "description": "", "main": "index.js", @@ -7,7 +7,7 @@ "test": "echo \"Error: no test specified\" && exit 1" }, "peerDependencies": { - "@playwright/test": "1.x" + "@okep/test": "1.x" }, "keywords": [], "author": "", diff --git a/tests/installation/playwright.config.ts b/tests/installation/playwright.config.ts index 25ca82017b809..8566bda87301a 100644 --- a/tests/installation/playwright.config.ts +++ b/tests/installation/playwright.config.ts @@ -15,8 +15,8 @@ */ import path from 'path'; -import { defineConfig } from '@playwright/test'; -import type { ReporterDescription } from '@playwright/test'; +import { defineConfig } from '@okep/test'; +import type { ReporterDescription } from '@okep/test'; import { config as loadEnv } from 'dotenv'; loadEnv({ path: path.join(__dirname, '..', '..', '.env') }); diff --git a/tests/installation/skip-browser-download.spec.ts b/tests/installation/skip-browser-download.spec.ts index 7cf9cdf602217..79d94a7d0812b 100755 --- a/tests/installation/skip-browser-download.spec.ts +++ b/tests/installation/skip-browser-download.spec.ts @@ -18,7 +18,7 @@ import { test, expect } from './npmTest'; test.use({ isolateBrowsers: true }); test('should skip browser installs', async ({ exec, installedSoftwareOnDisk }) => { - const result = await exec('npm i --foreground-scripts playwright @playwright/browser-firefox', { env: { PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: '1' } }); + const result = await exec('npm i --foreground-scripts playwright @okep/browser-firefox', { env: { PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: '1' } }); expect(result).toHaveLoggedSoftwareDownload([]); expect(await installedSoftwareOnDisk()).toEqual([]); expect(result).toContain(`Skipping browsers download because`); diff --git a/tests/installation/typescript-types.spec.ts b/tests/installation/typescript-types.spec.ts index 24e2eef66be41..c034a0955180d 100755 --- a/tests/installation/typescript-types.spec.ts +++ b/tests/installation/typescript-types.spec.ts @@ -23,7 +23,7 @@ test('typescript types should work', async ({ exec, tsc, writeFiles }) => { 'pw-recorder-webkit', 'pw-recorder-chromium', ]; - await exec('npm i @playwright/test', ...libraryPackages, { env: { PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: '1' } }); + await exec('npm i @okep/test', ...libraryPackages, { env: { PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: '1' } }); for (const libraryPackage of libraryPackages) { const filename = libraryPackage + '.ts'; diff --git a/tests/library/browsercontext-add-cookies.spec.ts b/tests/library/browsercontext-add-cookies.spec.ts index 4d0b4f20e4490..f3b53d15421d7 100644 --- a/tests/library/browsercontext-add-cookies.spec.ts +++ b/tests/library/browsercontext-add-cookies.spec.ts @@ -16,7 +16,7 @@ */ import type { IncomingHttpHeaders } from 'http'; -import type { Cookie } from '@pw-recorder/test'; +import type { Cookie } from '@okep/test'; import { contextTest as it, playwrightTest, expect } from '../config/browserTest'; it('should work @smoke', async ({ context, page, server }) => { diff --git a/tests/library/browsercontext-basic.spec.ts b/tests/library/browsercontext-basic.spec.ts index 282cf721bcc58..a534bae398133 100644 --- a/tests/library/browsercontext-basic.spec.ts +++ b/tests/library/browsercontext-basic.spec.ts @@ -18,7 +18,7 @@ import { kTargetClosedErrorMessage } from '../config/errors'; import { browserTest as it, expect } from '../config/browserTest'; import { attachFrame, verifyViewport } from '../config/utils'; -import type { Page } from '@pw-recorder/test'; +import type { Page } from '@okep/test'; it('should create new context @smoke', async function({ browser }) { expect(browser.contexts().length).toBe(0); diff --git a/tests/library/browsercontext-expose-function.spec.ts b/tests/library/browsercontext-expose-function.spec.ts index 43be94276ecbd..68508d2e75261 100644 --- a/tests/library/browsercontext-expose-function.spec.ts +++ b/tests/library/browsercontext-expose-function.spec.ts @@ -16,7 +16,7 @@ */ import { contextTest as it, expect } from '../config/browserTest'; -import type { JSHandle } from '@pw-recorder/test'; +import type { JSHandle } from '@okep/test'; it('expose binding should work', async ({ context }) => { let bindingSource: any; diff --git a/tests/library/browsercontext-network-event.spec.ts b/tests/library/browsercontext-network-event.spec.ts index 764de78724b1a..a9492e3888bed 100644 --- a/tests/library/browsercontext-network-event.spec.ts +++ b/tests/library/browsercontext-network-event.spec.ts @@ -16,7 +16,7 @@ */ import { browserTest as it, expect } from '../config/browserTest'; -import type { Request, Response } from '@pw-recorder/test'; +import type { Request, Response } from '@okep/test'; it('BrowserContext.Events.Request', async ({ context, server }) => { const page = await context.newPage(); diff --git a/tests/library/browsercontext-reuse.spec.ts b/tests/library/browsercontext-reuse.spec.ts index ce7c69ccb21a5..0c86655dbe858 100644 --- a/tests/library/browsercontext-reuse.spec.ts +++ b/tests/library/browsercontext-reuse.spec.ts @@ -15,7 +15,7 @@ */ import { browserTest, expect } from '../config/browserTest'; -import type { BrowserContext } from '@pw-recorder/test'; +import type { BrowserContext } from '@okep/test'; const test = browserTest.extend<{ reusedContext: () => Promise }>({ reusedContext: async ({ browserType, browser }, use) => { diff --git a/tests/library/browsercontext-route.spec.ts b/tests/library/browsercontext-route.spec.ts index 434a193245a5e..26a829703036c 100644 --- a/tests/library/browsercontext-route.spec.ts +++ b/tests/library/browsercontext-route.spec.ts @@ -16,7 +16,7 @@ */ import { browserTest as it, expect } from '../config/browserTest'; -import type { Route } from '@pw-recorder/test'; +import type { Route } from '@okep/test'; it('should intercept', async ({ browser, server }) => { const context = await browser.newContext(); diff --git a/tests/library/browsercontext-viewport.spec.ts b/tests/library/browsercontext-viewport.spec.ts index ea379dad47d7f..312579b3f8bc2 100644 --- a/tests/library/browsercontext-viewport.spec.ts +++ b/tests/library/browsercontext-viewport.spec.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import { devices } from '@pw-recorder/test'; +import { devices } from '@okep/test'; import { contextTest as it, expect } from '../config/browserTest'; import { browserTest } from '../config/browserTest'; import { verifyViewport } from '../config/utils'; diff --git a/tests/library/browsertype-launch-selenium.spec.ts b/tests/library/browsertype-launch-selenium.spec.ts index c7ac4257e0ed3..ead10e2572946 100644 --- a/tests/library/browsertype-launch-selenium.spec.ts +++ b/tests/library/browsertype-launch-selenium.spec.ts @@ -15,7 +15,7 @@ */ import { playwrightTest as test, expect } from '../config/browserTest'; -import type { TestInfo } from '@pw-recorder/test'; +import type { TestInfo } from '@okep/test'; import path from 'path'; import fs from 'fs'; import { start } from '../../packages/pw-recorder-core/lib/outofprocess'; diff --git a/tests/library/browsertype-launch.spec.ts b/tests/library/browsertype-launch.spec.ts index 85070ad920d14..bc8013edab7c6 100644 --- a/tests/library/browsertype-launch.spec.ts +++ b/tests/library/browsertype-launch.spec.ts @@ -16,7 +16,7 @@ */ import { playwrightTest as it, expect } from '../config/browserTest'; -import type { Browser, BrowserContext, Page } from '@pw-recorder/test'; +import type { Browser, BrowserContext, Page } from '@okep/test'; import { kTargetClosedErrorMessage } from '../config/errors'; it('should reject all promises when browser is closed', async ({ browserType }) => { diff --git a/tests/library/chromium/oopif.spec.ts b/tests/library/chromium/oopif.spec.ts index cf9d1c03b86a0..55f00b18bd318 100644 --- a/tests/library/chromium/oopif.spec.ts +++ b/tests/library/chromium/oopif.spec.ts @@ -15,7 +15,7 @@ */ import { contextTest as it, expect } from '../../config/browserTest'; -import type { Frame, Browser } from '@pw-recorder/test'; +import type { Frame, Browser } from '@okep/test'; it.use({ launchOptions: async ({ launchOptions }, use) => { diff --git a/tests/library/clock.spec.ts b/tests/library/clock.spec.ts index 88ae5f858f6e6..36b13474e11f1 100644 --- a/tests/library/clock.spec.ts +++ b/tests/library/clock.spec.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import { test, expect } from '@pw-recorder/test'; +import { test, expect } from '@okep/test'; import { createClock as rawCreateClock, install as rawInstall } from '../../packages/pw-recorder-core/src/server/injected/clock'; import type { InstallConfig, ClockController, ClockMethods } from '../../packages/pw-recorder-core/src/server/injected/clock'; diff --git a/tests/library/debug-controller.spec.ts b/tests/library/debug-controller.spec.ts index cc048bd238959..b8815542d1d69 100644 --- a/tests/library/debug-controller.spec.ts +++ b/tests/library/debug-controller.spec.ts @@ -18,7 +18,7 @@ import { expect, playwrightTest as baseTest } from '../config/browserTest'; import { PlaywrightServer } from '../../packages/pw-recorder-core/lib/remote/playwrightServer'; import { createGuid } from '../../packages/pw-recorder-core/lib/utils/crypto'; import { Backend } from '../config/debugControllerBackend'; -import type { Browser, BrowserContext } from '@pw-recorder/test'; +import type { Browser, BrowserContext } from '@okep/test'; import type * as channels from '@protocol/channels'; type BrowserWithReuse = Browser & { _newContextForReuse: () => Promise }; @@ -173,7 +173,7 @@ test('should record', async ({ backend, connectedBrowser }) => { await page.getByRole('button').click(); await expect.poll(() => events[events.length - 1]).toEqual({ - header: `import { test, expect } from '@pw-recorder/test'; + header: `import { test, expect } from '@okep/test'; test('test', async ({ page }) => {`, footer: `});`, @@ -181,7 +181,7 @@ test('test', async ({ page }) => {`, ` await page.goto('about:blank');`, ` await page.getByRole('button', { name: 'Submit' }).click();`, ], - text: `import { test, expect } from '@pw-recorder/test'; + text: `import { test, expect } from '@okep/test'; test('test', async ({ page }) => { await page.goto('about:blank'); @@ -215,14 +215,14 @@ test('should record custom data-testid', async ({ backend, connectedBrowser }) = // 4. Expect "getByTestId" locator. await expect.poll(() => events[events.length - 1]).toEqual({ - header: `import { test, expect } from '@pw-recorder/test'; + header: `import { test, expect } from '@okep/test'; test('test', async ({ page }) => {`, footer: `});`, actions: [ ` await page.getByTestId('one').click();`, ], - text: `import { test, expect } from '@pw-recorder/test'; + text: `import { test, expect } from '@okep/test'; test('test', async ({ page }) => { await page.getByTestId('one').click(); diff --git a/tests/library/events/add-listeners.spec.ts b/tests/library/events/add-listeners.spec.ts index b07e53e506e7f..c9f7b3368711c 100644 --- a/tests/library/events/add-listeners.spec.ts +++ b/tests/library/events/add-listeners.spec.ts @@ -21,7 +21,7 @@ // USE OR OTHER DEALINGS IN THE SOFTWARE. import { EventEmitter } from '../../../packages/pw-recorder-core/lib/client/eventEmitter'; -import { test, expect } from '@pw-recorder/test'; +import { test, expect } from '@okep/test'; test.describe('EventEmitter tests', () => { test('should work', () => { diff --git a/tests/library/events/check-listener-leaks.spec.ts b/tests/library/events/check-listener-leaks.spec.ts index c4c44b362b48c..78e23d8dde04e 100644 --- a/tests/library/events/check-listener-leaks.spec.ts +++ b/tests/library/events/check-listener-leaks.spec.ts @@ -23,7 +23,7 @@ import events from 'events'; import { EventEmitter } from '../../../packages/pw-recorder-core/lib/client/eventEmitter'; import { setUnderTest } from '../../../packages/pw-recorder-core/lib/utils/debug'; -import { test, expect } from '@pw-recorder/test'; +import { test, expect } from '@okep/test'; import * as common from './utils'; setUnderTest(); diff --git a/tests/library/events/events-list.spec.ts b/tests/library/events/events-list.spec.ts index 2e5462e7f5f75..a825a0799efdc 100644 --- a/tests/library/events/events-list.spec.ts +++ b/tests/library/events/events-list.spec.ts @@ -21,7 +21,7 @@ // USE OR OTHER DEALINGS IN THE SOFTWARE. import { EventEmitter } from '../../../packages/pw-recorder-core/lib/client/eventEmitter'; -import { test, expect } from '@pw-recorder/test'; +import { test, expect } from '@okep/test'; test.describe('EventEmitter', () => { test('should maintain event names correctly', () => { diff --git a/tests/library/events/listener-count.spec.ts b/tests/library/events/listener-count.spec.ts index 131e8847f469e..6aae53015b925 100644 --- a/tests/library/events/listener-count.spec.ts +++ b/tests/library/events/listener-count.spec.ts @@ -21,7 +21,7 @@ // USE OR OTHER DEALINGS IN THE SOFTWARE. import { EventEmitter } from '../../../packages/pw-recorder-core/lib/client/eventEmitter'; -import { test, expect } from '@pw-recorder/test'; +import { test, expect } from '@okep/test'; test('Listener count test', () => { const emitter = new EventEmitter(); diff --git a/tests/library/events/listeners-side-effects.spec.ts b/tests/library/events/listeners-side-effects.spec.ts index 7341fac196c32..b84cf9c60f437 100644 --- a/tests/library/events/listeners-side-effects.spec.ts +++ b/tests/library/events/listeners-side-effects.spec.ts @@ -20,7 +20,7 @@ // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. -import { test, expect } from '@pw-recorder/test'; +import { test, expect } from '@okep/test'; import { EventEmitter } from '../../../packages/pw-recorder-core/lib/client/eventEmitter'; test('listeners empty check', () => { diff --git a/tests/library/events/listeners.spec.ts b/tests/library/events/listeners.spec.ts index 38d85c6cf6e54..7ca33031c98a5 100644 --- a/tests/library/events/listeners.spec.ts +++ b/tests/library/events/listeners.spec.ts @@ -21,7 +21,7 @@ // USE OR OTHER DEALINGS IN THE SOFTWARE. import { EventEmitter } from '../../../packages/pw-recorder-core/lib/client/eventEmitter'; -import { test, expect } from '@pw-recorder/test'; +import { test, expect } from '@okep/test'; const listener = () => {}; const listener2 = () => {}; diff --git a/tests/library/events/max-listeners.spec.ts b/tests/library/events/max-listeners.spec.ts index f01b9abd61229..feea3048a544f 100644 --- a/tests/library/events/max-listeners.spec.ts +++ b/tests/library/events/max-listeners.spec.ts @@ -21,7 +21,7 @@ // USE OR OTHER DEALINGS IN THE SOFTWARE. import { EventEmitter } from '../../../packages/pw-recorder-core/lib/client/eventEmitter'; -import { test, expect } from '@pw-recorder/test'; +import { test, expect } from '@okep/test'; test('emit maxListeners on e', () => { const e = new EventEmitter(); diff --git a/tests/library/events/method-names.spec.ts b/tests/library/events/method-names.spec.ts index 00e9d982bd902..a9c57f560ddb0 100644 --- a/tests/library/events/method-names.spec.ts +++ b/tests/library/events/method-names.spec.ts @@ -21,7 +21,7 @@ // USE OR OTHER DEALINGS IN THE SOFTWARE. import { EventEmitter } from '../../../packages/pw-recorder-core/lib/client/eventEmitter'; -import { test, expect } from '@pw-recorder/test'; +import { test, expect } from '@okep/test'; test('EventEmitter prototype test', () => { const ee = new EventEmitter(); diff --git a/tests/library/events/modify-in-emit.spec.ts b/tests/library/events/modify-in-emit.spec.ts index ec5f706e7ea4c..cd745a05bf222 100644 --- a/tests/library/events/modify-in-emit.spec.ts +++ b/tests/library/events/modify-in-emit.spec.ts @@ -20,7 +20,7 @@ // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. -import { test, expect } from '@pw-recorder/test'; +import { test, expect } from '@okep/test'; import { EventEmitter } from '../../../packages/pw-recorder-core/lib/client/eventEmitter'; let callbacks_called = []; diff --git a/tests/library/events/num-args.spec.ts b/tests/library/events/num-args.spec.ts index 3d46b05ab0e86..1807fe8bebec7 100644 --- a/tests/library/events/num-args.spec.ts +++ b/tests/library/events/num-args.spec.ts @@ -21,7 +21,7 @@ // USE OR OTHER DEALINGS IN THE SOFTWARE. import { EventEmitter } from '../../../packages/pw-recorder-core/lib/client/eventEmitter'; -import { test, expect } from '@pw-recorder/test'; +import { test, expect } from '@okep/test'; test('should work', () => { const e = new EventEmitter(); diff --git a/tests/library/events/once.spec.ts b/tests/library/events/once.spec.ts index c9f1ff84dcaeb..281354ba4a127 100644 --- a/tests/library/events/once.spec.ts +++ b/tests/library/events/once.spec.ts @@ -20,7 +20,7 @@ // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. -import { test, expect } from '@pw-recorder/test'; +import { test, expect } from '@okep/test'; import { EventEmitter } from '../../../packages/pw-recorder-core/lib/client/eventEmitter'; import * as common from './utils'; diff --git a/tests/library/events/prepend.spec.ts b/tests/library/events/prepend.spec.ts index b69b39a38318d..fef07d8417dac 100644 --- a/tests/library/events/prepend.spec.ts +++ b/tests/library/events/prepend.spec.ts @@ -21,7 +21,7 @@ // USE OR OTHER DEALINGS IN THE SOFTWARE. import { EventEmitter } from '../../../packages/pw-recorder-core/lib/client/eventEmitter'; -import { test, expect } from '@pw-recorder/test'; +import { test, expect } from '@okep/test'; test('EventEmitter functionality', () => { const myEE = new EventEmitter(); diff --git a/tests/library/events/remove-all-listeners-wait.spec.ts b/tests/library/events/remove-all-listeners-wait.spec.ts index 245951adb4469..a86ab88f890fb 100644 --- a/tests/library/events/remove-all-listeners-wait.spec.ts +++ b/tests/library/events/remove-all-listeners-wait.spec.ts @@ -17,7 +17,7 @@ import { ManualPromise } from '../../../packages/pw-recorder-core/lib/utils/manualPromise'; import { EventEmitter } from '../../../packages/pw-recorder-core/lib/client/eventEmitter'; -import { test, expect } from '@pw-recorder/test'; +import { test, expect } from '@okep/test'; test('should not throw with ignoreErrors', async () => { const ee = new EventEmitter(); diff --git a/tests/library/events/remove-all-listeners.spec.ts b/tests/library/events/remove-all-listeners.spec.ts index 53d3c53478679..91a10fd2cf98f 100644 --- a/tests/library/events/remove-all-listeners.spec.ts +++ b/tests/library/events/remove-all-listeners.spec.ts @@ -21,7 +21,7 @@ // USE OR OTHER DEALINGS IN THE SOFTWARE. import { EventEmitter } from '../../../packages/pw-recorder-core/lib/client/eventEmitter'; -import { test, expect } from '@pw-recorder/test'; +import { test, expect } from '@okep/test'; import * as common from './utils'; let wrappers: any[]; diff --git a/tests/library/events/remove-listeners.spec.ts b/tests/library/events/remove-listeners.spec.ts index 4be432bb42e4a..3e7a3fae20bfd 100644 --- a/tests/library/events/remove-listeners.spec.ts +++ b/tests/library/events/remove-listeners.spec.ts @@ -21,7 +21,7 @@ // USE OR OTHER DEALINGS IN THE SOFTWARE. import { EventEmitter } from '../../../packages/pw-recorder-core/lib/client/eventEmitter'; -import { test, expect } from '@pw-recorder/test'; +import { test, expect } from '@okep/test'; import * as common from './utils'; const listener1 = () => {}; diff --git a/tests/library/events/set-max-listeners-side-effects.spec.ts b/tests/library/events/set-max-listeners-side-effects.spec.ts index 9e5010f5dca6c..f2d9dc52b1c1d 100644 --- a/tests/library/events/set-max-listeners-side-effects.spec.ts +++ b/tests/library/events/set-max-listeners-side-effects.spec.ts @@ -21,7 +21,7 @@ // USE OR OTHER DEALINGS IN THE SOFTWARE. import { EventEmitter } from '../../../packages/pw-recorder-core/lib/client/eventEmitter'; -import { test, expect } from '@pw-recorder/test'; +import { test, expect } from '@okep/test'; test('set max listeners test', () => { const e = new EventEmitter(); diff --git a/tests/library/events/special-event-names.spec.ts b/tests/library/events/special-event-names.spec.ts index 3df7bdee92a4d..5aa93e54d2d7a 100644 --- a/tests/library/events/special-event-names.spec.ts +++ b/tests/library/events/special-event-names.spec.ts @@ -20,7 +20,7 @@ // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. -import { test, expect } from '@pw-recorder/test'; +import { test, expect } from '@okep/test'; import { EventEmitter } from '../../../packages/pw-recorder-core/lib/client/eventEmitter'; diff --git a/tests/library/events/subclass.spec.ts b/tests/library/events/subclass.spec.ts index 2f33ba141fe46..2c9829b41fa42 100644 --- a/tests/library/events/subclass.spec.ts +++ b/tests/library/events/subclass.spec.ts @@ -21,7 +21,7 @@ // USE OR OTHER DEALINGS IN THE SOFTWARE. import { EventEmitter } from '../../../packages/pw-recorder-core/lib/client/eventEmitter'; -import { test, expect } from '@pw-recorder/test'; +import { test, expect } from '@okep/test'; class MyEE extends EventEmitter { constructor(cb) { diff --git a/tests/library/events/symbols.spec.ts b/tests/library/events/symbols.spec.ts index a20def242fc0f..8358e2f9a95ff 100644 --- a/tests/library/events/symbols.spec.ts +++ b/tests/library/events/symbols.spec.ts @@ -21,7 +21,7 @@ // USE OR OTHER DEALINGS IN THE SOFTWARE. import { EventEmitter } from '../../../packages/pw-recorder-core/lib/client/eventEmitter'; -import { test, expect } from '@pw-recorder/test'; +import { test, expect } from '@okep/test'; test('should support symbols', () => { const ee = new EventEmitter(); diff --git a/tests/library/events/utils.ts b/tests/library/events/utils.ts index 18f23fd194acd..ed6dc035fc27b 100644 --- a/tests/library/events/utils.ts +++ b/tests/library/events/utils.ts @@ -19,7 +19,7 @@ // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. -import { expect } from '@pw-recorder/test'; +import { expect } from '@okep/test'; export const mustNotCall = (msg?: string) => { return function mustNotCall() { diff --git a/tests/library/inspector/cli-codegen-2.spec.ts b/tests/library/inspector/cli-codegen-2.spec.ts index 8a35096848050..f9bc7a7c10a66 100644 --- a/tests/library/inspector/cli-codegen-2.spec.ts +++ b/tests/library/inspector/cli-codegen-2.spec.ts @@ -485,7 +485,7 @@ await page1.GotoAsync("about:blank?foo");`); const storageFileName = testInfo.outputPath('auth.json'); const harFileName = testInfo.outputPath('har.har'); const cli = runCLI([`--save-trace=${traceFileName}`, `--save-storage=${storageFileName}`, `--save-har=${harFileName}`]); - await cli.waitFor(`import { test, expect } from '@pw-recorder/test'`); + await cli.waitFor(`import { test, expect } from '@okep/test'`); await cli.process.kill('SIGINT'); const { exitCode } = await cli.process.exited; expect(exitCode).toBe(130); diff --git a/tests/library/inspector/cli-codegen-3.spec.ts b/tests/library/inspector/cli-codegen-3.spec.ts index c10139d364696..b4b55611ee3fe 100644 --- a/tests/library/inspector/cli-codegen-3.spec.ts +++ b/tests/library/inspector/cli-codegen-3.spec.ts @@ -17,7 +17,7 @@ import type { TestServer } from 'tests/config/testserver'; import type { Recorder } from './inspectorTest'; import { test, expect } from './inspectorTest'; -import type { Page } from '@pw-recorder/test'; +import type { Page } from '@okep/test'; test.describe('cli codegen', () => { test.skip(({ mode }) => mode !== 'default'); diff --git a/tests/library/inspector/cli-codegen-test.spec.ts b/tests/library/inspector/cli-codegen-test.spec.ts index c01faf96a1ade..b6235c7e0cdaa 100644 --- a/tests/library/inspector/cli-codegen-test.spec.ts +++ b/tests/library/inspector/cli-codegen-test.spec.ts @@ -22,7 +22,7 @@ const emptyHTML = new URL('file://' + path.join(__dirname, '..', '..', 'assets', test('should print the correct imports and context options', async ({ runCLI }) => { const cli = runCLI([emptyHTML]); - const expectedResult = `import { test, expect } from '@pw-recorder/test'; + const expectedResult = `import { test, expect } from '@okep/test'; test('test', async ({ page }) => { });`; @@ -31,7 +31,7 @@ test('test', async ({ page }) => { test('should print the correct context options for custom settings', async ({ browserName, channel, runCLI }) => { const cli = runCLI(['--color-scheme=light', emptyHTML]); - const expectedResult = `import { test, expect } from '@pw-recorder/test'; + const expectedResult = `import { test, expect } from '@okep/test'; test.use({ colorScheme: 'light' @@ -46,7 +46,7 @@ test('should print the correct context options when using a device', async ({ br test.skip(browserName !== 'chromium'); const cli = runCLI(['--device=Pixel 2', emptyHTML]); - const expectedResult = `import { test, expect, devices } from '@pw-recorder/test'; + const expectedResult = `import { test, expect, devices } from '@okep/test'; test.use({ ...devices['Pixel 2'], @@ -60,7 +60,7 @@ test('should print the correct context options when using a device and additiona test.skip(browserName !== 'webkit'); const cli = runCLI(['--color-scheme=light', '--device=iPhone 11', emptyHTML]); - const expectedResult = `import { test, expect, devices } from '@pw-recorder/test'; + const expectedResult = `import { test, expect, devices } from '@okep/test'; test.use({ ...devices['iPhone 11'], @@ -75,7 +75,7 @@ test('should print load storageState', async ({ browserName, channel, runCLI }, const loadFileName = testInfo.outputPath('load.json'); await fs.promises.writeFile(loadFileName, JSON.stringify({ cookies: [], origins: [] }), 'utf8'); const cli = runCLI([`--load-storage=${loadFileName}`, emptyHTML]); - const expectedResult = `import { test, expect } from '@pw-recorder/test'; + const expectedResult = `import { test, expect } from '@okep/test'; test.use({ storageState: '${loadFileName.replace(/\\/g, '\\\\')}' diff --git a/tests/library/inspector/inspectorTest.ts b/tests/library/inspector/inspectorTest.ts index c46c8d457577a..6ff736500ab28 100644 --- a/tests/library/inspector/inspectorTest.ts +++ b/tests/library/inspector/inspectorTest.ts @@ -21,8 +21,8 @@ import * as path from 'path'; import type { Source } from '../../../packages/recorder/src/recorderTypes'; import type { CommonFixtures, TestChildProcess } from '../../config/commonFixtures'; import { stripAnsi } from '../../config/utils'; -import { expect } from '@pw-recorder/test'; -export { expect } from '@pw-recorder/test'; +import { expect } from '@okep/test'; +export { expect } from '@okep/test'; type CLITestArgs = { recorderPageGetter: () => Promise; diff --git a/tests/library/playwright.config.ts b/tests/library/playwright.config.ts index 3e6e75f0f29c7..db579c7686f87 100644 --- a/tests/library/playwright.config.ts +++ b/tests/library/playwright.config.ts @@ -17,7 +17,7 @@ import { config as loadEnv } from 'dotenv'; loadEnv({ path: path.join(__dirname, '..', '..', '.env'), override: true }); -import { type Config, type PlaywrightTestOptions, type PlaywrightWorkerOptions, type ReporterDescription } from '@pw-recorder/test'; +import { type Config, type PlaywrightTestOptions, type PlaywrightWorkerOptions, type ReporterDescription } from '@okep/test'; import * as path from 'path'; import type { TestModeWorkerOptions } from '../config/testModeFixtures'; import type { TestModeName } from '../config/testMode'; diff --git a/tests/library/route-web-socket.spec.ts b/tests/library/route-web-socket.spec.ts index 3b7df7d3dd151..7a84ac0eaa4fc 100644 --- a/tests/library/route-web-socket.spec.ts +++ b/tests/library/route-web-socket.spec.ts @@ -16,7 +16,7 @@ import { attachFrame, detachFrame } from '../config/utils'; import { contextTest as test, expect } from '../config/browserTest'; -import type { Frame, Page, WebSocketRoute } from '@pw-recorder/test'; +import type { Frame, Page, WebSocketRoute } from '@okep/test'; declare global { interface Window { diff --git a/tests/library/selectors-register.spec.ts b/tests/library/selectors-register.spec.ts index d3de26bcda85f..1afa2eb700453 100644 --- a/tests/library/selectors-register.spec.ts +++ b/tests/library/selectors-register.spec.ts @@ -53,11 +53,11 @@ it('should work', async ({ playwright, browser }) => { }); it('should work when registered on global', async ({ browser }) => { - await require('@pw-recorder/test').selectors.register('oop-tag', `(${createTagSelector.toString()})()`); + await require('@okep/test').selectors.register('oop-tag', `(${createTagSelector.toString()})()`); const context = await browser.newContext(); // Register another engine after creating context. - await require('@pw-recorder/test').selectors.register('oop-tag2', `(${createTagSelector.toString()})()`); + await require('@okep/test').selectors.register('oop-tag2', `(${createTagSelector.toString()})()`); const page = await context.newPage(); await page.setContent('
'); diff --git a/tests/library/slowmo.spec.ts b/tests/library/slowmo.spec.ts index b2ed2579b5c02..ec1f7e636d2f9 100644 --- a/tests/library/slowmo.spec.ts +++ b/tests/library/slowmo.spec.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import type { Page, Frame, ElementHandle } from '@pw-recorder/test'; +import type { Page, Frame, ElementHandle } from '@okep/test'; import { contextTest as it, expect } from '../config/browserTest'; import { attachFrame } from '../config/utils'; import type { TestServer } from '../config/testserver'; diff --git a/tests/library/trace-viewer.spec.ts b/tests/library/trace-viewer.spec.ts index a111e05237064..725007e744e1c 100644 --- a/tests/library/trace-viewer.spec.ts +++ b/tests/library/trace-viewer.spec.ts @@ -20,7 +20,7 @@ import fs from 'fs'; import path from 'path'; import { pathToFileURL } from 'url'; import { expect, playwrightTest } from '../config/browserTest'; -import type { FrameLocator } from '@pw-recorder/test'; +import type { FrameLocator } from '@okep/test'; const test = playwrightTest.extend(traceViewerFixtures); diff --git a/tests/library/unroute-behavior.spec.ts b/tests/library/unroute-behavior.spec.ts index 5df1ea4059e9b..16a0dcc7cc211 100644 --- a/tests/library/unroute-behavior.spec.ts +++ b/tests/library/unroute-behavior.spec.ts @@ -15,7 +15,7 @@ */ import { browserTest as it, expect } from '../config/browserTest'; -import type { Route } from '@pw-recorder/test'; +import type { Route } from '@okep/test'; it('context.unroute should not wait for pending handlers to complete', async ({ page, context, server }) => { it.info().annotations.push({ type: 'issue', description: 'https://github.com/microsoft/playwright/issues/23781' }); diff --git a/tests/page/elementhandle-wait-for-element-state.spec.ts b/tests/page/elementhandle-wait-for-element-state.spec.ts index d0b25039eb4d3..185bb1d93d723 100644 --- a/tests/page/elementhandle-wait-for-element-state.spec.ts +++ b/tests/page/elementhandle-wait-for-element-state.spec.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import type { Page } from '@pw-recorder/test'; +import type { Page } from '@okep/test'; import { test as it, expect, rafraf } from './pageTest'; const giveItAChanceToResolve = (page: Page) => rafraf(page, 5); diff --git a/tests/page/page-click.spec.ts b/tests/page/page-click.spec.ts index d3d72a0cf482b..fd5fcde26383f 100644 --- a/tests/page/page-click.spec.ts +++ b/tests/page/page-click.spec.ts @@ -17,7 +17,7 @@ import { test as it, expect, rafraf } from './pageTest'; import { attachFrame, detachFrame } from '../config/utils'; -import type { Page } from '@pw-recorder/test'; +import type { Page } from '@okep/test'; const giveItAChanceToClick = (page: Page) => rafraf(page, 5); diff --git a/tests/page/page-fill.spec.ts b/tests/page/page-fill.spec.ts index 2c99f650843ba..ffbaa23386075 100644 --- a/tests/page/page-fill.spec.ts +++ b/tests/page/page-fill.spec.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import type { Page } from '@pw-recorder/test'; +import type { Page } from '@okep/test'; import { test as it, expect, rafraf } from './pageTest'; const giveItAChanceToFill = (page: Page) => rafraf(page, 5); diff --git a/tests/page/page-select-option.spec.ts b/tests/page/page-select-option.spec.ts index fac713e80b55d..a9c04cd834819 100644 --- a/tests/page/page-select-option.spec.ts +++ b/tests/page/page-select-option.spec.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import type { Page } from '@pw-recorder/test'; +import type { Page } from '@okep/test'; import { test as it, expect, rafraf } from './pageTest'; const giveItAChanceToResolve = (page: Page) => rafraf(page, 5); diff --git a/tests/page/page-wait-for-selector-1.spec.ts b/tests/page/page-wait-for-selector-1.spec.ts index c1e1c877b7bab..5ee3816dde730 100644 --- a/tests/page/page-wait-for-selector-1.spec.ts +++ b/tests/page/page-wait-for-selector-1.spec.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import type { Frame } from '@pw-recorder/test'; +import type { Frame } from '@okep/test'; import { test as it, expect, rafraf } from './pageTest'; import { attachFrame, detachFrame } from '../config/utils'; diff --git a/tests/page/pageTest.ts b/tests/page/pageTest.ts index acdf3f97f2501..d89349660fae4 100644 --- a/tests/page/pageTest.ts +++ b/tests/page/pageTest.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import type { Frame, Page, TestType } from '@pw-recorder/test'; +import type { Frame, Page, TestType } from '@okep/test'; import type { PlatformWorkerFixtures } from '../config/platformFixtures'; import type { TestModeTestFixtures, TestModeWorkerFixtures, TestModeWorkerOptions } from '../config/testModeFixtures'; import { androidTest } from '../android/androidTest'; @@ -23,7 +23,7 @@ import { electronTest } from '../electron/electronTest'; import { webView2Test } from '../webview2/webView2Test'; import type { PageTestFixtures, PageWorkerFixtures } from './pageTestApi'; import type { ServerFixtures, ServerWorkerOptions } from '../config/serverFixtures'; -export { expect } from '@pw-recorder/test'; +export { expect } from '@okep/test'; let impl: TestType = browserTest; diff --git a/tests/page/pageTestApi.ts b/tests/page/pageTestApi.ts index 20a91ec4cdb14..ba234bffcc12e 100644 --- a/tests/page/pageTestApi.ts +++ b/tests/page/pageTestApi.ts @@ -15,8 +15,8 @@ */ import type { Page, ViewportSize } from 'pw-recorder-core'; -import type { PageScreenshotOptions, ScreenshotMode, VideoMode } from '@pw-recorder/test'; -export { expect } from '@pw-recorder/test'; +import type { PageScreenshotOptions, ScreenshotMode, VideoMode } from '@okep/test'; +export { expect } from '@okep/test'; // Page test does not guarantee an isolated context, just a new page (because Android). export type PageTestFixtures = { diff --git a/tests/page/retarget.spec.ts b/tests/page/retarget.spec.ts index 8780a2da81908..67086657f3e4e 100644 --- a/tests/page/retarget.spec.ts +++ b/tests/page/retarget.spec.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import type { Page } from '@pw-recorder/test'; +import type { Page } from '@okep/test'; import { test as it, expect, rafraf } from './pageTest'; const giveItAChanceToResolve = (page: Page) => rafraf(page, 5); diff --git a/tests/page/selectors-css.spec.ts b/tests/page/selectors-css.spec.ts index d0bef0a988c83..ae049b918e853 100644 --- a/tests/page/selectors-css.spec.ts +++ b/tests/page/selectors-css.spec.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import type { ElementHandle } from '@pw-recorder/test'; +import type { ElementHandle } from '@okep/test'; import { test as it, expect } from './pageTest'; it('should work with large DOM @smoke', async ({ page, server }) => { diff --git a/tests/page/workers.spec.ts b/tests/page/workers.spec.ts index fc37c6f51a9c9..f6c713a2720f0 100644 --- a/tests/page/workers.spec.ts +++ b/tests/page/workers.spec.ts @@ -16,7 +16,7 @@ */ import { test as it, expect } from './pageTest'; -import type { Worker as PwWorker } from '@pw-recorder/test'; +import type { Worker as PwWorker } from '@okep/test'; import { attachFrame } from '../config/utils'; import type { ConsoleMessage } from 'pw-recorder-core'; import fs from 'fs'; diff --git a/tests/playwright-test/access-data.spec.ts b/tests/playwright-test/access-data.spec.ts index 359e9d482f1c0..fba1244e3d0b2 100644 --- a/tests/playwright-test/access-data.spec.ts +++ b/tests/playwright-test/access-data.spec.ts @@ -19,7 +19,7 @@ import { test, expect } from './playwright-test-fixtures'; test('should access error in fixture', async ({ runInlineTest }) => { const result = await runInlineTest({ 'test-error-visible-in-env.spec.ts': ` - import { test as base, expect } from '@playwright/test'; + import { test as base, expect } from '@okep/test'; const test = base.extend({ foo: [async ({}, run, testInfo) => { await run(); @@ -41,7 +41,7 @@ test('should access error in fixture', async ({ runInlineTest }) => { test('should access annotations in fixture', async ({ runInlineTest }) => { const { exitCode, report } = await runInlineTest({ 'test-data-visible-in-env.spec.ts': ` - import { test as base, expect } from '@playwright/test'; + import { test as base, expect } from '@okep/test'; const test = base.extend({ foo: [async ({}, run, testInfo) => { await run(); @@ -76,7 +76,7 @@ test('should report projectName in result', async ({ runInlineTest }) => { }; `, 'test-data-visible-in-env.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('some test', async ({}, testInfo) => { }); ` @@ -89,7 +89,7 @@ test('should report projectName in result', async ({ runInlineTest }) => { test('should access testInfo.attachments in fixture', async ({ runInlineTest }) => { const { exitCode, report } = await runInlineTest({ 'test-data-visible-in-env.spec.ts': ` - import { test as base, expect } from '@playwright/test'; + import { test as base, expect } from '@okep/test'; const test = base.extend({ foo: async ({}, run, testInfo) => { await run(); diff --git a/tests/playwright-test/babel.spec.ts b/tests/playwright-test/babel.spec.ts index 517d813bc84be..440da77fe7877 100644 --- a/tests/playwright-test/babel.spec.ts +++ b/tests/playwright-test/babel.spec.ts @@ -19,7 +19,7 @@ import { test, expect } from './playwright-test-fixtures'; test('should succeed', async ({ runInlineTest }) => { const result = await runInlineTest({ 'one-success.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; class Foo { #logger = 2; @@ -58,7 +58,7 @@ test('should treat enums equally', async ({ runInlineTest }) => { } `, 'example.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; import * as components from './component'; import * as regular from './regular'; @@ -80,7 +80,7 @@ test('should be able to access |this| inside class properties', async ({ runInli test.info().annotations.push({ type: 'issue', description: 'https://github.com/microsoft/playwright/issues/21794' }); const result = await runInlineTest({ 'example.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; class Foo { constructor(private readonly incoming: number) {} @@ -100,7 +100,7 @@ test('should work with |const| Type Parameters', async ({ runInlineTest }) => { test.info().annotations.push({ type: 'issue', description: 'https://github.com/microsoft/playwright/issues/21900' }); const result = await runInlineTest({ 'example.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('works', () => { type HasNames = { names: readonly string[] }; @@ -123,7 +123,7 @@ test('should not read browserslist file', async ({ runInlineTest }) => { const result = await runInlineTest({ 'package.json': `{ "browserslist": ["some invalid! value :)"] }`, 'one-success.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('succeeds', () => {}); ` }); @@ -135,7 +135,7 @@ test('should not read browserslist file', async ({ runInlineTest }) => { test('should not transform external', async ({ runInlineTest }) => { const result = await runInlineTest({ 'playwright.config.ts': ` - import { defineConfig } from '@playwright/test'; + import { defineConfig } from '@okep/test'; export default defineConfig({ build: { external: ['**/a.spec.ts'] @@ -143,7 +143,7 @@ test('should not transform external', async ({ runInlineTest }) => { }); `, 'a.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('succeeds', () => {}); ` }); @@ -166,7 +166,7 @@ for (const type of ['module', undefined]) { `, 'package.json': JSON.stringify({ foo: 'bar', type }), 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('check project name', ({}, testInfo) => { expect(1).toBe(1); diff --git a/tests/playwright-test/basic.spec.ts b/tests/playwright-test/basic.spec.ts index 6476255936e38..46e3844c1731e 100644 --- a/tests/playwright-test/basic.spec.ts +++ b/tests/playwright-test/basic.spec.ts @@ -19,7 +19,7 @@ import { test, expect } from './playwright-test-fixtures'; test('should fail', async ({ runInlineTest }) => { const result = await runInlineTest({ 'one-failure.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('fails', () => { expect(1 + 1).toBe(7); }); @@ -34,7 +34,7 @@ test('should fail', async ({ runInlineTest }) => { test('should timeout', async ({ runInlineTest }) => { const { exitCode, passed, failed, output } = await runInlineTest({ 'one-timeout.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('timeout', async () => { await new Promise(f => setTimeout(f, 10000)); }); @@ -49,7 +49,7 @@ test('should timeout', async ({ runInlineTest }) => { test('should succeed', async ({ runInlineTest }) => { const result = await runInlineTest({ 'one-success.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('succeeds', () => { expect(1 + 1).toBe(2); }); @@ -66,7 +66,7 @@ test('should report suite errors', async ({ runInlineTest }) => { if (new Error().stack.includes('workerMain')) throw new Error('Suite error'); - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('passes',() => { expect(1 + 1).toBe(2); }); @@ -80,7 +80,7 @@ test('should report suite errors', async ({ runInlineTest }) => { test('should respect nested skip', async ({ runInlineTest }) => { const { exitCode, passed, failed, skipped } = await runInlineTest({ 'nested-skip.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test.describe('skipped', () => { test.skip(); test('succeeds',() => { @@ -98,7 +98,7 @@ test('should respect nested skip', async ({ runInlineTest }) => { test('should respect excluded tests', async ({ runInlineTest }) => { const { exitCode, passed } = await runInlineTest({ 'excluded.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('included test', () => { expect(1 + 1).toBe(2); }); @@ -134,7 +134,7 @@ test('should respect excluded tests', async ({ runInlineTest }) => { test('should respect focused tests', async ({ runInlineTest }) => { const { exitCode, passed } = await runInlineTest({ 'focused.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('included test', () => { expect(1 + 1).toBe(3); }); @@ -182,7 +182,7 @@ test('should respect focused tests', async ({ runInlineTest }) => { test('skip should take priority over fail', async ({ runInlineTest }) => { const { passed, skipped, failed } = await runInlineTest({ 'test.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test.describe('failing suite', () => { test.fail(); @@ -219,13 +219,13 @@ test('should focus test from one project', async ({ runInlineTest }) => { ] }; `, 'a/afile.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('just a test', () => { expect(1 + 1).toBe(3); }); `, 'b/bfile.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test.only('focused test', () => { expect(1 + 1).toBe(2); }); @@ -240,7 +240,7 @@ test('should focus test from one project', async ({ runInlineTest }) => { test('should work with default export', async ({ runInlineTest }) => { const result = await runInlineTest({ 'file.spec.ts': ` - import t from '@playwright/test'; + import t from '@okep/test'; t('passed', () => { t.expect(1 + 1).toBe(2); }); @@ -254,14 +254,14 @@ test('should work with default export', async ({ runInlineTest }) => { test('should work with test wrapper', async ({ runInlineTest }) => { const result = await runInlineTest({ 'helper.js': ` - const { test, expect } = require('@playwright/test'); + const { test, expect } = require('@okep/test'); console.log('%%helper'); exports.wrap = (title, fn) => { test(title, fn); }; `, 'a.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; console.log('%%a.spec'); const { wrap } = require('./helper'); wrap('test1', () => { @@ -274,7 +274,7 @@ test('should work with test wrapper', async ({ runInlineTest }) => { }); `, 'b.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; console.log('%%b.spec'); const { wrap } = require('./helper'); wrap('test2', () => { @@ -306,7 +306,7 @@ test('should work with test wrapper', async ({ runInlineTest }) => { test('should work with test helper', async ({ runInlineTest }) => { const result = await runInlineTest({ 'helper-a.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; console.log('%%helper-a'); test('test1', () => { console.log('%%test1'); @@ -322,7 +322,7 @@ test('should work with test helper', async ({ runInlineTest }) => { require('./helper-a'); `, 'helper-b.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; console.log('%%helper-b'); test('test1', () => { console.log('%%test2'); @@ -359,7 +359,7 @@ test('should work with test helper', async ({ runInlineTest }) => { test('should support describe() without a title', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test.describe('suite1', () => { test.describe(() => { test.describe('suite2', () => { @@ -377,7 +377,7 @@ test('should support describe() without a title', async ({ runInlineTest }) => { test('test.{skip,fixme} should define a skipped test', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; const logs = []; test.skip('foo', () => { console.log('%%dontseethis'); @@ -397,7 +397,7 @@ test('test.{skip,fixme} should define a skipped test', async ({ runInlineTest }) test('should report unhandled error during test and not report timeout', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('unhandled rejection', async () => { setTimeout(() => { throw new Error('Unhandled'); @@ -415,7 +415,7 @@ test('should report unhandled error during test and not report timeout', async ( test('should report unhandled rejection during worker shutdown', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('unhandled rejection', async () => { new Promise((f, r) => r(new Error('Unhandled'))); }); @@ -430,7 +430,7 @@ test('should report unhandled rejection during worker shutdown', async ({ runInl test('should not reuse worker after unhandled rejection in test.fail', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.spec.ts': ` - import { test as base, expect } from '@playwright/test'; + import { test as base, expect } from '@okep/test'; const test = base.extend({ needsCleanup: async ({}, use) => { await use(); @@ -457,7 +457,7 @@ test('should not reuse worker after unhandled rejection in test.fail', async ({ test('should allow unhandled expects in test.fail', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('failing1', async ({}) => { test.fail(); Promise.resolve().then(() => expect(1).toBe(2)); @@ -473,7 +473,7 @@ test('should allow unhandled expects in test.fail', async ({ runInlineTest }) => test('should not skip tests after test.fail', async ({ runInlineTest, server }) => { const result = await runInlineTest({ 'a.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('failing', async ({}) => { test.fail(); expect(Promise.resolve('a')).resolves.toBe('b'); @@ -481,13 +481,13 @@ test('should not skip tests after test.fail', async ({ runInlineTest, server }) }); `, 'b.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('passing', async ({}) => { console.log('b-passing'); }); `, 'c.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('passing', async ({}) => { console.log('c-passing'); }); @@ -502,7 +502,7 @@ test('should not skip tests after test.fail', async ({ runInlineTest, server }) test('should support describe.skip', async ({ runInlineTest }) => { const result = await runInlineTest({ 'nested-skip.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test.describe.skip('skipped', () => { test.describe('nested', () => { test('test1', () => {}); @@ -528,7 +528,7 @@ test('should support describe.skip', async ({ runInlineTest }) => { test('should support describe.fixme', async ({ runInlineTest }) => { const result = await runInlineTest({ 'nested-skip.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test.describe.fixme('skipped', () => { test.describe('nested', () => { test('test1', () => {}); @@ -554,7 +554,7 @@ test('should support describe.fixme', async ({ runInlineTest }) => { test('should not allow mixing test types', async ({ runInlineTest }) => { const result = await runInlineTest({ 'mixed.spec.ts': ` - import { test } from '@playwright/test'; + import { test } from '@okep/test'; export const test2 = test.extend({ value: 42, diff --git a/tests/playwright-test/clear-cache.spec.ts b/tests/playwright-test/clear-cache.spec.ts index f46bf1372c803..13ae5022a1ec0 100644 --- a/tests/playwright-test/clear-cache.spec.ts +++ b/tests/playwright-test/clear-cache.spec.ts @@ -19,14 +19,14 @@ import { test, expect } from './playwright-test-fixtures'; test('should clear cache with type:module', async ({ runCLICommand }) => { const result = await runCLICommand({ 'pw-recorder.config.ts': ` - import { defineConfig } from '@playwright/test'; + import { defineConfig } from '@okep/test'; export default defineConfig({}); `, 'package.json': ` { "type": "module" } `, 'a.spec.ts': ` - import { test } from '@playwright/test'; + import { test } from '@okep/test'; test('example', () => {}); `, }, 'clear-cache'); @@ -36,11 +36,11 @@ test('should clear cache with type:module', async ({ runCLICommand }) => { test('should clear cache for ct', async ({ runCLICommand }) => { const result = await runCLICommand({ 'pw-recorder.config.ts': ` - import { defineConfig } from '@playwright/test'; + import { defineConfig } from '@okep/test'; export default defineConfig({}); `, 'a.spec.ts': ` - import { test } from '@playwright/test'; + import { test } from '@okep/test'; test('example', () => {}); `, }, 'clear-cache', []); diff --git a/tests/playwright-test/command-line-filter.spec.ts b/tests/playwright-test/command-line-filter.spec.ts index 8937694b39fb6..7cac5d3034450 100644 --- a/tests/playwright-test/command-line-filter.spec.ts +++ b/tests/playwright-test/command-line-filter.spec.ts @@ -19,11 +19,11 @@ import { test, expect } from './playwright-test-fixtures'; test('should filter by file name', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('fails', () => { expect(1).toBe(2); }); `, 'b.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('fails', () => { expect(1).toBe(2); }); `, }, undefined, undefined, { additionalArgs: ['a.spec.ts'] }); @@ -35,19 +35,19 @@ test('should filter by file name', async ({ runInlineTest }) => { test('should filter by folder', async ({ runInlineTest }) => { const result = await runInlineTest({ 'foo/x.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('fails', () => { expect(1).toBe(2); }); `, 'foo/y.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('fails', () => { expect(1).toBe(2); }); `, 'bar/x.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('fails', () => { expect(1).toBe(2); }); `, 'bar/y.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('fails', () => { expect(1).toBe(2); }); `, }, undefined, undefined, { additionalArgs: ['bar'] }); @@ -60,13 +60,13 @@ test('should filter by folder', async ({ runInlineTest }) => { test('should filter by line', async ({ runInlineTest }) => { const result = await runInlineTest({ 'foo/x.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('one', () => { expect(1).toBe(2); }); test('two', () => { expect(1).toBe(2); }); test('three', () => { expect(1).toBe(2); }); `, 'foo/y.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('fails', () => { expect(1).toBe(2); }); `, }, undefined, undefined, { additionalArgs: ['x.spec.ts:4'] }); @@ -78,7 +78,7 @@ test('should filter by line', async ({ runInlineTest }) => { test('should filter by line and column', async ({ runInlineTest }) => { const result = await runInlineTest({ 'foo/x.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('yes-full-match', () => { expect(1).toBe(1); }); test('no-wrong-column', () => { expect(1).toBe(2); }); test('yes-no-column-specified', () => { expect(1).toBe(1); }); @@ -95,13 +95,13 @@ test('should filter by line and column', async ({ runInlineTest }) => { test('line should override focused test', async ({ runInlineTest }) => { const result = await runInlineTest({ 'foo/x.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test.only('one', () => { expect(1).toBe(2); }); test('two', () => { expect(1).toBe(2); }); test.only('three', () => { expect(1).toBe(2); }); `, 'foo/y.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('fails', () => { expect(1).toBe(2); }); `, }, undefined, undefined, { additionalArgs: ['x.spec.ts:4'] }); @@ -113,13 +113,13 @@ test('line should override focused test', async ({ runInlineTest }) => { test('should merge filtered line and filtered file', async ({ runInlineTest }) => { const result = await runInlineTest({ 'foo/x.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('one', () => { expect(1).toBe(2); }); test('two', () => { expect(1).toBe(2); }); test('three', () => { expect(1).toBe(2); }); `, 'foo/y.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('fails', () => { expect(1).toBe(2); }); `, }, undefined, undefined, { additionalArgs: ['x.spec.ts:4', 'x.spec.ts'] }); @@ -130,13 +130,13 @@ test('should merge filtered line and filtered file', async ({ runInlineTest }) = test('should run nothing for missing line', async ({ runInlineTest }) => { const result = await runInlineTest({ 'foo/x.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('one', () => { expect(1).toBe(2); }); test('two', () => { expect(1).toBe(2); }); test('three', () => { expect(1).toBe(2); }); `, 'foo/y.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('fails', () => { expect(1).toBe(2); }); `, }, undefined, undefined, { additionalArgs: ['x.spec.ts:8', 'y.spec.ts'] }); @@ -147,7 +147,7 @@ test('should run nothing for missing line', async ({ runInlineTest }) => { test('should focus a single nested test spec', async ({ runInlineTest }) => { const result = await runInlineTest({ 'foo.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('pass1', ({}) => {}); test.describe('suite-1', () => { test.describe('suite-2', () => { @@ -157,11 +157,11 @@ test('should focus a single nested test spec', async ({ runInlineTest }) => { test('pass3', ({}) => {}); `, 'bar.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('pass3', ({}) => {}); `, 'noooo.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('no-pass1', ({}) => {}); `, }, {}, {}, { additionalArgs: ['foo.test.ts:6', 'bar.test.ts'] }); @@ -175,7 +175,7 @@ test('should focus a single nested test spec', async ({ runInlineTest }) => { test('should focus a single test suite', async ({ runInlineTest }) => { const result = await runInlineTest({ 'foo.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('pass1', ({}) => {}); test.describe('suite-1', () => { test.describe('suite-2', () => { @@ -186,7 +186,7 @@ test('should focus a single test suite', async ({ runInlineTest }) => { test('pass4', ({}) => {}); `, 'bar.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('no-pass1', ({}) => {}); `, }, {}, {}, { additionalArgs: ['foo.test.ts:5'] }); @@ -195,4 +195,4 @@ test('should focus a single test suite', async ({ runInlineTest }) => { expect(result.skipped).toBe(0); expect(result.report.suites[0].suites[0].suites[0].specs[0].title).toEqual('pass2'); expect(result.report.suites[0].suites[0].suites[0].specs[1].title).toEqual('pass3'); -}); \ No newline at end of file +}); diff --git a/tests/playwright-test/config.spec.ts b/tests/playwright-test/config.spec.ts index 5550d84253b52..deff2f6fa3473 100644 --- a/tests/playwright-test/config.spec.ts +++ b/tests/playwright-test/config.spec.ts @@ -24,7 +24,7 @@ test('should be able to define config', async ({ runInlineTest }) => { module.exports = { timeout: 12345 }; `, 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('pass', async ({}, testInfo) => { expect(testInfo.timeout).toBe(12345); }); @@ -41,7 +41,7 @@ test('should prioritize project timeout', async ({ runInlineTest }) => { module.exports = { timeout: 500, projects: [{ timeout: 10000}, {}] }; `, 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('pass', async ({}, testInfo) => { await new Promise(f => setTimeout(f, 1500)); }); @@ -60,7 +60,7 @@ test('should prioritize command line timeout over project timeout', async ({ run module.exports = { projects: [{ timeout: 10000}] }; `, 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('pass', async ({}, testInfo) => { await new Promise(f => setTimeout(f, 1500)); }); @@ -81,12 +81,12 @@ test('should read config from --config, resolve relative testDir', async ({ runI }; `, 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('ignored', async ({}) => { }); `, 'dir/b.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('run', async ({}) => { }); `, @@ -104,12 +104,12 @@ test('should default testDir to the config file', async ({ runInlineTest }) => { module.exports = {}; `, 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('ignored', async ({}) => { }); `, 'dir/b.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('run', async ({}) => { }); `, @@ -133,7 +133,7 @@ test('should be able to set reporters', async ({ runInlineTest }, testInfo) => { }; `, 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('pass', async () => { }); ` @@ -154,12 +154,12 @@ test('should support different testDirs', async ({ runInlineTest }) => { ] }; `, 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('runs once', async ({}) => { }); `, 'dir/b.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('runs twice', async ({}) => { }); `, @@ -186,13 +186,13 @@ test('should allow root testDir and use it for relative paths', async ({ runInli }; `, 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('fails', async ({}, testInfo) => { expect(1 + 1).toBe(3); }); `, 'dir/a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('fails', async ({}, testInfo) => { expect(1 + 1).toBe(3); }); @@ -209,12 +209,12 @@ test('should allow root testDir and use it for relative paths', async ({ runInli test('should throw when test() is called in config file', async ({ runInlineTest }) => { const result = await runInlineTest({ 'playwright.config.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('hey', () => {}); module.exports = {}; `, 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('test', async ({}) => { }); `, @@ -231,7 +231,7 @@ test('should filter by project, case-insensitive', async ({ runInlineTest }) => ] }; `, 'a.test.ts': ` - import { test } from '@playwright/test'; + import { test } from '@okep/test'; test('pass', async ({}, testInfo) => { console.log('%%' + test.info().project.name); }); @@ -256,7 +256,7 @@ test('should filter by project wildcard', async ({ runInlineTest }) => { }; `, 'a.test.js': ` - const { test } = require('@playwright/test'); + const { test } = require('@okep/test'); test('one', async ({}) => { console.log('%%' + test.info().project.name); }); ` @@ -277,7 +277,7 @@ test('should print nice error when the project wildcard does not match anything' ] }; `, 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('pass', async ({}, testInfo) => { console.log(testInfo.project.name); }); @@ -301,7 +301,7 @@ test('should filter by project wildcard and exact name', async ({ runInlineTest }; `, 'a.test.js': ` - const { test } = require('@playwright/test'); + const { test } = require('@okep/test'); test('one', async ({}) => { console.log('%%' + test.info().project.name); }); ` @@ -319,7 +319,7 @@ test('should print nice error when project is unknown', async ({ runInlineTest } ] }; `, 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('pass', async ({}, testInfo) => {}); ` }, { project: 'suite3' }); @@ -338,7 +338,7 @@ test('should filter by project list, case-insensitive', async ({ runInlineTest } ] }; `, 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('pass', async ({}, testInfo) => { console.log('%%' + test.info().project.name); }); @@ -361,7 +361,7 @@ test('should filter when duplicate project names exist', async ({ runInlineTest ] }; `, 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('pass', async ({}, testInfo) => { console.log('%%' + test.info().project.name); }); @@ -382,7 +382,7 @@ test('should print nice error when some of the projects are unknown', async ({ r ] }; `, 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('pass', async ({}, testInfo) => { console.log(testInfo.project.name); }); @@ -398,7 +398,7 @@ test('should work without config file', async ({ runInlineTest }) => { throw new Error('This file should not be required'); `, 'dir/a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('pass', async ({}) => { test.expect(1 + 1).toBe(2); }); @@ -421,7 +421,7 @@ test('should inherit use options in projects', async ({ runInlineTest }) => { }; `, 'a.test.ts': ` - import { test as base, expect } from '@playwright/test'; + import { test as base, expect } from '@okep/test'; const test = base.extend({ foo: ['', {option:true}], bar: ['', {option: true}] }); test('pass', async ({ foo, bar }, testInfo) => { test.expect(foo).toBe('config'); @@ -446,7 +446,7 @@ test('should support ignoreSnapshots config option', async ({ runInlineTest }) = }; `, 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('pass', async ({}, testInfo) => { testInfo.snapshotSuffix = ''; expect(testInfo.project.name).toMatchSnapshot(); @@ -469,7 +469,7 @@ test('should validate workers option set to percent', async ({ runInlineTest }, }; `, 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('pass', async () => { }); ` @@ -486,7 +486,7 @@ test('should throw when workers option is invalid', async ({ runInlineTest }) => }; `, 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('pass', async () => { }); ` @@ -504,7 +504,7 @@ test('should work with undefined values and base', async ({ runInlineTest }) => }; `, 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('pass', async ({}, testInfo) => { expect(testInfo.config.updateSnapshots).toBe('missing'); }); @@ -518,7 +518,7 @@ test('should work with undefined values and base', async ({ runInlineTest }) => test('should have correct types for the config', async ({ runTSC }) => { const result = await runTSC({ 'playwright.config.ts': ` - import { defineConfig } from '@playwright/test'; + import { defineConfig } from '@okep/test'; export default defineConfig({ webServer: [ @@ -550,7 +550,7 @@ test('should have correct types for the config', async ({ runTSC }) => { test('should not allow tracesDir in launchOptions', async ({ runTSC }) => { const result = await runTSC({ 'playwright.config.ts': ` - import { defineConfig } from '@playwright/test'; + import { defineConfig } from '@okep/test'; export default defineConfig({ use: { @@ -567,7 +567,7 @@ test('should not allow tracesDir in launchOptions', async ({ runTSC }) => { test('should merge configs', async ({ runInlineTest }) => { const result = await runInlineTest({ 'playwright.config.ts': ` - import { defineConfig, expect } from '@playwright/test'; + import { defineConfig, expect } from '@okep/test'; const baseConfig = defineConfig({ timeout: 10, use: { @@ -617,7 +617,7 @@ test('should merge configs', async ({ runInlineTest }) => { expect(defineConfig({}, {}).projects).toBeUndefined(); `, 'a.test.ts': ` - import { test } from '@playwright/test'; + import { test } from '@okep/test'; test('pass', async ({}) => {}); ` }); @@ -627,7 +627,7 @@ test('should merge configs', async ({ runInlineTest }) => { test('should merge ct configs', async ({ runInlineTest }) => { const result = await runInlineTest({ 'playwright.config.ts': ` - import { defineConfig, expect } from '@playwright/experimental-ct-react'; + import { defineConfig, expect } from '@okep/experimental-ct-react'; const baseConfig = defineConfig({ timeout: 10, use: { @@ -646,16 +646,16 @@ test('should merge ct configs', async ({ runInlineTest }) => { expect(derivedConfig).toEqual(expect.objectContaining({ use: { foo: 1, bar: 2 }, grep: 'hi', - '@playwright/test': expect.objectContaining({ + '@okep/test': expect.objectContaining({ babelPlugins: [[expect.stringContaining('tsxTransform.js')]] }), - '@playwright/experimental-ct-core': expect.objectContaining({ + '@okep/experimental-ct-core': expect.objectContaining({ registerSourceFile: expect.stringContaining('registerSource'), }), })); `, 'a.test.ts': ` - import { test } from '@playwright/experimental-ct-react'; + import { test } from '@okep/experimental-ct-react'; test('pass', async ({}) => {}); ` }); diff --git a/tests/playwright-test/decorators.spec.ts b/tests/playwright-test/decorators.spec.ts index 192ddfb4929fe..bae7bb986b883 100644 --- a/tests/playwright-test/decorators.spec.ts +++ b/tests/playwright-test/decorators.spec.ts @@ -19,7 +19,7 @@ import { test, expect } from './playwright-test-fixtures'; test('should decorate', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('passes', () => { new POM().greet(); }); diff --git a/tests/playwright-test/deps.spec.ts b/tests/playwright-test/deps.spec.ts index 0c0f7505d9274..0a562b77b2200 100644 --- a/tests/playwright-test/deps.spec.ts +++ b/tests/playwright-test/deps.spec.ts @@ -27,7 +27,7 @@ test('should run projects with dependencies', async ({ runInlineTest }) => { ], };`, 'test.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('test', async ({}, testInfo) => { console.log('\\n%%' + testInfo.project.name); }); @@ -50,7 +50,7 @@ test('should inherit env changes from dependencies', async ({ runInlineTest }) = ] }; `, 'a.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('pass', async ({}, testInfo) => { process.env.SET_IN_A = 'valuea'; delete process.env.SET_OUTSIDE; @@ -58,26 +58,26 @@ test('should inherit env changes from dependencies', async ({ runInlineTest }) = }); `, 'b.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('pass', async ({}, testInfo) => { process.env.SET_IN_B = 'valueb'; console.log('\\n%%B'); }); `, 'c.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('pass', async ({}, testInfo) => { console.log('\\n%%C-' + process.env.SET_IN_A + '-' + process.env.SET_IN_B + '-' + process.env.SET_OUTSIDE); }); `, 'd.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('pass', async ({}, testInfo) => { console.log('\\n%%D-' + process.env.SET_IN_A + '-' + process.env.SET_IN_B + '-' + process.env.SET_OUTSIDE); }); `, 'e.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('pass', async ({}, testInfo) => { console.log('\\n%%E-' + process.env.SET_IN_A + '-' + process.env.SET_IN_B + '-' + process.env.SET_OUTSIDE); }); @@ -100,7 +100,7 @@ test('should not run projects with dependencies when --no-deps is passed', async ], };`, 'test.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('test', async ({}, testInfo) => { console.log('\\n%%' + testInfo.project.name); }); @@ -122,7 +122,7 @@ test('should not run project if dependency failed', async ({ runInlineTest }) => ], };`, 'test.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('test', async ({}, testInfo) => { console.log('\\n%%' + testInfo.project.name); if (testInfo.project.name === 'B') @@ -152,7 +152,7 @@ test('should not run project if dependency failed (2)', async ({ runInlineTest } ], };`, 'test.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('test', async ({}, testInfo) => { console.log('\\n%%' + testInfo.project.name); if (testInfo.project.name === 'B1') @@ -175,7 +175,7 @@ test('should filter by project list, but run deps', async ({ runInlineTest }) => ] }; `, 'test.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('pass', async ({}, testInfo) => { console.log('\\n%%' + testInfo.project.name); }); @@ -197,11 +197,11 @@ test('should not filter dependency by file name', async ({ runInlineTest }) => { ] }; `, 'one.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('fails', () => { expect(1).toBe(2); }); `, 'two.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('pass', () => { }); `, }, undefined, undefined, { additionalArgs: ['two.spec.ts'] }); @@ -219,7 +219,7 @@ test('should filter dependency by only', async ({ runInlineTest }) => { ] }; `, 'setup.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('passes', () => { console.log('\\n%% setup in ' + test.info().project.name); }); @@ -228,7 +228,7 @@ test('should filter dependency by only', async ({ runInlineTest }) => { }); `, 'test.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('pass', () => { console.log('\\n%% test in ' + test.info().project.name); }); @@ -247,7 +247,7 @@ test('should filter dependency by only when running explicitly', async ({ runInl ] }; `, 'setup.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('passes', () => { console.log('\\n%% setup in ' + test.info().project.name); }); @@ -256,7 +256,7 @@ test('should filter dependency by only when running explicitly', async ({ runInl }); `, 'test.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('pass', () => { console.log('\\n%% test in ' + test.info().project.name); }); @@ -275,19 +275,19 @@ test('should not filter dependency by only 3', async ({ runInlineTest }) => { ] }; `, 'setup-1.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('setup 1', () => { console.log('\\n%% setup in ' + test.info().project.name); }); `, 'setup-2.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('setup 2', () => { console.log('\\n%% setup 2 in ' + test.info().project.name); }); `, 'test.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('pass', () => { console.log('\\n%% test in ' + test.info().project.name); }); @@ -306,13 +306,13 @@ test('should not report skipped dependent tests', async ({ runInlineTest }) => { ] }; `, 'setup.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('setup', () => { expect(1).toBe(2); }); `, 'test.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('pass', () => {}); `, }); @@ -331,7 +331,7 @@ test('should report circular dependencies', async ({ runInlineTest }) => { ] }; `, 'test.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('pass', () => {}); `, }); @@ -350,19 +350,19 @@ test('should run dependency in each shard', async ({ runInlineTest }) => { }; `, 'setup.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('setup', async ({}) => { console.log('\\n%%setup'); }); `, 'test1.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('test1', async ({}) => { console.log('\\n%%test1'); }); `, 'test2.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('test2', async ({}) => { console.log('\\n%%test2'); }); @@ -392,7 +392,7 @@ test('should run setup project with zero tests', async ({ runInlineTest }) => { ], };`, 'test.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('test', async ({}, testInfo) => { console.log('\\n%%' + testInfo.project.name); }); @@ -414,13 +414,13 @@ test('should run setup project with zero tests recursively', async ({ runInlineT ], };`, 'a.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('test', async ({}, testInfo) => { console.log('\\n%%' + testInfo.project.name); }); `, 'c.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('test', async ({}, testInfo) => { console.log('\\n%%' + testInfo.project.name); }); @@ -441,7 +441,7 @@ test('should run project with teardown', async ({ runInlineTest }) => { ], };`, 'test.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('test', async ({}, testInfo) => { console.log('\\n%%' + testInfo.project.name); }); @@ -465,7 +465,7 @@ test('should run teardown after dependents', async ({ runInlineTest }) => { ], };`, 'test.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('test', async ({}, testInfo) => { console.log('\\n%%' + testInfo.project.name); }); @@ -488,7 +488,7 @@ test('should run teardown after failure', async ({ runInlineTest }) => { ], };`, 'test.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('test', async ({}, testInfo) => { console.log('\\n%%' + testInfo.project.name); if (testInfo.project.name === 'A') @@ -514,7 +514,7 @@ test('should complain about teardown being a dependency', async ({ runInlineTest ], };`, 'test.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('test', () => {}); `, }); @@ -533,7 +533,7 @@ test('should complain about teardown having a dependency', async ({ runInlineTes ], };`, 'test.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('test', () => {}); `, }); @@ -552,7 +552,7 @@ test('should support the same teardown used multiple times', async ({ runInlineT ], };`, 'test.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('test', async ({}, testInfo) => { console.log('\\n%%' + testInfo.project.name); }); @@ -574,7 +574,7 @@ test('should only apply --repeat-each to top-level', async ({ runInlineTest }) = ], };`, 'test.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('test', async ({}, testInfo) => { console.log('\\n%%' + testInfo.project.name); }); @@ -596,7 +596,7 @@ test('should run teardown when all projects are top-level at run point', async ( ], };`, 'test.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('test', async ({}, testInfo) => { console.log('\\n%%' + testInfo.project.name); }); @@ -621,19 +621,19 @@ test('should not run deps for projects filtered with grep', async ({ runInlineTe ], };`, 'a.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('test', async ({}, testInfo) => { console.log('\\n%%' + testInfo.project.name); }); `, 'hook.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('test', async ({}, testInfo) => { console.log('\\n%%' + testInfo.project.name); }); `, 'b.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('test', async ({}, testInfo) => { console.log('\\n%%' + testInfo.project.name); }); @@ -654,11 +654,11 @@ test('should allow only in dependent', async ({ runInlineTest }) => { ], };`, 'setup.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('setup', async ({}) => {}); `, 'a.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test.only('test', async ({}) => { }); test('test 2', async ({}) => { expect(1).toBe(2); }); @@ -678,11 +678,11 @@ test('should allow only in dependent (2)', async ({ runInlineTest }) => { ], };`, 'setup.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test.only('setup', async ({}) => {}); `, 'a.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('test', async ({}) => { expect(1).toBe(2); }); test('test 2', async ({}) => { expect(1).toBe(2); }); `, diff --git a/tests/playwright-test/esm.spec.ts b/tests/playwright-test/esm.spec.ts index ce75fca76716f..d43e991c636fd 100644 --- a/tests/playwright-test/esm.spec.ts +++ b/tests/playwright-test/esm.spec.ts @@ -24,7 +24,7 @@ test('should load nested as esm when package.json has type module', async ({ run `, 'package.json': JSON.stringify({ type: 'module' }), 'nested/folder/a.esm.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('check project name', ({}, testInfo) => { expect(testInfo.project.name).toBe('foo'); }); @@ -46,7 +46,7 @@ test('should support import attributes', async ({ runInlineTest }) => { 'a.test.ts': ` import config from './package.json' with { type: 'json' }; console.log('imported value (test): ' + config.foo); - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('pass', async () => {}); ` }); @@ -67,7 +67,7 @@ test('should import esm from ts when package.json has type module in experimenta import { foo } from './b.ts'; import { bar } from './c.js'; import { qux } from './d.js'; - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('check project name', ({}, testInfo) => { expect(testInfo.project.name).toBe('foo'); expect(bar).toBe('bar'); @@ -92,7 +92,7 @@ test('should propagate subprocess exit code in experimental mode', async ({ runI const result = await runInlineTest({ 'package.json': JSON.stringify({ type: 'module' }), 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('failing test', ({}, testInfo) => { expect(1).toBe(2); }); @@ -125,7 +125,7 @@ test('should respect path resolver in experimental mode', async ({ runInlineTest }`, 'a.test.ts': ` import { foo } from 'util/b.js'; - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('check project name', ({}, testInfo) => { expect(testInfo.project.name).toBe('foo'); expect(foo).toBe('foo'); @@ -147,7 +147,7 @@ test('should use source maps', async ({ runInlineTest }) => { export default { projects: [{name: 'foo'}] }; `, 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('check project name', ({}, testInfo) => { expect(testInfo.project.name).toBe('foo'); @@ -170,7 +170,7 @@ test('should use source maps when importing a file throws an error', async ({ ru export default {}; `, 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; throw new Error('Oh my!'); ` @@ -180,7 +180,7 @@ test('should use source maps when importing a file throws an error', async ({ ru at a.test.ts:4 - 2 | import { test, expect } from '@playwright/test'; + 2 | import { test, expect } from '@okep/test'; 3 | > 4 | throw new Error('Oh my!'); | ^ @@ -194,7 +194,7 @@ test('should show the codeframe in errors', async ({ runInlineTest }) => { export default { projects: [{name: 'foo'}] }; `, 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('check project name', ({}, testInfo) => { expect(1).toBe(2); @@ -235,13 +235,13 @@ test('should filter by line', async ({ runInlineTest }) => { export default { projects: [{name: 'foo'}] }; `, 'foo/x.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('one', () => { expect(1).toBe(2); }); test('two', () => { expect(1).toBe(2); }); test('three', () => { expect(1).toBe(2); }); `, 'foo/y.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('fails', () => { expect(1).toBe(2); }); `, }, undefined, undefined, { additionalArgs: ['x.spec.ts:4'] }); @@ -255,7 +255,7 @@ test('should resolve directory import to index.js file in ESM mode', async ({ ru 'package.json': `{ "type": "module" }`, 'playwright.config.ts': `export default { projects: [{name: 'foo'}] };`, 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; import { gimmeAOne } from './playwright-utils'; test('pass', ({}) => { expect(gimmeAOne()).toBe(1); @@ -276,7 +276,7 @@ test('should resolve directory import to index.ts file in ESM mode', async ({ ru 'package.json': `{ "type": "module" }`, 'playwright.config.ts': `export default { projects: [{name: 'foo'}] };`, 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; import { gimmeAOne } from './playwright-utils'; test('pass', ({}) => { expect(gimmeAOne()).toBe(1); @@ -297,7 +297,7 @@ test('should resolve directory import to index.tsx file in ESM mode', async ({ r 'package.json': `{ "type": "module" }`, 'playwright.config.ts': `export default { projects: [{name: 'foo'}] };`, 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; import { gimmeAOne } from './playwright-utils'; test('pass', ({}) => { expect(gimmeAOne()).toBe(1); @@ -318,7 +318,7 @@ test('should resolve directory import to index.mjs file in ESM mode', async ({ r 'package.json': `{ "type": "module" }`, 'playwright.config.ts': `export default { projects: [{name: 'foo'}] };`, 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; import { gimmeAOne } from './playwright-utils'; test('pass', ({}) => { expect(gimmeAOne()).toBe(1); @@ -339,7 +339,7 @@ test('should resolve directory import to index.jsx file in ESM mode', async ({ r 'package.json': `{ "type": "module" }`, 'playwright.config.ts': `export default { projects: [{name: 'foo'}] };`, 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; import { gimmeAOne } from './playwright-utils'; test('pass', ({}) => { expect(gimmeAOne()).toBe(1); @@ -360,7 +360,7 @@ test('should resolve file import before directory import in ESM mode', async ({ 'package.json': `{ "type": "module" }`, 'playwright.config.ts': `export default { projects: [{name: 'foo'}] };`, 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; import { gimmeAOne } from './playwright-utils'; test('pass', ({}) => { expect(gimmeAOne()).toBe(1); @@ -387,7 +387,7 @@ test('should resolve .js import to .ts file in ESM mode', async ({ runInlineTest 'package.json': `{ "type": "module" }`, 'playwright.config.ts': `export default { projects: [{name: 'foo'}] };`, 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; import { gimmeAOne } from './playwright-utils.js'; test('pass', ({}) => { expect(gimmeAOne()).toBe(1); @@ -408,7 +408,7 @@ test('should resolve .js import to .tsx file in ESM mode', async ({ runInlineTes 'package.json': `{ "type": "module" }`, 'playwright.config.ts': `export default { projects: [{name: 'foo'}] };`, 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; import { gimmeAOne } from './playwright-utils.js'; test('pass', ({}) => { expect(gimmeAOne()).toBe(1); @@ -429,7 +429,7 @@ test('should resolve .js import to .jsx file in ESM mode', async ({ runInlineTes 'package.json': `{ "type": "module" }`, 'playwright.config.ts': `export default { projects: [{name: 'foo'}] };`, 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; import { gimmeAOne } from './playwright-utils.js'; test('pass', ({}) => { expect(gimmeAOne()).toBe(1); @@ -450,7 +450,7 @@ test('should resolve no-extension import to .ts file in ESM mode', async ({ runI 'package.json': `{ "type": "module" }`, 'playwright.config.ts': `export default { projects: [{name: 'foo'}] };`, 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; import { gimmeAOne } from './playwright-utils'; test('pass', ({}) => { expect(gimmeAOne()).toBe(1); @@ -471,7 +471,7 @@ test('should resolve no-extension import to .tsx file in ESM mode', async ({ run 'package.json': `{ "type": "module" }`, 'playwright.config.ts': `export default { projects: [{name: 'foo'}] };`, 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; import { gimmeAOne } from './playwright-utils'; test('pass', ({}) => { expect(gimmeAOne()).toBe(1); @@ -492,7 +492,7 @@ test('should resolve no-extension import to .jsx file in ESM mode', async ({ run 'package.json': `{ "type": "module" }`, 'playwright.config.ts': `export default { projects: [{name: 'foo'}] };`, 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; import { gimmeAOne } from './playwright-utils'; test('pass', ({}) => { expect(gimmeAOne()).toBe(1); @@ -520,7 +520,7 @@ test('should resolve .js import to .tsx file in ESM mode for components', async `, 'src/test.spec.tsx': ` - import { test, expect } from '@playwright/experimental-ct-react'; + import { test, expect } from '@okep/experimental-ct-react'; import { Button } from './button.js'; test('pass', async ({ mount }) => { await mount(); @@ -539,13 +539,13 @@ test('should load cjs config and test in non-ESM mode', async ({ runInlineTest } module.exports = { projects: [{name: 'foo'}] }; `, 'a.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('check project name', ({}, testInfo) => { expect(testInfo.project.name).toBe('foo'); }); `, 'b.spec.cjs': ` - const { test, expect } = require('@playwright/test'); + const { test, expect } = require('@okep/test'); test('check project name', ({}, testInfo) => { expect(testInfo.project.name).toBe('foo'); }); @@ -566,7 +566,7 @@ test('should allow ESM when config is cjs', async ({ runInlineTest, nodeVersion module.exports = { projects: [{name: 'foo'}] }; `, 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('check project name', ({}, testInfo) => { expect(testInfo.project.name).toBe('foo'); }); @@ -582,7 +582,7 @@ test('should load mts without config', async ({ runInlineTest, nodeVersion }) => const result = await runInlineTest({ 'a.test.mts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('check project name', ({}, testInfo) => { expect(true).toBe(true); }); @@ -603,7 +603,7 @@ test('should load type module without config', async ({ runInlineTest, nodeVersi export default foo; `, 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; import foo from './helper.js'; test('check project name', ({}, testInfo) => { expect(foo).toBe(42); @@ -655,7 +655,7 @@ test('should be able to use use execSync with a Node.js file inside a spec', asy 'hello.js': `console.log('hello from hello.js');`, 'hellofork.js': `process.send('hello from hellofork.js');`, 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; import { execSync, spawnSync, fork } from 'child_process'; console.log('%%inside test file'); console.log('%%execSync: ' + execSync('node hello.js').toString()); @@ -703,7 +703,7 @@ test('should be able to use use execSync with a Node.js file inside a spec', asy test('should be able to use mergeTests/mergeExpect', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.test.mjs': ` - import { test as base, expect as baseExpect, mergeTests, mergeExpects } from '@playwright/test'; + import { test as base, expect as baseExpect, mergeTests, mergeExpects } from '@okep/test'; const test = mergeTests( base.extend({ myFixture1: '1', @@ -748,7 +748,7 @@ test('should exit after merge-reports', async ({ runInlineTest, mergeReports }) `, 'package.json': JSON.stringify({ type: 'module' }), 'nested/folder/a.esm.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('test 1', ({}, testInfo) => {}); ` }, undefined, undefined, { additionalArgs: ['--reporter', 'blob'] }); diff --git a/tests/playwright-test/exit-code.spec.ts b/tests/playwright-test/exit-code.spec.ts index e5b1165f077f5..8c069ed60bbeb 100644 --- a/tests/playwright-test/exit-code.spec.ts +++ b/tests/playwright-test/exit-code.spec.ts @@ -24,7 +24,7 @@ function monotonicTime(): number { test('should collect stdio', async ({ runInlineTest }) => { const { exitCode, report } = await runInlineTest({ 'stdio.spec.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('stdio', () => { process.stdout.write('stdout text'); process.stdout.write(Buffer.from('stdout buffer')); @@ -43,7 +43,7 @@ test('should collect stdio', async ({ runInlineTest }) => { test('should collect stdio from forked process', async ({ runInlineTest }) => { const { exitCode, report } = await runInlineTest({ 'stdio.spec.js': ` - import { test } from '@playwright/test'; + import { test } from '@okep/test'; import { fork } from 'child_process'; test('stdio', async () => { const child = fork('fork.js'); @@ -85,7 +85,7 @@ test('should work with typescript', async ({ runInlineTest }) => { 'typescript.spec.ts': ` import './global-foo'; - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('should find global foo', () => { expect(global['foo']).toBe(true); }); @@ -102,7 +102,7 @@ test('should work with typescript', async ({ runInlineTest }) => { test('should repeat each', async ({ runInlineTest }) => { const { exitCode, report, passed } = await runInlineTest({ 'one-success.spec.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('succeeds', () => { expect(1 + 1).toBe(2); }); @@ -118,7 +118,7 @@ test('should repeat each', async ({ runInlineTest }) => { test('should allow flaky', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('flake', async ({}, testInfo) => { expect(testInfo.retry).toBe(1); }); @@ -131,7 +131,7 @@ test('should allow flaky', async ({ runInlineTest }) => { test('failOnFlakyTests flag disallows flaky', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('flake', async ({}, testInfo) => { expect(testInfo.retry).toBe(1); }); @@ -144,7 +144,7 @@ test('failOnFlakyTests flag disallows flaky', async ({ runInlineTest }) => { test('should fail on unexpected pass', async ({ runInlineTest }) => { const { exitCode, failed, output } = await runInlineTest({ 'unexpected-pass.spec.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('succeeds', () => { test.fail(); expect(1 + 1).toBe(2); @@ -160,7 +160,7 @@ test('should respect global timeout', async ({ runInlineTest }) => { const now = monotonicTime(); const { exitCode, output } = await runInlineTest({ 'one-timeout.spec.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('timeout', async () => { await new Promise(f => setTimeout(f, 10000)); }); diff --git a/tests/playwright-test/expect-configure.spec.ts b/tests/playwright-test/expect-configure.spec.ts index 14b864400a312..35bfdb082567b 100644 --- a/tests/playwright-test/expect-configure.spec.ts +++ b/tests/playwright-test/expect-configure.spec.ts @@ -19,7 +19,7 @@ import { test, expect } from './playwright-test-fixtures'; test('should configure timeout', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; const fastExpect = expect.configure({ timeout: 1 }); test('pass', async ({ page }) => { const time = performance.now(); @@ -38,7 +38,7 @@ test('should configure timeout', async ({ runInlineTest }) => { test('should configure message', async ({ runInlineTest }) => { const result = await runInlineTest({ 'expect-test.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; const namedExpect = expect.configure({ message: 'x-foo must be visible' }); test('custom expect message', async ({page}) => { await namedExpect(page.locator('x-foo')).toBeVisible({timeout: 1}); @@ -55,7 +55,7 @@ test('should configure message', async ({ runInlineTest }) => { test('should prefer local message', async ({ runInlineTest }) => { const result = await runInlineTest({ 'expect-test.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; const namedExpect = expect.configure({ message: 'x-foo must be visible' }); test('custom expect message', async ({page}) => { await namedExpect(page.locator('x-foo'), { message: 'overridden' }).toBeVisible({timeout: 1}); @@ -73,7 +73,7 @@ test('should prefer local message', async ({ runInlineTest }) => { test('should configure soft', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; const softExpect = expect.configure({ soft: true }); test('should work', () => { softExpect(1+1).toBe(3); @@ -88,7 +88,7 @@ test('should configure soft', async ({ runInlineTest }) => { test('should chain configure', async ({ runInlineTest }) => { const result = await runInlineTest({ 'expect-test.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; const slowExpect = expect.configure({ timeout: 1 }); const slowAndSoftExpect = slowExpect.configure({ soft: true }); test('custom expect message', async ({page}) => { @@ -105,7 +105,7 @@ test('should chain configure', async ({ runInlineTest }) => { test('should cancel effect', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; const softExpect = expect.configure({ soft: true }); const normalExpect = expect.configure({ soft: false }); test('should work', () => { @@ -121,7 +121,7 @@ test('should cancel effect', async ({ runInlineTest }) => { test('should configure soft poll', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; const softExpect = expect.configure({ soft: true }); test('should fail', async () => { let probes = 0; @@ -141,7 +141,7 @@ test('should configure soft poll', async ({ runInlineTest }) => { test('should configure soft after poll', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('should pass', async () => { await expect.poll(() => true).toBe(true); expect.soft(1).toBe(1); diff --git a/tests/playwright-test/expect-poll.spec.ts b/tests/playwright-test/expect-poll.spec.ts index 208ac4ccce866..023cc2bc66eab 100644 --- a/tests/playwright-test/expect-poll.spec.ts +++ b/tests/playwright-test/expect-poll.spec.ts @@ -19,7 +19,7 @@ import { test, expect } from './playwright-test-fixtures'; test('should poll predicate', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('should poll sync predicate', async () => { let i = 0; await test.expect.poll(() => ++i).toBe(3); @@ -44,7 +44,7 @@ test('should poll predicate', async ({ runInlineTest }) => { test('should compile', async ({ runTSC }) => { const result = await runTSC({ 'a.spec.ts': ` - import { test, expect as baseExpect } from '@playwright/test'; + import { test, expect as baseExpect } from '@okep/test'; const expect = baseExpect.extend({ toBeWithinRange() { return { message: () => "is within range", pass: true }; }, }) @@ -75,7 +75,7 @@ test('should compile', async ({ runTSC }) => { test('should respect timeout', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('should fail', async () => { await test.expect.poll(() => false, { timeout: 100 }).toBe(3); }); @@ -92,7 +92,7 @@ test('should respect timeout', async ({ runInlineTest }) => { test('should fail when passed in non-function', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('should fail', async () => { await test.expect.poll(false).toBe(3); }); @@ -105,7 +105,7 @@ test('should fail when passed in non-function', async ({ runInlineTest }) => { test('should fail when used with web-first assertion', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('should fail', async ({ page }) => { await test.expect.poll(() => page.locator('body')).toHaveText('foo'); }); @@ -118,7 +118,7 @@ test('should fail when used with web-first assertion', async ({ runInlineTest }) test('should time out when running infinite predicate', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('should fail', async ({ page }) => { await test.expect.poll(() => new Promise(x => {}), { timeout: 100 }).toBe(42); }); @@ -131,7 +131,7 @@ test('should time out when running infinite predicate', async ({ runInlineTest } test('should show error that is thrown from predicate', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('should fail', async ({ page }) => { await test.expect.poll(() => { throw new Error('foo bar baz'); }, { timeout: 100 }).toBe(42); }); @@ -144,7 +144,7 @@ test('should show error that is thrown from predicate', async ({ runInlineTest } test('should not retry predicate that threw an error', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('should fail', async ({ page }) => { let iteration = 0; await test.expect.poll(() => { @@ -162,7 +162,7 @@ test('should not retry predicate that threw an error', async ({ runInlineTest }) test('should support .not predicate', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('should fail', async ({ page }) => { let i = 0; await test.expect.poll(() => ++i).not.toBeLessThan(3); @@ -176,7 +176,7 @@ test('should support .not predicate', async ({ runInlineTest }) => { test('should support custom matchers', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.spec.ts': ` - import { test, expect as baseExpect } from '@playwright/test'; + import { test, expect as baseExpect } from '@okep/test'; const expect = baseExpect.extend({ toBeWithinRange(received, floor, ceiling) { @@ -210,7 +210,7 @@ test('should support custom matchers', async ({ runInlineTest }) => { test('should respect interval', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('should fail', async () => { let probes = 0; const startTime = Date.now(); @@ -227,7 +227,7 @@ test('should respect interval', async ({ runInlineTest }) => { test('should show intermediate result for poll that spills over test time', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('should fail', async () => { await test.expect.poll(() => 3).toBe(2); }); @@ -241,7 +241,7 @@ test('should show intermediate result for poll that spills over test time', asyn test('should propagate promise rejections', { annotation: { type: 'issue', description: 'https://github.com/microsoft/playwright/issues/32256' } }, async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('should fail', async () => { await expect.poll(() => Promise.reject('some error')).toBe({ foo: 'baz' }); }); @@ -254,7 +254,7 @@ test('should propagate promise rejections', { annotation: { type: 'issue', descr test('should propagate string exception from async arrow function', { annotation: { type: 'issue', description: 'https://github.com/microsoft/playwright/issues/32256' } }, async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('should fail', async () => { await expect.poll(async () => { throw 'some error' }).toBe({ foo: 'baz' }); }); @@ -269,7 +269,7 @@ test('should show custom message', { }, async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('should fail', async () => { await expect.poll(() => 1, { message: 'custom message', timeout: 500 }).toBe(2); }); diff --git a/tests/playwright-test/expect-soft.spec.ts b/tests/playwright-test/expect-soft.spec.ts index c47d594e0e7c0..069fba063076b 100644 --- a/tests/playwright-test/expect-soft.spec.ts +++ b/tests/playwright-test/expect-soft.spec.ts @@ -19,7 +19,7 @@ import { test, expect } from './playwright-test-fixtures'; test('soft expects should compile', async ({ runTSC }) => { const result = await runTSC({ 'a.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('should work', () => { test.expect.soft(1+1).toBe(3); test.expect.soft(1+1, 'custom expect message').toBe(3); @@ -33,7 +33,7 @@ test('soft expects should compile', async ({ runTSC }) => { test('soft expects should work', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('should work', () => { test.expect.soft(1+1).toBe(3); console.log('%% woof-woof'); @@ -47,7 +47,7 @@ test('soft expects should work', async ({ runInlineTest }) => { test('should report a mixture of soft and non-soft errors', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('should work', ({}) => { test.expect.soft(1+1, 'one plus one').toBe(3); test.expect.soft(2*2, 'two times two').toBe(5); @@ -66,7 +66,7 @@ test('should report a mixture of soft and non-soft errors', async ({ runInlineTe test('testInfo should contain all soft expect errors', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('should work', ({}, testInfo) => { test.expect.soft(1+1, 'one plus one').toBe(3); test.expect.soft(2*2, 'two times two').toBe(5); diff --git a/tests/playwright-test/expect-to-pass.spec.ts b/tests/playwright-test/expect-to-pass.spec.ts index c3d16639db9ff..5e3836374a2ff 100644 --- a/tests/playwright-test/expect-to-pass.spec.ts +++ b/tests/playwright-test/expect-to-pass.spec.ts @@ -19,7 +19,7 @@ import { test, expect } from './playwright-test-fixtures'; test('should retry predicate', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('should toPass sync predicate', async () => { let i = 0; await test.expect(() => { @@ -44,7 +44,7 @@ test('should retry predicate', async ({ runInlineTest }) => { test('should respect timeout', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('should fail', async () => { await test.expect(() => { expect(1).toBe(2); @@ -63,7 +63,7 @@ test('should respect timeout', async ({ runInlineTest }) => { test('should not fail when used with web-first assertion', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('should fail', async ({ page }) => { let i = 0; await test.expect(async () => { @@ -80,7 +80,7 @@ test('should not fail when used with web-first assertion', async ({ runInlineTes test('should support .not predicate', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('should pass', async ({ page }) => { let i = 0; await test.expect(() => { @@ -97,7 +97,7 @@ test('should support .not predicate', async ({ runInlineTest }) => { test('should respect interval', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('should fail', async () => { let probes = 0; const startTime = Date.now(); @@ -117,7 +117,7 @@ test('should respect interval', async ({ runInlineTest }) => { test('should compile', async ({ runTSC }) => { const result = await runTSC({ 'a.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('should poll sync predicate', async ({ page }) => { let i = 0; test.expect(() => ++i).toPass(); @@ -139,7 +139,7 @@ test('should compile', async ({ runTSC }) => { test('should use custom message', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('should fail with custom message', async () => { await test.expect(() => { expect(1).toBe(3); @@ -155,7 +155,7 @@ test('should use custom message', async ({ runInlineTest }) => { test('should work with soft', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('should respect soft', async () => { await expect.soft(() => { expect(1).toBe(3); @@ -173,7 +173,7 @@ test('should work with soft', async ({ runInlineTest }) => { test('should not accept TimeoutError', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('should fail', async () => { await test.expect(() => {}).not.toPass({ timeout: 1 }); }); @@ -186,7 +186,7 @@ test('should not accept TimeoutError', async ({ runInlineTest }) => { test('should not spin forever', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; let log; test('spill toPass', async () => { expect(() => { @@ -208,7 +208,7 @@ test('should not spin forever', async ({ runInlineTest }) => { test('should show intermediate result for toPass that spills over test time', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('should fail', async () => { await expect(() => { expect(3).toBe(2); @@ -225,7 +225,7 @@ test('should respect timeout in config file when timeout parameter is not passed const result = await runInlineTest({ 'playwright.config.js': `module.exports = { expect: { toPass: { timeout: 100 } } }`, 'a.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('should fail', async () => { await test.expect(() => { expect(1).toBe(2); @@ -245,7 +245,7 @@ test('should give priority to timeout parameter over timeout in config file', as const result = await runInlineTest({ 'playwright.config.js': `module.exports = { expect: { toPass: { timeout: 100 } } }`, 'a.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('should fail', async () => { await test.expect(() => { expect(1).toBe(2); @@ -265,7 +265,7 @@ test('should respect intervals in config file when intervals parameter is not pa const result = await runInlineTest({ 'playwright.config.js': `module.exports = { expect: { toPass: { timeout: 2000, intervals: [100, 1000] } } }`, 'a.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('should fail', async () => { let attempt = 0; await test.expect(() => { @@ -284,7 +284,7 @@ test('should give priority to intervals parameter over intervals in config file' const result = await runInlineTest({ 'playwright.config.js': `module.exports = { expect: { toPass: { timeout: 2000, intervals: [100] } } }`, 'a.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('should fail', async () => { let attempt = 0; await test.expect(() => { diff --git a/tests/playwright-test/expect.spec.ts b/tests/playwright-test/expect.spec.ts index 4f0f831a3a17a..fd6c31f2c0319 100644 --- a/tests/playwright-test/expect.spec.ts +++ b/tests/playwright-test/expect.spec.ts @@ -21,7 +21,7 @@ const { spawnAsync } = require('../../packages/pw-recorder-core/lib/utils'); test('should not expand huge arrays', async ({ runInlineTest }) => { const result = await runInlineTest({ 'expect-test.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('numeric ranges', () => { const a1 = Array(100000).fill(1); const a2 = Array(100000).fill(1); @@ -38,7 +38,7 @@ test('should not expand huge arrays', async ({ runInlineTest }) => { test('should include custom expect message', async ({ runInlineTest }) => { const result = await runInlineTest({ 'expect-test.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('custom expect message', () => { test.expect(1+1, 'one plus one should be two!').toEqual(3); }); @@ -57,7 +57,7 @@ test('should include custom expect message', async ({ runInlineTest }) => { test('should include custom expect message with web-first assertions', async ({ runInlineTest }) => { const result = await runInlineTest({ 'expect-test.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('custom expect message', async ({page}) => { await expect(page.locator('x-foo'), { message: 'x-foo must be visible' }).toBeVisible({timeout: 1}); }); @@ -74,7 +74,7 @@ test('should include custom expect message with web-first assertions', async ({ test('should work with generic matchers', async ({ runTSC }) => { const result = await runTSC({ 'a.spec.ts': ` - import { expect } from '@playwright/test'; + import { expect } from '@okep/test'; expect(42).toBe(42); expect(0.1 + 0.2).toBeCloseTo(0.3, 5); expect(null).toBeDefined(); @@ -125,7 +125,7 @@ test('should work with generic matchers', async ({ runTSC }) => { test('should compile generic matchers', async ({ runTSC }) => { const result = await runTSC({ 'a.spec.ts': ` - import { expect } from '@playwright/test'; + import { expect } from '@okep/test'; expect(42).toBe(42); expect(42).toBeCloseTo(42); expect(42).toBeCloseTo(42, 5); @@ -192,7 +192,7 @@ test('should compile generic matchers', async ({ runTSC }) => { test('should work when passing a ReadonlyArray', async ({ runTSC }) => { const result = await runTSC({ 'a.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('example', async ({ page }) => { const readonlyArray: ReadonlyArray = ['1', '2', '3']; expect(page.locator('.foo')).toHaveText(readonlyArray); @@ -206,7 +206,7 @@ test('should work when passing a ReadonlyArray', async ({ runTSC }) => { test('should work with expect message', async ({ runTSC }) => { const result = await runTSC({ 'a.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test.expect(42, 'this is expect message').toBe(42); ` }); @@ -216,7 +216,7 @@ test('should work with expect message', async ({ runTSC }) => { test('should work with default expect matchers and esModuleInterop=false', async ({ runTSC }) => { const result = await runTSC({ 'a.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test.expect(42).toBe(42); `, 'tsconfig.json': JSON.stringify({ @@ -251,7 +251,7 @@ test('should work with custom PlaywrightTest namespace', async ({ runTSC }) => { } `, 'a.spec.ts': ` - import { test, expect, type Page, type APIResponse } from '@playwright/test'; + import { test, expect, type Page, type APIResponse } from '@okep/test'; test.expect.extend({ toBeWithinRange() { return { @@ -286,7 +286,7 @@ test('should work with custom PlaywrightTest namespace', async ({ runTSC }) => { test('should propose only the relevant matchers when custom expect matcher classes were passed', async ({ runTSC }) => { const result = await runTSC({ 'a.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('custom matchers', async ({ page }) => { // Page-specific assertions apply to Page. await test.expect(page).toHaveURL('https://example.com'); @@ -370,7 +370,7 @@ test('should propose only the relevant matchers when custom expect matcher class test('should return void/Promise when appropriate', async ({ runTSC }) => { const result = await runTSC({ 'a.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; type AssertType = S extends T ? AssertNotAny : false; type AssertNotAny = {notRealProperty: number} extends S ? false : true; @@ -414,7 +414,7 @@ test.describe('helpful expect errors', () => { test('top-level', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('explodes', () => { expect(1).nope(); }); @@ -427,7 +427,7 @@ test.describe('helpful expect errors', () => { test('soft', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('explodes', () => { expect.soft(1).nope(); }); @@ -440,7 +440,7 @@ test.describe('helpful expect errors', () => { test('poll', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('explodes', () => { expect.poll(() => {}).nope(); }); @@ -453,7 +453,7 @@ test.describe('helpful expect errors', () => { test('not', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('explodes', () => { expect(1).not.nope(); }); @@ -466,7 +466,7 @@ test.describe('helpful expect errors', () => { test('bare', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('explodes', () => { expect(''); }); @@ -484,7 +484,7 @@ test('should reasonably work in global setup', async ({ runInlineTest }) => { export default { globalSetup: './global-setup' }; `, 'global-setup.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; export default async () => { expect(1).toBe(1); await expect.poll(async () => { @@ -495,7 +495,7 @@ test('should reasonably work in global setup', async ({ runInlineTest }) => { }; `, 'a.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('skipped', () => {}); `, }); @@ -508,7 +508,7 @@ test('should support toHaveURL with baseURL from webServer', async ({ runInlineT const port = testInfo.workerIndex + 10500; const result = await runInlineTest({ 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('pass', async ({ page }) => { await page.goto('/foobar'); @@ -542,7 +542,7 @@ test('should respect expect.timeout', async ({ runInlineTest }) => { const result = await runInlineTest({ 'playwright.config.js': `module.exports = { expect: { timeout: 1000 } }`, 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('timeout', async ({ page }) => { await page.goto('data:text/html,
A
'); @@ -559,7 +559,7 @@ test('should respect expect.timeout', async ({ runInlineTest }) => { test('should log scale the time', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('pass', async ({ page }) => { await page.setContent('
Wrong
'); @@ -580,7 +580,7 @@ test('should log scale the time', async ({ runInlineTest }) => { test('should print expected/received before timeout', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('times out waiting for text', async ({ page }) => { await page.setContent('
Text content
'); @@ -599,7 +599,7 @@ test('should print expected/received before timeout', async ({ runInlineTest }) test('should print pending operations for toHaveText', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('fail', async ({ page }) => { await page.setContent('
Text content
'); @@ -621,7 +621,7 @@ test('should print expected/received on Ctrl+C', async ({ interactWithTestRunner const testProcess = await interactWithTestRunner({ 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('times out waiting for text', async ({ page }) => { await page.setContent('
Text content
'); @@ -647,7 +647,7 @@ test('should print expected/received on Ctrl+C', async ({ interactWithTestRunner test('should not print timed out error message when test times out', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('fail', async ({ page }) => { await page.setContent('
Text content
'); @@ -666,7 +666,7 @@ test('should not print timed out error message when test times out', async ({ ru test('should not leak long expect message strings', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; let logs: string = 'Ab'; const consoleLogWatcher = (msg: ConsoleMessage) => { @@ -692,8 +692,8 @@ test('should not leak long expect message strings', async ({ runInlineTest }) => test('should chain expect matchers and expose matcher utils (TSC)', async ({ runTSC }) => { const result = await runTSC({ 'a.spec.ts': ` - import { test, expect as baseExpect } from '@playwright/test'; - import type { Page, Locator, ExpectMatcherState, Expect } from '@playwright/test'; + import { test, expect as baseExpect } from '@okep/test'; + import type { Page, Locator, ExpectMatcherState, Expect } from '@okep/test'; function callLogText(log: string[] | undefined): string { if (!log) @@ -779,8 +779,8 @@ test('should chain expect matchers and expose matcher utils (TSC)', async ({ run test('should chain expect matchers and expose matcher utils', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.spec.ts': ` - import { test, expect as baseExpect } from '@playwright/test'; - import type { Page, Locator } from '@playwright/test'; + import { test, expect as baseExpect } from '@okep/test'; + import type { Page, Locator } from '@okep/test'; function callLogText(log: string[] | undefined): string { if (!log) @@ -849,7 +849,7 @@ test('should chain expect matchers and expose matcher utils', async ({ runInline test('should support toHaveAttribute without optional value', async ({ runTSC }) => { const result = await runTSC({ 'a.spec.ts': ` - import { test, expect as baseExpect } from '@playwright/test'; + import { test, expect as baseExpect } from '@okep/test'; test('custom matchers', async ({ page }) => { const locator = page.locator('#node'); await test.expect(locator).toHaveAttribute('name', 'value'); @@ -869,8 +869,8 @@ test('should support toHaveAttribute without optional value', async ({ runTSC }) test('should support mergeExpects (TSC)', async ({ runTSC }) => { const result = await runTSC({ 'a.spec.ts': ` - import { test, mergeExpects, expect as baseExpect } from '@playwright/test'; - import type { Page } from '@playwright/test'; + import { test, mergeExpects, expect as baseExpect } from '@okep/test'; + import type { Page } from '@okep/test'; const expect1 = baseExpect.extend({ async toBeAGoodPage(page: Page, x: number) { @@ -904,8 +904,8 @@ test('should support mergeExpects (TSC)', async ({ runTSC }) => { test('should support mergeExpects', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.spec.ts': ` - import { test, mergeExpects, expect as baseExpect } from '@playwright/test'; - import type { Page } from '@playwright/test'; + import { test, mergeExpects, expect as baseExpect } from '@okep/test'; + import type { Page } from '@okep/test'; const expect1 = baseExpect.extend({ async toBeAGoodPage(page: Page, x: number) { @@ -935,7 +935,7 @@ test('should respect timeout from configured expect when used outside of the tes const files = { 'script.mjs': ` - import { test, expect as baseExpect, chromium } from '@playwright/test'; + import { test, expect as baseExpect, chromium } from '@okep/test'; const configuredExpect = baseExpect.configure({ timeout: 10, @@ -974,8 +974,8 @@ test('should expose timeout to custom matchers', async ({ runInlineTest, runTSC }; `, 'a.test.ts': ` - import type { ExpectMatcherState, MatcherReturnType } from '@playwright/test'; - import { test, expect as base } from '@playwright/test'; + import type { ExpectMatcherState, MatcherReturnType } from '@okep/test'; + import { test, expect as base } from '@okep/test'; const expect = base.extend({ assertTimeout(page: any, value: number) { @@ -1008,7 +1008,7 @@ test('should expose timeout to custom matchers', async ({ runInlineTest, runTSC test('should throw error when using .equals()', async ({ runInlineTest }) => { const result = await runInlineTest({ 'helper.ts': ` - import { test as base, expect as baseExpect } from '@playwright/test'; + import { test as base, expect as baseExpect } from '@okep/test'; export const expect = baseExpect.extend({ toBeWithinRange(received, floor, ceiling) { this.equals(1, 2); @@ -1032,7 +1032,7 @@ test('should throw error when using .equals()', async ({ runInlineTest }) => { test('expect.extend should be immutable', async ({ runInlineTest }) => { const result = await runInlineTest({ 'expect-test.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; const expectFoo = expect.extend({ toFoo() { console.log('%%foo'); @@ -1073,7 +1073,7 @@ test('expect.extend should be immutable', async ({ runInlineTest }) => { test('expect.extend should fall back to legacy behavior', async ({ runInlineTest }) => { const result = await runInlineTest({ 'expect-test.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; expect.extend({ toFoo() { console.log('%%foo'); @@ -1107,7 +1107,7 @@ test('expect.extend should fall back to legacy behavior', async ({ runInlineTest test('custom asymmetric matchers should work with expect.extend', async ({ runInlineTest }) => { const result = await runInlineTest({ 'expect-test.spec.ts': ` - import { test, expect as baseExpect, mergeExpects } from '@playwright/test'; + import { test, expect as baseExpect, mergeExpects } from '@okep/test'; const expect1 = baseExpect.extend({ isFoo(received: unknown, expected: string) { return { pass: received === 'foo', message: () => '' }; diff --git a/tests/playwright-test/find-related-tests.spec.ts b/tests/playwright-test/find-related-tests.spec.ts index 077e80551239e..21454c3ee5015 100644 --- a/tests/playwright-test/find-related-tests.spec.ts +++ b/tests/playwright-test/find-related-tests.spec.ts @@ -19,7 +19,7 @@ import { test, expect } from './playwright-test-fixtures'; test('should list related tests', async ({ runCLICommand }) => { const result = await runCLICommand({ 'pw-recorder.config.ts': ` - import { defineConfig } from '@playwright/test'; + import { defineConfig } from '@okep/test'; export default defineConfig({}); `, 'helper.ts': ` @@ -29,13 +29,13 @@ test('should list related tests', async ({ runCLICommand }) => { export { value } from './helper'; `, 'a.spec.ts': ` - import { test } from '@playwright/test'; + import { test } from '@okep/test'; import { value } from './helper2'; if (value) {} test('', () => {}); `, 'b.spec.ts': ` - import { test } from '@playwright/test'; + import { test } from '@okep/test'; import { value } from './helper'; if (value) {} test('', () => {}); @@ -55,7 +55,7 @@ test('should list related tests', async ({ runCLICommand }) => { test('should list related tests for ct', async ({ runCLICommand }) => { const result = await runCLICommand({ 'playwright.config.ts': ` - import { defineConfig } from '@playwright/experimental-ct-react'; + import { defineConfig } from '@okep/experimental-ct-react'; export default defineConfig({}); `, 'playwright/index.html': ``, @@ -68,7 +68,7 @@ test('should list related tests for ct', async ({ runCLICommand }) => { export const Button = () => Click me; `, 'button.spec.tsx': ` - import { test } from '@playwright/experimental-ct-react'; + import { test } from '@okep/experimental-ct-react'; import { Button } from './button'; test('foo', async ({ mount }) => { await mount(); @@ -779,7 +779,7 @@ test('should resolve .js import to .tsx file in non-ESM mode for components', as test('should import export assignment from ts', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; import number from './utils.js'; test('pass', () => { expect(number).toBe(1); @@ -796,7 +796,7 @@ test('should import export assignment from ts', async ({ runInlineTest }) => { test('should resolve no-extension import to .ts file in non-ESM mode', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; import { gimmeAOne } from './playwright-utils'; test('pass', ({}) => { expect(gimmeAOne()).toBe(1); @@ -815,7 +815,7 @@ test('should resolve no-extension import to .ts file in non-ESM mode', async ({ test('should resolve no-extension import to .tsx file in non-ESM mode', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; import { gimmeAOne } from './playwright-utils'; test('pass', ({}) => { expect(gimmeAOne()).toBe(1); @@ -834,7 +834,7 @@ test('should resolve no-extension import to .tsx file in non-ESM mode', async ({ test('should resolve no-extension import to .jsx file in non-ESM mode', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; import { gimmeAOne } from './playwright-utils'; test('pass', ({}) => { expect(gimmeAOne()).toBe(1); @@ -853,7 +853,7 @@ test('should resolve no-extension import to .jsx file in non-ESM mode', async ({ test('should not resolve .mjs import to .ts file in non-ESM mode', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; import { gimmeAOne } from './playwright-utils.mjs'; test('pass', ({}) => { expect(gimmeAOne()).toBe(1); @@ -873,7 +873,7 @@ test('should resolve absolute .js import to .ts file', async ({ runInlineTest }) const filePath = test.info().outputPath('playwright-utils.js'); const result = await runInlineTest({ 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; import { gimmeAOne } from ${JSON.stringify(filePath)}; test('pass', ({}) => { expect(gimmeAOne()).toBe(1); @@ -895,7 +895,7 @@ test('should resolve no-extension import of module into .ts file', async ({ runI exports.foo = 42; `, 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; import { gimmeAOne } from './playwright-utils'; test('pass', ({}) => { expect(gimmeAOne()).toBe(1); @@ -927,7 +927,7 @@ test('should support node imports', async ({ runInlineTest }) => { } `, 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; import { utilityModuleThatImportsNodeModule } from './utils.mjs'; test('pass', async () => { @@ -942,7 +942,7 @@ test('should support node imports', async ({ runInlineTest }) => { test('should complain when one test file imports another', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; import { foo } from './b.test'; test('pass1', async () => { @@ -950,7 +950,7 @@ test('should complain when one test file imports another', async ({ runInlineTes }); `, 'b.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; export const foo = 'foo'; test('pass2', async () => { @@ -981,7 +981,7 @@ test('should support dynamic imports and requires of js, ts from js, ts and cjs' module.exports.load = () => import('./helper2'); `, 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('pass', async () => { const { foo } = await import('./helper'); @@ -992,7 +992,7 @@ test('should support dynamic imports and requires of js, ts from js, ts and cjs' }); `, 'b.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; import { load } from './passthrough.cjs'; test('pass', async () => { @@ -1004,7 +1004,7 @@ test('should support dynamic imports and requires of js, ts from js, ts and cjs' }); `, 'c.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('pass', async () => { const { foo } = await import('./helper'); @@ -1012,7 +1012,7 @@ test('should support dynamic imports and requires of js, ts from js, ts and cjs' }); `, 'd.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('pass', async () => { const { foo } = require('./helper4'); @@ -1038,7 +1038,7 @@ test('should support dynamic imports of esm-only packages', async ({ runInlineTe `, 'package.json': `{ "name": "test-project" }`, 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('pass', async () => { const { foo } = await import('foo-pkg'); @@ -1053,7 +1053,7 @@ test('should support dynamic imports of esm-only packages', async ({ runInlineTe test('should allow test.extend.ts and test.ts files', async ({ runInlineTest }) => { const result = await runInlineTest({ 'test.extend.ts': ` - export { test, expect } from '@playwright/test'; + export { test, expect } from '@okep/test'; `, 'test.ts': ` export const helper = 42; @@ -1077,7 +1077,7 @@ test('should remove import css', async ({ runInlineTest }) => { import foo from './index.css'; import { bar } from './index.css'; - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('pass', async () => {}); `, }); diff --git a/tests/playwright-test/match-grep.spec.ts b/tests/playwright-test/match-grep.spec.ts index 357c897bcd7be..b041454aabe6f 100644 --- a/tests/playwright-test/match-grep.spec.ts +++ b/tests/playwright-test/match-grep.spec.ts @@ -18,7 +18,7 @@ import { test, expect } from './playwright-test-fixtures'; const files = { 'match-grep/b.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('test AA', () => { expect(1 + 1).toBe(2); }); @@ -32,7 +32,7 @@ const files = { }); `, 'match-grep/fdir/c.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('test AA', () => { expect(1 + 1).toBe(2); }); @@ -46,7 +46,7 @@ const files = { }); `, 'match-grep/adir/a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('test AA', () => { expect(1 + 1).toBe(2); }); diff --git a/tests/playwright-test/max-failures.spec.ts b/tests/playwright-test/max-failures.spec.ts index fed320b8267f4..34abc95a341ef 100644 --- a/tests/playwright-test/max-failures.spec.ts +++ b/tests/playwright-test/max-failures.spec.ts @@ -19,7 +19,7 @@ import { test, expect } from './playwright-test-fixtures'; test('max-failures should work', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.spec.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; for (let i = 0; i < 10; ++i) { test('fail_' + i, () => { expect(true).toBe(false); @@ -27,7 +27,7 @@ test('max-failures should work', async ({ runInlineTest }) => { } `, 'b.spec.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; for (let i = 0; i < 10; ++i) { test('fail_' + i, () => { expect(true).toBe(false); @@ -43,7 +43,7 @@ test('max-failures should work', async ({ runInlineTest }) => { test('-x should work', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.spec.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; for (let i = 0; i < 10; ++i) { test('fail_' + i, () => { expect(true).toBe(false); @@ -51,7 +51,7 @@ test('-x should work', async ({ runInlineTest }) => { } `, 'b.spec.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; for (let i = 0; i < 10; ++i) { test('fail_' + i, () => { expect(true).toBe(false); @@ -67,7 +67,7 @@ test('-x should work', async ({ runInlineTest }) => { test('max-failures should work with retries', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.spec.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; for (let i = 0; i < 10; ++i) { test('fail_' + i, () => { expect(true).toBe(false); @@ -83,7 +83,7 @@ test('max-failures should work with retries', async ({ runInlineTest }) => { test('max-failures should stop workers', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.spec.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('passed', async () => { await new Promise(f => setTimeout(f, 2000)); }); @@ -92,7 +92,7 @@ test('max-failures should stop workers', async ({ runInlineTest }) => { }); `, 'b.spec.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('passed short', async () => { await new Promise(f => setTimeout(f, 1)); }); @@ -124,7 +124,7 @@ test('max-failures should properly shutdown', async ({ runInlineTest }) => { export default config; `, 'test1.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test.describe('spec 1', () => { test('test 1', async () => { expect(false).toBeTruthy() @@ -132,7 +132,7 @@ test('max-failures should properly shutdown', async ({ runInlineTest }) => { }); `, 'test2.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test.describe('spec 2', () => { test('test 2', () => { expect(true).toBeTruthy() @@ -163,7 +163,7 @@ test('max-failures should work across phases', async ({ runInlineTest }) => { export default config; `, 'example.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('test', () => { const project = test.info().project.name; console.log('running ' + project); @@ -191,7 +191,7 @@ test('max-failures should not consider retries as failures', async ({ runInlineT }; `, 'example.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('I fail 9 times 1', () => { if (test.info().retry < 9) diff --git a/tests/playwright-test/only-changed.spec.ts b/tests/playwright-test/only-changed.spec.ts index b632ba262ac54..e9bd0e986da2e 100644 --- a/tests/playwright-test/only-changed.spec.ts +++ b/tests/playwright-test/only-changed.spec.ts @@ -37,11 +37,11 @@ test.slow(); test('should detect untracked files', async ({ runInlineTest, git, writeFiles }) => { await writeFiles({ 'a.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('fails', () => { expect(1).toBe(2); }); `, 'b.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('fails', () => { expect(1).toBe(2); }); `, }); @@ -51,7 +51,7 @@ test('should detect untracked files', async ({ runInlineTest, git, writeFiles }) const result = await runInlineTest({ 'c.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('fails', () => { expect(1).toBe(2); }); ` }, { 'only-changed': true }); @@ -66,11 +66,11 @@ test('should detect untracked files', async ({ runInlineTest, git, writeFiles }) test('should detect changed files', async ({ runInlineTest, git, writeFiles }) => { await writeFiles({ 'a.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('fails', () => { expect(1).toBe(2); }); `, 'b.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('fails', () => { expect(1).toBe(2); }); `, }); @@ -80,7 +80,7 @@ test('should detect changed files', async ({ runInlineTest, git, writeFiles }) = const result = await runInlineTest({ 'b.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('fails', () => { expect(1).toBe(3); }); `, }, { 'only-changed': true }); @@ -94,11 +94,11 @@ test('should detect changed files', async ({ runInlineTest, git, writeFiles }) = test('should diff based on base commit', async ({ runInlineTest, git, writeFiles }) => { await writeFiles({ 'a.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('fails', () => { expect(1).toBe(2); }); `, 'b.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('fails', () => { expect(1).toBe(2); }); `, }); @@ -108,7 +108,7 @@ test('should diff based on base commit', async ({ runInlineTest, git, writeFiles await writeFiles({ 'b.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('fails', () => { expect(1).toBe(3); }); `, }); @@ -124,17 +124,17 @@ test('should diff based on base commit', async ({ runInlineTest, git, writeFiles test('should understand dependency structure', async ({ runInlineTest, git, writeFiles }) => { await writeFiles({ 'a.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; import { answer, question } from './utils'; test('fails', () => { expect(question).toBe(answer); }); `, 'b.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; import { answer, question } from './utils'; test('fails', () => { expect(question).toBe(answer); }); `, 'c.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('fails', () => { expect(1).toBe(2); }); `, 'utils.ts': ` @@ -199,7 +199,7 @@ test('should suppport component tests', async ({ runInlineTest, git, writeFiles export { Button } from "./button"; `, 'src/button.test.tsx': ` - import { test, expect } from '@playwright/experimental-ct-react'; + import { test, expect } from '@okep/experimental-ct-react'; import { Button } from './helper'; test('pass', async ({ mount }) => { @@ -208,7 +208,7 @@ test('should suppport component tests', async ({ runInlineTest, git, writeFiles }); `, 'src/button2.test.tsx': ` - import { test, expect } from '@playwright/experimental-ct-react'; + import { test, expect } from '@okep/experimental-ct-react'; import { Button } from './helper'; test('pass', async ({ mount }) => { @@ -217,7 +217,7 @@ test('should suppport component tests', async ({ runInlineTest, git, writeFiles }); `, 'src/button3.test.tsx': ` - import { test, expect } from '@playwright/experimental-ct-react'; + import { test, expect } from '@okep/experimental-ct-react'; test('pass', async ({ mount }) => { const component = await mount(

Hello World

); @@ -237,7 +237,7 @@ test('should suppport component tests', async ({ runInlineTest, git, writeFiles const result2 = await runInlineTest({ 'src/button2.test.tsx': ` - import { test, expect } from '@playwright/experimental-ct-react'; + import { test, expect } from '@okep/experimental-ct-react'; import { Button } from './helper'; test('pass', async ({ mount }) => { @@ -271,11 +271,11 @@ test.describe('should work the same if being called in subdirectory', () => { test('tracked file', async ({ runInlineTest, git, writeFiles }) => { await writeFiles({ 'a.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('fails', () => { expect(1).toBe(2); }); `, 'b.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('fails', () => { expect(1).toBe(2); }); `, }); @@ -285,7 +285,7 @@ test.describe('should work the same if being called in subdirectory', () => { await writeFiles({ 'tests/c.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('fails', () => { expect(1).toBe(2); }); ` }); @@ -294,7 +294,7 @@ test.describe('should work the same if being called in subdirectory', () => { const result = await runInlineTest({ 'tests/c.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('fails', () => { expect(1).toBe(3); }); ` }, { 'only-changed': true }, {}, { cwd: 'tests' }); @@ -308,11 +308,11 @@ test.describe('should work the same if being called in subdirectory', () => { test('untracked file', async ({ runInlineTest, git, writeFiles }) => { await writeFiles({ 'a.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('fails', () => { expect(1).toBe(2); }); `, 'b.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('fails', () => { expect(1).toBe(2); }); `, }); @@ -322,7 +322,7 @@ test.describe('should work the same if being called in subdirectory', () => { const result = await runInlineTest({ 'tests/c.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('fails', () => { expect(1).toBe(3); }); ` }, { 'only-changed': true }, {}, { cwd: 'tests' }); @@ -356,18 +356,18 @@ test('should run project dependencies of changed tests', { }; `, 'setup.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('setup test', async ({ page }) => { console.log('setup test is executed') }); `, 'a.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('fails', () => { expect(1).toBe(2); }); `, 'b.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('fails', () => { expect(1).toBe(2); }); `, }); @@ -377,7 +377,7 @@ test('should run project dependencies of changed tests', { const result = await runInlineTest({ 'c.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('fails', () => { expect(1).toBe(2); }); ` }, { 'only-changed': true }); @@ -392,7 +392,7 @@ test('should run project dependencies of changed tests', { test('should work with list mode', async ({ runInlineTest, git, writeFiles }) => { await writeFiles({ 'a.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('fails', () => { expect(1).toBe(2); }); `, }); @@ -402,7 +402,7 @@ test('should work with list mode', async ({ runInlineTest, git, writeFiles }) => const result = await runInlineTest({ 'b.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('fails', () => { expect(1).toBe(2); }); ` }, { 'only-changed': true, 'list': true }); @@ -415,7 +415,7 @@ test('should work with list mode', async ({ runInlineTest, git, writeFiles }) => test('exits successfully if there are no changes', async ({ runInlineTest, git, writeFiles }) => { await writeFiles({ 'a.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('fails', () => { expect(1).toBe(2); }); `, }); diff --git a/tests/playwright-test/override-timeout.spec.ts b/tests/playwright-test/override-timeout.spec.ts index 19f8867f8dc42..7d52d4f478e3d 100644 --- a/tests/playwright-test/override-timeout.spec.ts +++ b/tests/playwright-test/override-timeout.spec.ts @@ -22,7 +22,7 @@ test('should consider dynamically set value', async ({ runInlineTest }) => { module.exports = { timeout: 2000 }; `, 'a.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('pass', ({}, testInfo) => { expect(testInfo.timeout).toBe(2000); }) @@ -41,7 +41,7 @@ test('should allow different timeouts', async ({ runInlineTest }) => { ] }; `, 'a.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('pass', ({}, testInfo) => { console.log('timeout:' + testInfo.timeout); }); @@ -59,7 +59,7 @@ test('should prioritize value set via command line', async ({ runInlineTest }) = module.exports = { timeout: 2000 }; `, 'a.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('pass', ({}, testInfo) => { expect(testInfo.timeout).toBe(1000); }) diff --git a/tests/playwright-test/playwright-test-fixtures.ts b/tests/playwright-test/playwright-test-fixtures.ts index 78acb6bafee77..3c33bc48144aa 100644 --- a/tests/playwright-test/playwright-test-fixtures.ts +++ b/tests/playwright-test/playwright-test-fixtures.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import type { JSONReport, JSONReportSpec, JSONReportSuite, JSONReportTest, JSONReportTestResult } from '@playwright/test/reporter'; +import type { JSONReport, JSONReportSpec, JSONReportSuite, JSONReportTest, JSONReportTestResult } from '@okep/test/reporter'; import * as fs from 'fs'; import * as os from 'os'; import * as path from 'path'; @@ -145,7 +145,7 @@ async function runPlaywrightTest(childProcess: CommonFixtures['childProcess'], b const reportFile = path.join(baseDir, 'report.json'); // When we have useIntermediateMergeReport, we want the JSON reporter only at the merge step. const envWithJsonReporter = { - PW_TEST_REPORTER: path.join(__dirname, '../../packages/playwright/lib/reporters/json.js'), + PW_TEST_REPORTER: path.join(__dirname, '../../packages/pw-recorder/lib/reporters/json.js'), PLAYWRIGHT_JSON_OUTPUT_NAME: reportFile, ...env, }; @@ -472,7 +472,7 @@ export function parseTestRunnerOutput(output: string) { } export const playwrightCtConfigText = ` -import { defineConfig } from '@playwright/experimental-ct-react'; +import { defineConfig } from '@okep/experimental-ct-react'; export default defineConfig({ use: { ctPort: ${3200 + (+process.env.TEST_PARALLEL_INDEX)} diff --git a/tests/playwright-test/playwright.artifacts.spec.ts b/tests/playwright-test/playwright.artifacts.spec.ts index b666aa4b70e6d..54647b6a7a6a8 100644 --- a/tests/playwright-test/playwright.artifacts.spec.ts +++ b/tests/playwright-test/playwright.artifacts.spec.ts @@ -35,7 +35,7 @@ const testFiles = { import os from 'os'; import path from 'path'; - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test.describe('shared', () => { let page; @@ -195,7 +195,7 @@ test('should work with screenshot: only-on-failure', async ({ runInlineTest }, t test('should work with screenshot: only-on-failure & fullPage', async ({ runInlineTest, server }, testInfo) => { const result = await runInlineTest({ 'artifacts.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('should fail and take fullPage screenshots', async ({ page }) => { await page.setViewportSize({ width: 500, height: 500 }); @@ -377,7 +377,7 @@ test('should take screenshot when page is closed in afterEach', async ({ runInli module.exports = { use: { screenshot: 'on' } }; `, 'a.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test.afterEach(async ({ page }) => { await page.close(); diff --git a/tests/playwright-test/playwright.config.spec.ts b/tests/playwright-test/playwright.config.spec.ts index 651cee0fd049d..5cccd841f552e 100644 --- a/tests/playwright-test/playwright.config.spec.ts +++ b/tests/playwright-test/playwright.config.spec.ts @@ -29,7 +29,7 @@ test('should fall back to launchOptions', async ({ runInlineTest }) => { }; `, 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('pass', async ({ headless, channel }) => { expect.soft(headless).toBe(false); expect.soft(channel).toBe('chrome'); @@ -56,7 +56,7 @@ test('should override launchOptions', async ({ runInlineTest }) => { }; `, 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('pass', async ({ headless, channel }) => { expect.soft(headless).toBe(false); expect.soft(channel).toBe('chrome'); @@ -94,7 +94,7 @@ test('should respect contextOptions', async ({ runInlineTest }) => { }; `, 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('pass', async ({ acceptDownloads, bypassCSP, colorScheme, deviceScaleFactor, extraHTTPHeaders, hasTouch, ignoreHTTPSErrors, isMobile, javaScriptEnabled, locale, offline, permissions, timezoneId, userAgent, viewport }) => { expect.soft(acceptDownloads).toBe(false); expect.soft(bypassCSP).toBe(true); @@ -160,7 +160,7 @@ test('should override contextOptions', async ({ runInlineTest }) => { }; `, 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('pass', async ({ acceptDownloads, bypassCSP, colorScheme, deviceScaleFactor, extraHTTPHeaders, hasTouch, ignoreHTTPSErrors, isMobile, javaScriptEnabled, locale, offline, permissions, timezoneId, userAgent, viewport }) => { expect.soft(acceptDownloads).toBe(false); expect.soft(bypassCSP).toBe(true); @@ -195,7 +195,7 @@ test('should respect testIdAttribute', async ({ runInlineTest }) => { }; `, 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('pass', async ({ page }) => { await page.setContent('
Hi
'); await expect(page.getByTestId('myid')).toHaveCount(1); diff --git a/tests/playwright-test/playwright.connect.spec.ts b/tests/playwright-test/playwright.connect.spec.ts index 083a01ac5e87a..781e8ce0b30b7 100644 --- a/tests/playwright-test/playwright.connect.spec.ts +++ b/tests/playwright-test/playwright.connect.spec.ts @@ -38,7 +38,7 @@ test('should work with connectOptions', async ({ runInlineTest }) => { }; `, 'global-setup.ts': ` - import { chromium } from '@playwright/test'; + import { chromium } from '@okep/test'; module.exports = async () => { process.env.DEBUG = 'pw:browser'; process.env.PWTEST_SERVER_WS_HEADERS = @@ -52,7 +52,7 @@ test('should work with connectOptions', async ({ runInlineTest }) => { }; `, 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test.use({ locale: 'fr-CH' }); test('pass', async ({ page }) => { await page.setContent('
PASS
'); @@ -91,7 +91,7 @@ test('should throw with bad connectOptions', async ({ runInlineTest }) => { }; `, 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('pass', async ({ page }) => { await page.setContent('
PASS
'); await expect(page.locator('div')).toHaveText('PASS'); @@ -117,7 +117,7 @@ test('should respect connectOptions.timeout', async ({ runInlineTest }) => { }; `, 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('pass', async ({ page }) => { }); `, @@ -140,7 +140,7 @@ test('should print debug log when failed to connect', async ({ runInlineTest }) }; `, 'global-setup.ts': ` - import { chromium } from '@playwright/test'; + import { chromium } from '@okep/test'; import ws from 'ws'; import http from 'http'; module.exports = async () => { @@ -156,7 +156,7 @@ test('should print debug log when failed to connect', async ({ runInlineTest }) }; `, 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('fail', async ({ page }) => { await page.setContent('
FAIL
'); }); diff --git a/tests/playwright-test/playwright.ct-build.spec.ts b/tests/playwright-test/playwright.ct-build.spec.ts index d535149c1d2f5..7898dfa88b4ad 100644 --- a/tests/playwright-test/playwright.ct-build.spec.ts +++ b/tests/playwright-test/playwright.ct-build.spec.ts @@ -27,7 +27,7 @@ test('should work with the empty component list', async ({ runInlineTest }, test 'playwright/index.js': ``, 'a.test.ts': ` - import { test, expect } from '@playwright/experimental-ct-react'; + import { test, expect } from '@okep/experimental-ct-react'; test('pass', async ({ mount }) => {}); `, }, { workers: 1 }); @@ -72,7 +72,7 @@ test('should extract component list', async ({ runInlineTest }, testInfo) => { `, 'src/one-import.spec.tsx': ` - import { test, expect } from '@playwright/experimental-ct-react'; + import { test, expect } from '@okep/experimental-ct-react'; import { Button } from './button'; test('pass', async ({ mount }) => { const component = await mount(); @@ -81,7 +81,7 @@ test('should extract component list', async ({ runInlineTest }, testInfo) => { `, 'src/named-imports.spec.tsx': ` - import { test, expect } from '@playwright/experimental-ct-react'; + import { test, expect } from '@okep/experimental-ct-react'; import { Component1, Component2 } from './components'; test('pass 1', async ({ mount }) => { @@ -96,7 +96,7 @@ test('should extract component list', async ({ runInlineTest }, testInfo) => { `, 'src/default-import.spec.tsx': ` - import { test, expect } from '@playwright/experimental-ct-react'; + import { test, expect } from '@okep/experimental-ct-react'; import DefaultComponent from './defaultExport'; test('named', async ({ mount }) => { @@ -106,7 +106,7 @@ test('should extract component list', async ({ runInlineTest }, testInfo) => { `, 'src/clashing-imports.spec.tsx': ` - import { test, expect } from '@playwright/experimental-ct-react'; + import { test, expect } from '@okep/experimental-ct-react'; import DefaultComponent from './defaultExport.tsx'; import { ClashingName as CN1 } from './clashingNames1'; @@ -126,7 +126,7 @@ test('should extract component list', async ({ runInlineTest }, testInfo) => { export default () => ; `, 'src/relative-import-different-folders/one/one.spec.tsx': ` - import { test, expect } from '@playwright/experimental-ct-react'; + import { test, expect } from '@okep/experimental-ct-react'; import Button from '.'; test('pass', async ({ mount }) => { const component = await mount(); @@ -137,7 +137,7 @@ test('should extract component list', async ({ runInlineTest }, testInfo) => { export default () => ; `, 'src/relative-import-different-folders/two/two.spec.tsx': ` - import { test, expect } from '@playwright/experimental-ct-react'; + import { test, expect } from '@okep/experimental-ct-react'; import Button from '.'; test('pass', async ({ mount }) => { const component = await mount(); @@ -240,7 +240,7 @@ test('should cache build', async ({ runInlineTest }, testInfo) => { `, 'src/button.test.tsx': ` - import { test, expect } from '@playwright/experimental-ct-react'; + import { test, expect } from '@okep/experimental-ct-react'; import { Button } from './button.tsx'; test('pass', async ({ mount }) => { @@ -270,7 +270,7 @@ test('should cache build', async ({ runInlineTest }, testInfo) => { const result = await runInlineTest({ 'playwright.config.ts': playwrightCtConfigText, 'src/button.test.tsx': ` - import { test, expect } from '@playwright/experimental-ct-react'; + import { test, expect } from '@okep/experimental-ct-react'; import { Button } from './button.tsx'; test('pass updated', async ({ mount }) => { @@ -314,7 +314,7 @@ test('should grow cache', async ({ runInlineTest }, testInfo) => { export const Button2 = () => ; `, 'src/button1.test.tsx': ` - import { test, expect } from '@playwright/experimental-ct-react'; + import { test, expect } from '@okep/experimental-ct-react'; import { Button1 } from './button1.tsx'; test('pass', async ({ mount }) => { const component = await mount(); @@ -322,7 +322,7 @@ test('should grow cache', async ({ runInlineTest }, testInfo) => { }); `, 'src/button2.test.tsx': ` - import { test, expect } from '@playwright/experimental-ct-react'; + import { test, expect } from '@okep/experimental-ct-react'; import { Button2 } from './button2.tsx'; test('pass', async ({ mount }) => { const component = await mount(); @@ -373,7 +373,7 @@ test('should not use global config for preview', async ({ runInlineTest }) => { }; `, 'a.test.ts': ` - import { test, expect } from '@playwright/experimental-ct-react'; + import { test, expect } from '@okep/experimental-ct-react'; test('pass', async ({ mount }) => {}); `, }, { workers: 1 }); @@ -392,7 +392,7 @@ test('should work with https enabled', async ({ runInlineTest }) => { 'playwright/index.html': ``, 'playwright/index.js': ``, 'playwright.config.js': ` - import { defineConfig } from '@playwright/experimental-ct-react'; + import { defineConfig } from '@okep/experimental-ct-react'; import basicSsl from '@vitejs/plugin-basic-ssl'; export default defineConfig({ use: { @@ -407,7 +407,7 @@ test('should work with https enabled', async ({ runInlineTest }) => { }); `, 'http.test.tsx': ` - import { test, expect } from '@playwright/experimental-ct-react'; + import { test, expect } from '@okep/experimental-ct-react'; test('pass', async ({ page }) => { await expect(page).toHaveURL(/https:.*/); @@ -427,7 +427,7 @@ test('list compilation cache should not clash with the run one', async ({ runInl export const Button = () => ; `, 'src/button.spec.tsx': ` - import { test, expect } from '@playwright/experimental-ct-react'; + import { test, expect } from '@okep/experimental-ct-react'; import { Button } from './button'; test('pass', async ({ mount }) => { const component = await mount(); @@ -455,7 +455,7 @@ test('should retain deps when test changes', async ({ runInlineTest }, testInfo) export const Button = () => ; `, 'src/button.test.tsx': ` - import { test, expect } from '@playwright/experimental-ct-react'; + import { test, expect } from '@okep/experimental-ct-react'; import { Button } from './button.tsx'; test('pass', async ({ mount }) => { const component = await mount(); @@ -473,7 +473,7 @@ test('should retain deps when test changes', async ({ runInlineTest }, testInfo) await test.step('modify test and run it again', async () => { const result = await runInlineTest({ 'src/button.test.tsx': ` - import { test, expect } from '@playwright/experimental-ct-react'; + import { test, expect } from '@okep/experimental-ct-react'; import { Button } from './button.tsx'; test('pass', async ({ mount }) => { const component1 = await mount(); @@ -523,7 +523,7 @@ test('should render component via re-export', async ({ runInlineTest }, testInfo export { Button }; `, 'src/button.test.tsx': ` - import { test, expect } from '@playwright/experimental-ct-react'; + import { test, expect } from '@okep/experimental-ct-react'; import { Button } from './buttonHelper'; test('pass', async ({ mount }) => { const component = await mount(); @@ -543,7 +543,7 @@ test('should import json', async ({ runInlineTest }) => { 'playwright/index.ts': ``, 'src/some.json': `{ "some": "value" }`, 'src/button.test.tsx': ` - import { test, expect } from '@playwright/experimental-ct-react'; + import { test, expect } from '@okep/experimental-ct-react'; import json from './some.json'; test('pass', async ({}) => { expect(json.some).toBe('value'); @@ -564,8 +564,8 @@ test('should render component exported via fixture', async ({ runInlineTest }, t `, 'src/buttonFixture.tsx': ` import { Button } from './button'; - import { test as baseTest } from '@playwright/experimental-ct-react'; - export { expect } from '@playwright/experimental-ct-react'; + import { test as baseTest } from '@okep/experimental-ct-react'; + export { expect } from '@okep/experimental-ct-react'; export const test = baseTest.extend({ button: async ({ mount }, use) => { await use(await mount()); @@ -591,7 +591,7 @@ test('should pass imported images from test to component', async ({ runInlineTes 'playwright/index.ts': ``, 'src/image.png': Buffer.from('iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAQAAAD9CzEMAAACMElEQVRYw+1XT0tCQRD/9Qci0Cw7mp1C6BMYnt5niMhPEEFCh07evNk54XnuGkhFehA/QxHkqYMEFWXpscMTipri7fqeu+vbfY+EoBkQ3Zn5zTo7MzsL/NNfoClkUUQNN3jCJ/ETfavRSpYkkSmFQzz8wMr4gaSp8OBJ2HCU4Iwd0kqGgd9GPxCccZ+0jWgWVW1wxlWy0qR51I3hv7lOllq7b4SC/+aGzr+QBadjEKgAykvzJGXwr/Lj4JfRk5hUSLKIa00HPUJRki0xeMWSWxVXmi5sddXKymqTyxdwquXAUVV3WREeLx3gTcNFWQY/jXtB8QIzgt4qTvAR4OCe0ATKCmrnmFMEM0Pp2BvrIisaFUdUjgKKZgYWSjjDLR5J+x13lATHuHSti6JBzQP+gq2QHXjfRaiJojbPgYqbmGFow0VpiyIW0/VIF9QKLzeBWA2MHmwCu8QJQV++Ps/joHQQH4HpuO0uobUeVztgIcr4Vnf4we9orWfUIWKHbEVyYKkPmaVpIVKICuo0ZYXWjHTITXWhsVYxkIDpUoKsla1i2Oz2QjvYG9fshu36GbFQ8DGyHNOuvRdOKZSDUtCFM7wyHeSM4XN8e7bOpd9F2gg+TRYal753bGkbuEjzMg0YW/yDV1czUDm+e43Byz86OnRwsYDMKXlmkYbeAOwffrtU/nGpXpwkXfPhVza+D9AiMAtrtOMYfVr0q8Wr1nh8n8ADZCJPqAk8AifyjP2n36cvkA6/Wln9MokAAAAASUVORK5CYII=', 'base64'), 'src/image.test.tsx': ` - import { test, expect } from '@playwright/experimental-ct-react'; + import { test, expect } from '@okep/experimental-ct-react'; import imageSrc from './image.png'; test('pass', async ({ mount }) => { const component = await mount(); @@ -622,7 +622,7 @@ test('should pass dates, regex, urls and bigints', async ({ runInlineTest }) => }; `, 'src/component.spec.tsx': ` - import { test, expect } from '@playwright/experimental-ct-react'; + import { test, expect } from '@okep/experimental-ct-react'; import { Button } from './button'; test('renders props with builtin types', async ({ mount, page }) => { @@ -652,7 +652,7 @@ test('should pass undefined value as param', async ({ runInlineTest }) => { }; `, 'src/component.spec.tsx': ` - import { test, expect } from '@playwright/experimental-ct-react'; + import { test, expect } from '@okep/experimental-ct-react'; import { Component } from './component'; test('renders props with undefined type', async ({ mount, page }) => { @@ -683,7 +683,7 @@ test('should resolve components imported from node_modules', async ({ runInlineT }), 'src/component.spec.tsx': ` - import { test } from '@playwright/experimental-ct-react'; + import { test } from '@okep/experimental-ct-react'; import { TextField } from '@mui/material'; test("passes", async ({ mount }) => { diff --git a/tests/playwright-test/playwright.ct-dev-server.spec.ts b/tests/playwright-test/playwright.ct-dev-server.spec.ts index e7de28f01fc5c..e0d1862e14ec1 100644 --- a/tests/playwright-test/playwright.ct-dev-server.spec.ts +++ b/tests/playwright-test/playwright.ct-dev-server.spec.ts @@ -27,7 +27,7 @@ test('should run dev-server and use it for tests', async ({ writeFiles, runInlin export const Button = () => ; `, 'src/button.test.tsx': ` - import { test, expect } from '@playwright/experimental-ct-react'; + import { test, expect } from '@okep/experimental-ct-react'; import { Button } from './button'; test('pass', async ({ mount }) => { diff --git a/tests/playwright-test/playwright.ct-react.spec.ts b/tests/playwright-test/playwright.ct-react.spec.ts index ed3fa47cafb5b..744194019cc1a 100644 --- a/tests/playwright-test/playwright.ct-react.spec.ts +++ b/tests/playwright-test/playwright.ct-react.spec.ts @@ -26,7 +26,7 @@ test('should work with TSX', async ({ runInlineTest }) => { export const Button = () => ; `, 'src/button.test.tsx': ` - import { test, expect } from '@playwright/experimental-ct-react'; + import { test, expect } from '@okep/experimental-ct-react'; import { Button } from './button'; test('pass', async ({ mount }) => { @@ -52,7 +52,7 @@ test('should work with JSX', async ({ runInlineTest }) => { `, 'src/button.test.jsx': ` - import { test, expect } from '@playwright/experimental-ct-react'; + import { test, expect } from '@okep/experimental-ct-react'; import { Button } from './button'; test('pass', async ({ mount }) => { @@ -78,7 +78,7 @@ test('should work with JSX in JS', async ({ runInlineTest }) => { `, 'src/button.test.jsx': ` - import { test, expect } from '@playwright/experimental-ct-react'; + import { test, expect } from '@okep/experimental-ct-react'; import { Button } from './button'; test('pass', async ({ mount }) => { @@ -108,7 +108,7 @@ test('should work with JSX in JS and in JSX', async ({ runInlineTest }) => { `, 'src/button.test.jsx': ` - import { test, expect } from '@playwright/experimental-ct-react'; + import { test, expect } from '@okep/experimental-ct-react'; import { Button } from './button'; import { List } from './list'; @@ -145,7 +145,7 @@ test('should work with stray TSX import', async ({ runInlineTest }) => { `, 'src/button.test.tsx': ` - import { test, expect } from '@playwright/experimental-ct-react'; + import { test, expect } from '@okep/experimental-ct-react'; import { Button } from './button'; import { List } from './list'; @@ -176,7 +176,7 @@ test('should work with stray JSX import', async ({ runInlineTest }) => { `, 'src/button.test.jsx': ` - import { test, expect } from '@playwright/experimental-ct-react'; + import { test, expect } from '@okep/experimental-ct-react'; import { Button } from './button'; import { List } from './list'; @@ -207,7 +207,7 @@ test('should work with stray JS import', async ({ runInlineTest }) => { `, 'src/button.test.jsx': ` - import { test, expect } from '@playwright/experimental-ct-react'; + import { test, expect } from '@okep/experimental-ct-react'; import { Button } from './button'; import { List } from './list'; @@ -234,7 +234,7 @@ test('should work with JSX in variable', async ({ runInlineTest }) => { `, 'src/button.test.jsx': ` - import { test, expect } from '@playwright/experimental-ct-react'; + import { test, expect } from '@okep/experimental-ct-react'; import { Button } from './button'; const button = ; @@ -278,7 +278,7 @@ test('should pass "key" attribute from JSX in variable', async ({ runInlineTest `, 'src/index.test.jsx': ` - import { test, expect } from '@playwright/experimental-ct-react'; + import { test, expect } from '@okep/experimental-ct-react'; import { Button } from './button'; import { Container } from './container'; @@ -312,7 +312,7 @@ test('should return root locator for fragments', async ({ runInlineTest }) => { `, 'src/button.test.jsx': ` - import { test, expect } from '@playwright/experimental-ct-react'; + import { test, expect } from '@okep/experimental-ct-react'; import { Button } from './button'; test('pass button', async ({ mount }) => { @@ -337,7 +337,7 @@ test('should respect default property values', async ({ runInlineTest }) => { `, 'src/label.test.tsx': ` - import { test, expect } from '@playwright/experimental-ct-react'; + import { test, expect } from '@okep/experimental-ct-react'; import { Label } from './label'; test('boolean shorthand', async ({ mount }) => { @@ -365,7 +365,7 @@ test('should bundle public folder', async ({ runInlineTest }) => { export const Image = () => logo; `, 'src/image.test.tsx': ` - import { test, expect } from '@playwright/experimental-ct-react'; + import { test, expect } from '@okep/experimental-ct-react'; import { Image } from './image'; test('pass', async ({ mount, page }) => { @@ -399,7 +399,7 @@ test('should work with property expressions in JSX', async ({ runInlineTest }) = export default { Button }; `, 'src/button.test.tsx': ` - import { test, expect } from '@playwright/experimental-ct-react'; + import { test, expect } from '@okep/experimental-ct-react'; import { components1 } from './button1'; import components2 from './button2'; @@ -422,7 +422,7 @@ test('should work with property expressions in JSX', async ({ runInlineTest }) = test('should handle the baseUrl config', async ({ runInlineTest }) => { const result = await runInlineTest({ 'playwright.config.ts': ` - import { defineConfig } from '@playwright/experimental-ct-react'; + import { defineConfig } from '@okep/experimental-ct-react'; export default defineConfig({ use: { baseURL: 'http://127.0.0.1:8080' } }); `, 'playwright/index.html': ``, @@ -433,7 +433,7 @@ test('should handle the baseUrl config', async ({ runInlineTest }) => { `, 'src/component.test.jsx': ` - import { test, expect } from '@playwright/experimental-ct-react'; + import { test, expect } from '@okep/experimental-ct-react'; import { Component } from './component'; test('pass component', async ({ page, mount }) => { @@ -450,7 +450,7 @@ test('should handle the baseUrl config', async ({ runInlineTest }) => { test('should handle the vite host config', async ({ runInlineTest }) => { const result = await runInlineTest({ 'playwright.config.ts': ` - import { defineConfig } from '@playwright/experimental-ct-react'; + import { defineConfig } from '@okep/experimental-ct-react'; export default defineConfig({ use: { ctViteConfig: { preview: { host: '127.0.0.1' } } } }); `, 'playwright/index.html': ``, @@ -461,7 +461,7 @@ test('should handle the vite host config', async ({ runInlineTest }) => { `, 'src/component.test.jsx': ` - import { test, expect } from '@playwright/experimental-ct-react'; + import { test, expect } from '@okep/experimental-ct-react'; import { Component } from './component'; test('pass component', async ({ page, mount }) => { @@ -479,7 +479,7 @@ test('should handle the vite host config', async ({ runInlineTest }) => { test('should prioritize the vite host config over the baseUrl config', async ({ runInlineTest }) => { const result = await runInlineTest({ 'playwright.config.ts': ` - import { defineConfig } from '@playwright/experimental-ct-react'; + import { defineConfig } from '@okep/experimental-ct-react'; export default defineConfig({ use: { baseURL: 'http://localhost:8080', @@ -495,7 +495,7 @@ test('should prioritize the vite host config over the baseUrl config', async ({ `, 'src/component.test.jsx': ` - import { test, expect } from '@playwright/experimental-ct-react'; + import { test, expect } from '@okep/experimental-ct-react'; import { Component } from './component'; test('pass component', async ({ page, mount }) => { @@ -520,18 +520,18 @@ test('should normalize children', async ({ runInlineTest }) => { React.Children.only(children); return <>{children}; }; - export const OtherComponent: React.FC = () =>

othercomponent

; + export const OtherComponent: React.FC = () =>

othercomponent

; `, 'src/component.spec.tsx': ` - import { test, expect } from '@playwright/experimental-ct-react'; + import { test, expect } from '@okep/experimental-ct-react'; import { OneChild, OtherComponent } from './component'; test("can pass an HTML element to OneChild", async ({ mount }) => { const component = await mount(

child

); await expect(component).toHaveText("child"); }); - + test("can pass another component to OneChild", async ({ mount }) => { const component = await mount(); await expect(component).toHaveText("othercomponent"); @@ -549,7 +549,7 @@ test('should allow props children', async ({ runInlineTest }) => { 'playwright/index.html': ``, 'playwright/index.ts': ``, 'src/component.spec.tsx': ` - import { test, expect } from '@playwright/experimental-ct-react'; + import { test, expect } from '@okep/experimental-ct-react'; test("renders children from props object", async ({ mount, page }) => { const props = { children: 'test' }; @@ -584,7 +584,7 @@ test('should allow import from shared file', async ({ runInlineTest }) => { }; `, 'src/component.spec.tsx': ` - import { expect, test } from '@playwright/experimental-ct-react'; + import { expect, test } from '@okep/experimental-ct-react'; import { ComponentTest } from './component.render'; import { componentMock } from './component.shared'; test('component renders', async ({ mount }) => { diff --git a/tests/playwright-test/playwright.fetch.spec.ts b/tests/playwright-test/playwright.fetch.spec.ts index 3b2e32af153db..a5237a9c68833 100644 --- a/tests/playwright-test/playwright.fetch.spec.ts +++ b/tests/playwright-test/playwright.fetch.spec.ts @@ -19,7 +19,7 @@ import { test, expect } from './playwright-test-fixtures'; test('should expose request fixture', async ({ runInlineTest, server }) => { const result = await runInlineTest({ 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('pass', async ({ request }) => { const response = await request.get('${server.PREFIX}/simple.json'); const json = await response.json(); @@ -38,7 +38,7 @@ test('should use baseURL in request fixture', async ({ runInlineTest, server }) module.exports = { use: { baseURL: '${server.PREFIX}' } }; `, 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('pass', async ({ request }) => { const response = await request.get('/simple.json'); const json = await response.json(); @@ -68,7 +68,7 @@ test('should stop tracing on requestContext.dispose()', async ({ runInlineTest, }; `, 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('hanging request', async ({ page, request }) => { const response = await page.goto('${server.EMPTY_PAGE}'); expect(response.status()).toBe(200); @@ -84,7 +84,7 @@ test('should stop tracing on requestContext.dispose()', async ({ runInlineTest, test('should hint unrouteAll if failed in the handler', async ({ runInlineTest, server }) => { const result = await runInlineTest({ 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('late fetch', async ({ page }) => { let closedCallback = () => {}; const closedPromise = new Promise(f => closedCallback = f); diff --git a/tests/playwright-test/playwright.reuse.browser.spec.ts b/tests/playwright-test/playwright.reuse.browser.spec.ts index bccce95b3eac7..9ae8186d06823 100644 --- a/tests/playwright-test/playwright.reuse.browser.spec.ts +++ b/tests/playwright-test/playwright.reuse.browser.spec.ts @@ -40,13 +40,13 @@ test('should reuse browser', async ({ runInlineTest, runServer }) => { const server = await runServer(); const result = await runInlineTest({ 'src/a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('a', async ({ browser }) => { console.log('%%' + process.env.TEST_WORKER_INDEX + ':' + browser._guid); }); `, 'src/b.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('b', async ({ browser }) => { console.log('%%' + process.env.TEST_WORKER_INDEX + ':' + browser._guid); }); @@ -77,13 +77,13 @@ test('should reuse browser with special characters in the launch options', async } `, 'src/a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('a', async ({ browser }) => { console.log('%%' + process.env.TEST_WORKER_INDEX + ':' + browser._guid); }); `, 'src/b.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('b', async ({ browser }) => { console.log('%%' + process.env.TEST_WORKER_INDEX + ':' + browser._guid); }); @@ -114,7 +114,7 @@ test('should produce correct test steps', async ({ runInlineTest, runServer }) = module.exports = Reporter; `, 'src/a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('a', async ({ page }) => { await page.goto('about:blank'); await page.evaluate(() => console.log('hello')); @@ -148,4 +148,4 @@ test('should produce correct test steps', async ({ runInlineTest, runServer }) = 'onStepEnd fixture: context', 'onStepEnd After Hooks' ]); -}); \ No newline at end of file +}); diff --git a/tests/playwright-test/playwright.reuse.spec.ts b/tests/playwright-test/playwright.reuse.spec.ts index 0620195f65c7f..a46bc804eb206 100644 --- a/tests/playwright-test/playwright.reuse.spec.ts +++ b/tests/playwright-test/playwright.reuse.spec.ts @@ -21,7 +21,7 @@ import fs from 'fs'; test('should reuse context', async ({ runInlineTest }) => { const result = await runInlineTest({ 'src/reuse.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; let lastContextGuid; test('one', async ({ context }) => { lastContextGuid = context._guid; @@ -66,7 +66,7 @@ test('should not reuse context with video if mode=when-possible', async ({ runIn }; `, 'src/reuse.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; let lastContextGuid; test('one', async ({ context }) => { @@ -93,7 +93,7 @@ test('should reuse context with trace if mode=when-possible', async ({ runInline }; `, 'reuse.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; let lastContextGuid; test('one', async ({ context, page }) => { @@ -150,7 +150,7 @@ test('should reuse context with trace if mode=when-possible', async ({ runInline test('should work with manually closed pages', async ({ runInlineTest }) => { const result = await runInlineTest({ 'src/button.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('closes page', async ({ page }) => { await page.close(); @@ -179,7 +179,7 @@ test('should work with manually closed pages', async ({ runInlineTest }) => { test('should clean storage', async ({ runInlineTest }) => { const result = await runInlineTest({ 'src/reuse.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; let lastContextGuid; test.beforeEach(async ({ page }) => { @@ -222,7 +222,7 @@ test('should clean storage', async ({ runInlineTest }) => { test('should restore localStorage', async ({ runInlineTest }) => { const result = await runInlineTest({ 'src/reuse.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; let lastContextGuid; test.use({ @@ -297,7 +297,7 @@ test('should clean db', async ({ runInlineTest }) => { test.slow(); const result = await runInlineTest({ 'src/reuse.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; let lastContextGuid; test.beforeEach(async ({ page }) => { @@ -336,7 +336,7 @@ test('should clean db', async ({ runInlineTest }) => { test('should restore cookies', async ({ runInlineTest }) => { const result = await runInlineTest({ 'src/reuse.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; let lastContextGuid; test.use({ @@ -394,7 +394,7 @@ test('should restore cookies', async ({ runInlineTest }) => { test('should reuse context with beforeunload', async ({ runInlineTest }) => { const result = await runInlineTest({ 'src/reuse.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; let lastContextGuid; test('one', async ({ page, context }) => { lastContextGuid = context._guid; @@ -419,7 +419,7 @@ test('should reuse context with beforeunload', async ({ runInlineTest }) => { test('should cancel pending operations upon reuse', async ({ runInlineTest }) => { const result = await runInlineTest({ 'src/reuse.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('one', async ({ page }) => { await Promise.race([ page.getByText('click me').click().catch(e => {}), @@ -445,7 +445,7 @@ test('should reset tracing', async ({ runInlineTest }, testInfo) => { const traceFile2 = testInfo.outputPath('trace2.zip'); const result = await runInlineTest({ 'reuse.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('one', async ({ page }) => { await page.context().tracing.start({ snapshots: true }); await page.setContent(''); @@ -484,7 +484,7 @@ test('should reset tracing', async ({ runInlineTest }, testInfo) => { test('should not delete others contexts', async ({ runInlineTest }) => { const result = await runInlineTest({ 'src/reuse.test.ts': ` - import { test as base, expect } from '@playwright/test'; + import { test as base, expect } from '@okep/test'; const test = base.extend<{ loggedInPage: Page }>({ loggedInPage: async ({ browser }, use) => { const page = await browser.newPage(); @@ -505,11 +505,11 @@ test('should not delete others contexts', async ({ runInlineTest }) => { test('should survive serial mode with tracing and reuse', async ({ runInlineTest }, testInfo) => { const result = await runInlineTest({ 'playwright.config.ts': ` - import { defineConfig } from '@playwright/test'; + import { defineConfig } from '@okep/test'; export default defineConfig({ use: { trace: 'on' } }); `, 'reuse.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; let page; test.describe.configure({ mode: 'serial' }); diff --git a/tests/playwright-test/playwright.spec.ts b/tests/playwright-test/playwright.spec.ts index 6031070aa406c..b13415da494f3 100644 --- a/tests/playwright-test/playwright.spec.ts +++ b/tests/playwright-test/playwright.spec.ts @@ -42,13 +42,13 @@ test('should respect viewport option', async ({ runInlineTest }) => { module.exports = { use: { viewport: { width: 800, height: 800 } } }; `, 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('pass', async ({ page }) => { expect(page.viewportSize()).toEqual({ width: 800, height: 800 }); }); `, 'b.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test.use({ viewport: { width: 600, height: 600 } }); test('pass', async ({ page }) => { expect(page.viewportSize()).toEqual({ width: 600, height: 600 }); @@ -66,7 +66,7 @@ test('should run in three browsers with --browser', async ({ runInlineTest }) => module.exports = { use: { viewport: { width: 800, height: 800 } } }; `, 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('pass', async ({ browserName }) => { console.log('\\n%%browser=' + browserName); }); @@ -88,7 +88,7 @@ test('should run in one browser with --browser', async ({ runInlineTest }) => { module.exports = { use: { viewport: { width: 800, height: 800 } } }; `, 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('pass', async ({ browserName }) => { console.log('\\n%%browser=' + browserName); }); @@ -108,7 +108,7 @@ test('should complain with projects and --browser', async ({ runInlineTest }) => module.exports = { projects: [ {} ] }; `, 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('pass', async ({ page }) => { }); `, @@ -127,7 +127,7 @@ test('should override any headless option with --headed', async ({ runInlineTest ] }; `, 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('example', async ({ page }) => { expect(await page.evaluate(() => navigator.userAgent)).not.toContain('Headless'); }); @@ -144,7 +144,7 @@ test('should not override use:browserName without projects', async ({ runInlineT module.exports = { use: { browserName: 'webkit' } }; `, 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('pass', async ({ browserName }) => { console.log('\\n%%browser=' + browserName); }); @@ -164,7 +164,7 @@ test('should override use:browserName with --browser', async ({ runInlineTest }) module.exports = { use: { browserName: 'webkit' } }; `, 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('pass', async ({ browserName }) => { console.log('\\n%%browser=' + browserName); }); @@ -188,7 +188,7 @@ test('should respect context options in various contexts', async ({ runInlineTes import os from 'os'; import path from 'path'; - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test.use({ locale: 'fr-FR' }); let context; @@ -255,7 +255,7 @@ test('should respect headless in launchPersistent', async ({ runInlineTest }) => import os from 'os'; import path from 'path'; - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('persistent context', async ({ playwright, browserName }) => { const dir = await fs.promises.mkdtemp(path.join(os.tmpdir(), 'user-data-dir-')); @@ -278,7 +278,7 @@ test('should respect headless in modifiers that run before tests', async ({ runI module.exports = { use: { headless: false } }; `, 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test.skip(({ browser }) => false); @@ -295,7 +295,7 @@ test('should respect headless in modifiers that run before tests', async ({ runI test('should call logger from launchOptions config', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; const log = []; test.use({ launchOptions: { @@ -323,7 +323,7 @@ test('should call logger from launchOptions config', async ({ runInlineTest }) = test('should report error and pending operations on timeout', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('timedout', async ({ page }) => { await page.setContent('
Click me
'); await page.getByText('Missing').click(); @@ -341,7 +341,7 @@ test('should report error and pending operations on timeout', async ({ runInline test('should report error on timeout with shared page', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; let page; test.beforeAll(async ({ browser }) => { page = await browser.newPage(); @@ -365,7 +365,7 @@ test('should report error on timeout with shared page', async ({ runInlineTest } test('should report error from beforeAll timeout', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test.beforeAll(async ({ browser }) => { const page = await browser.newPage(); await page.setContent('
Click me
'); @@ -389,7 +389,7 @@ test('should report error from beforeAll timeout', async ({ runInlineTest }) => test('should not report waitForEventInfo as pending', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('timedout', async ({ page }) => { await page.setContent('
Click me
'); await page.waitForLoadState('networkidle'); @@ -409,7 +409,7 @@ test('should not report waitForEventInfo as pending', async ({ runInlineTest }) test('should throw when using page in beforeAll', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test.beforeAll(() => {}); test.beforeAll(async ({ page }) => { }); @@ -428,7 +428,7 @@ test('should report click error on sigint', async ({ interactWithTestRunner }) = const testProcess = await interactWithTestRunner({ 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('timedout', async ({ page }) => { await page.setContent('
Click me
'); const promise = page.click('text=Missing'); @@ -456,7 +456,7 @@ test('should work with video: retain-on-failure', async ({ runInlineTest }) => { module.exports = { use: { video: 'retain-on-failure' }, name: 'chromium' }; `, 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('pass', async ({ page }) => { await page.setContent('
PASS
'); await page.waitForTimeout(3000); @@ -488,7 +488,7 @@ test('should work with video: on-first-retry', async ({ runInlineTest }) => { module.exports = { use: { video: 'on-first-retry' }, retries: 1, name: 'chromium' }; `, 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('pass', async ({ page }) => { await page.setContent('
PASS
'); await page.waitForTimeout(3000); @@ -534,7 +534,7 @@ test('should work with video size', async ({ runInlineTest }) => { }; `, 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('pass', async ({ page }) => { await page.setContent('
PASS
'); await page.waitForTimeout(3000); @@ -562,7 +562,7 @@ test('should work with video.path() throwing', async ({ runInlineTest }, testInf }; `, 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('pass', async ({ page }) => { page.video().path = () => { throw new Error('No-no!'); }; await page.setContent('
PASS
'); @@ -583,7 +583,7 @@ test('should pass fixture defaults to tests', async ({ runInlineTest }) => { module.exports = {}; `, 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('pass', async ({ acceptDownloads, actionTimeout, headless, javaScriptEnabled, navigationTimeout }) => { expect(acceptDownloads).toBe(true); expect(actionTimeout).toBe(0); @@ -637,7 +637,7 @@ test('should not throw with many fixtures set to undefined', async ({ runInlineT } }; `, 'a.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test.use({ browserName: undefined, headless: undefined, @@ -686,7 +686,7 @@ test('should not throw with many fixtures set to undefined', async ({ runInlineT test('should have strict types for options but allow use(undefined)', async ({ runTSC }) => { const result = await runTSC({ 'a.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test.use({ headless: undefined, acceptDownloads: undefined, @@ -724,7 +724,7 @@ test('should have strict types for options but allow use(undefined)', async ({ r test('should skip on mobile', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test.describe(() => { test.use({ isMobile: true }); @@ -757,7 +757,7 @@ test('should use actionTimeout for APIRequestContext', async ({ runInlineTest, s }; `, 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('default APIRequestContext fixture', async ({ request }) => { await expect(request.get('/stall')).rejects.toThrow('apiRequestContext.get: Request timed out after 1111ms'); }); @@ -786,7 +786,7 @@ test('should save trace in two APIRequestContexts', async ({ runInlineTest, serv }; `, 'a.test.ts': ` - import { test, request, BrowserContext, Page, APIRequestContext } from '@playwright/test'; + import { test, request, BrowserContext, Page, APIRequestContext } from '@okep/test'; test.describe('Example', () => { let firstContext: APIRequestContext; @@ -831,7 +831,7 @@ test('should save trace in two APIRequestContexts', async ({ runInlineTest, serv test('should explain a failure when using a dispose APIRequestContext', async ({ runInlineTest, server }) => { const result = await runInlineTest({ 'a.test.ts': ` - import { test } from '@playwright/test'; + import { test } from '@okep/test'; let context; @@ -857,7 +857,7 @@ test('should allow dynamic import in evaluate', async ({ runInlineTest, server } }); const result = await runInlineTest({ 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('test', async ({ page }) => { await page.goto("${server.EMPTY_PAGE}"); @@ -876,7 +876,7 @@ test('should allow dynamic import in evaluate', async ({ runInlineTest, server } test('page.pause() should disable test timeout', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('test', async ({ page }) => { test.setTimeout(2000); diff --git a/tests/playwright-test/playwright.trace.spec.ts b/tests/playwright-test/playwright.trace.spec.ts index ba6020fadef89..190c6b0ca687c 100644 --- a/tests/playwright-test/playwright.trace.spec.ts +++ b/tests/playwright-test/playwright.trace.spec.ts @@ -26,7 +26,7 @@ test('should stop tracing with trace: on-first-retry, when not retrying', async module.exports = { use: { trace: 'on-first-retry' } }; `, 'a.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test.describe('shared', () => { let page; @@ -62,7 +62,7 @@ test('should record api trace', async ({ runInlineTest, server }, testInfo) => { module.exports = { use: { trace: 'on' } }; `, 'a.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('pass', async ({request, page}, testInfo) => { await page.goto('about:blank'); @@ -154,8 +154,8 @@ test('should not throw with trace: on-first-retry and two retries in the same wo module.exports = { use: { trace: 'on-first-retry' } }; `, 'helper.ts': ` - import { test as base } from '@playwright/test'; - export * from '@playwright/test'; + import { test as base } from '@okep/test'; + export * from '@okep/test'; export const test = base.extend({ myContext: [async ({ browser }, use) => { const c = await browser.newContext(); @@ -180,7 +180,7 @@ test('should not mixup network files between contexts', async ({ runInlineTest, export default { use: { trace: 'on' } }; `, 'a.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; let page1, page2; @@ -217,7 +217,7 @@ test('should save sources when requested', async ({ runInlineTest }, testInfo) = }; `, 'a.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('pass', async ({ page }) => { await page.evaluate(2 + 2); }); @@ -241,7 +241,7 @@ test('should not save sources when not requested', async ({ runInlineTest }, tes }; `, 'a.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('pass', async ({ page }) => { await page.evaluate(2 + 2); }); @@ -258,7 +258,7 @@ test('should work in serial mode', async ({ runInlineTest }, testInfo) => { module.exports = { use: { trace: 'retain-on-failure' } }; `, 'a.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test.describe.serial('serial', () => { let page; @@ -293,7 +293,7 @@ test('should not override trace file in afterAll', async ({ runInlineTest, serve module.exports = { use: { trace: 'retain-on-failure' } }; `, 'a.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('test 1', async ({ page }) => { await page.goto('about:blank'); @@ -348,14 +348,14 @@ test('should retain traces for interrupted tests', async ({ runInlineTest }, tes module.exports = { use: { trace: 'retain-on-failure' }, maxFailures: 1 }; `, 'a.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('test 1', async ({ page }) => { await page.waitForTimeout(2000); expect(1).toBe(2); }); `, 'b.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('test 2', async ({ page }) => { await page.goto('about:blank'); await page.waitForTimeout(5000); @@ -373,7 +373,7 @@ test('should retain traces for interrupted tests', async ({ runInlineTest }, tes test('should respect --trace', async ({ runInlineTest }, testInfo) => { const result = await runInlineTest({ 'a.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('test 1', async ({ page }) => { await page.goto('about:blank'); }); @@ -391,7 +391,7 @@ test('should respect PW_TEST_DISABLE_TRACING', async ({ runInlineTest }, testInf export default { use: { trace: 'on' } }; `, 'a.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('test 1', async ({ page }) => { await page.goto('about:blank'); }); @@ -407,7 +407,7 @@ for (const mode of ['off', 'retain-on-failure', 'on-first-retry', 'on-all-retrie test(`trace:${mode} should not create trace zip artifact if page test passed`, async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.spec.ts': ` - import { test as base, expect } from '@playwright/test'; + import { test as base, expect } from '@okep/test'; import fs from 'fs'; let artifactsDir; const test = base.extend({ @@ -430,7 +430,7 @@ for (const mode of ['off', 'retain-on-failure', 'on-first-retry', 'on-all-retrie test(`trace:${mode} should not create trace zip artifact if APIRequestContext test passed`, async ({ runInlineTest, server }) => { const result = await runInlineTest({ 'a.spec.ts': ` - import { test as base, expect } from '@playwright/test'; + import { test as base, expect } from '@okep/test'; import fs from 'fs'; let artifactsDir; const test = base.extend({ @@ -457,7 +457,7 @@ test(`trace:retain-on-failure should create trace if context is closed before fa module.exports = { use: { trace: 'retain-on-failure' } }; `, 'a.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('passing test', async ({ page, context }) => { await page.goto('about:blank'); await context.close(); @@ -477,7 +477,7 @@ test(`trace:retain-on-failure should create trace if context is closed before fa module.exports = { use: { trace: 'retain-on-failure' } }; `, 'a.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('passing test', async ({ page, context }) => { }); test.afterEach(async ({ page, context }) => { @@ -499,7 +499,7 @@ test(`trace:retain-on-failure should create trace if request context is disposed module.exports = { use: { trace: 'retain-on-failure' } }; `, 'a.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('passing test', async ({ request }) => { expect(await request.get('${server.EMPTY_PAGE}')).toBeOK(); await request.dispose(); @@ -519,7 +519,7 @@ test('should include attachments by default', async ({ runInlineTest, server }, module.exports = { use: { trace: 'on' } }; `, 'a.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('pass', async ({}, testInfo) => { testInfo.attach('foo', { body: 'bar' }); @@ -549,7 +549,7 @@ test('should opt out of attachments', async ({ runInlineTest, server }, testInfo module.exports = { use: { trace: { mode: 'on', attachments: false } } }; `, 'a.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('pass', async ({}, testInfo) => { testInfo.attach('foo', { body: 'bar' }); @@ -572,7 +572,7 @@ test('should opt out of attachments', async ({ runInlineTest, server }, testInfo test('should record with custom page fixture', async ({ runInlineTest }, testInfo) => { const result = await runInlineTest({ 'a.spec.ts': ` - import { test as base, expect } from '@playwright/test'; + import { test as base, expect } from '@okep/test'; const test = base.extend({ myPage: async ({ browser }, use) => { @@ -604,7 +604,7 @@ test('should expand expect.toPass', async ({ runInlineTest }, testInfo) => { module.exports = { use: { trace: { mode: 'on' } } }; `, 'a.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('pass', async ({ page }) => { let i = 0; await expect(async () => { @@ -645,7 +645,7 @@ test('should show non-expect error in trace', async ({ runInlineTest }, testInfo module.exports = { use: { trace: { mode: 'on' } } }; `, 'a.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('fail', async ({ page }) => { expect(1).toBe(1); undefinedVariable1 = 'this throws an exception'; @@ -681,7 +681,7 @@ test('should show error from beforeAll in trace', async ({ runInlineTest }, test module.exports = { use: { trace: { mode: 'on' } } }; `, 'a.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test.beforeAll(async () => { throw new Error('Oh my!'); }) @@ -699,7 +699,7 @@ test('should show error from beforeAll in trace', async ({ runInlineTest }, test test('should throw when trace fixture is a function', async ({ runInlineTest }, testInfo) => { const result = await runInlineTest({ 'a.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test.use({ trace: async ({}, use) => { await use('on'); @@ -721,7 +721,7 @@ test('should not throw when attachment is missing', async ({ runInlineTest }, te module.exports = { use: { trace: 'on' } }; `, 'a.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('passes', async ({}) => { test.info().attachments.push({ name: 'screenshot', path: 'nothing-to-see-here', contentType: 'image/png' }); }); @@ -740,7 +740,7 @@ test('should not throw when screenshot on failure fails', async ({ runInlineTest module.exports = { use: { trace: 'on', screenshot: 'on' } }; `, 'a.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('has pdf page', async ({ page }) => { await page.goto("${server.EMPTY_PAGE}"); await page.setContent('open me!'); @@ -766,7 +766,7 @@ test('should use custom expect message in trace', async ({ runInlineTest }, test module.exports = { use: { trace: { mode: 'on' } } }; `, 'a.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('fail', async ({ page }) => { await expect( page.getByRole('button', { name: 'Find a hotel' }), @@ -802,7 +802,7 @@ test('should not throw when merging traces multiple times', async ({ runInlineTe module.exports = { use: { trace: 'on' } }; `, 'a.spec.ts': ` - import { BrowserContext, expect, Page, test as baseTest } from '@playwright/test'; + import { BrowserContext, expect, Page, test as baseTest } from '@okep/test'; let pg: Page; let ctx: BrowserContext; @@ -849,7 +849,7 @@ test('should record nested steps, even after timeout', async ({ runInlineTest }, }; `, 'a.spec.ts': ` - import { test as base, expect } from '@playwright/test'; + import { test as base, expect } from '@okep/test'; const test = base.extend({ fooPage: async ({ page }, use) => { expect(1, 'fooPage setup').toBe(1); @@ -1001,7 +1001,7 @@ test('should attribute worker fixture teardown to the right test', async ({ runI }; `, 'a.spec.ts': ` - import { test as base, expect } from '@playwright/test'; + import { test as base, expect } from '@okep/test'; const test = base.extend({ foo: [async ({}, use) => { expect(1, 'step in foo setup').toBe(1); @@ -1042,7 +1042,7 @@ test('should attribute worker fixture teardown to the right test', async ({ runI test('trace:retain-on-first-failure should create trace but only on first failure', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('fail', async ({ page }) => { await page.goto('about:blank'); expect(true).toBe(false); @@ -1063,7 +1063,7 @@ test('trace:retain-on-first-failure should create trace but only on first failur test('trace:retain-on-first-failure should create trace if context is closed before failure in the test', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('fail', async ({ page, context }) => { await page.goto('about:blank'); await context.close(); @@ -1080,7 +1080,7 @@ test('trace:retain-on-first-failure should create trace if context is closed bef test('trace:retain-on-first-failure should create trace if context is closed before failure in afterEach', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('fail', async ({ page, context }) => { }); test.afterEach(async ({ page, context }) => { @@ -1099,7 +1099,7 @@ test('trace:retain-on-first-failure should create trace if context is closed bef test('trace:retain-on-first-failure should create trace if request context is disposed before failure', async ({ runInlineTest, server }) => { const result = await runInlineTest({ 'a.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('fail', async ({ request }) => { expect(await request.get('${server.EMPTY_PAGE}')).toBeOK(); await request.dispose(); @@ -1116,7 +1116,7 @@ test('trace:retain-on-first-failure should create trace if request context is di test('should not corrupt actions when no library trace is present', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.spec.ts': ` - import { test as base, expect } from '@playwright/test'; + import { test as base, expect } from '@okep/test'; const test = base.extend({ foo: async ({}, use) => { expect(1).toBe(1); @@ -1151,7 +1151,7 @@ test('should record trace for manually created context in a failed test', async const result = await runInlineTest({ 'a.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('fail', async ({ browser }) => { const page = await browser.newPage(); await page.setContent(''); @@ -1189,7 +1189,7 @@ test('should not nest top level expect into unfinished api calls ', { server.setRoute('/hang', () => {}); const result = await runInlineTest({ 'a.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('pass', async ({ page }) => { await page.route('**/api', async route => { const response = await route.fetch({ url: '${server.PREFIX}/hang' }); @@ -1229,7 +1229,7 @@ test('should record trace after fixture teardown timeout', { }, async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.spec.ts': ` - import { test as base, expect } from '@playwright/test'; + import { test as base, expect } from '@okep/test'; const test = base.extend({ fixture: async ({}, use) => { await use('foo'); diff --git a/tests/playwright-test/playwright.unhandled.spec.ts b/tests/playwright-test/playwright.unhandled.spec.ts index b820f8246a674..94b715b165e3f 100644 --- a/tests/playwright-test/playwright.unhandled.spec.ts +++ b/tests/playwright-test/playwright.unhandled.spec.ts @@ -19,7 +19,7 @@ import { test, expect } from './playwright-test-fixtures'; test('should produce uncaughtException when page.route raises', async ({ runInlineTest, server }) => { const result = await runInlineTest({ 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('fail', async ({ page }) => { await page.route('**/empty.html', route => { throw new Error('foobar'); @@ -35,7 +35,7 @@ test('should produce uncaughtException when page.route raises', async ({ runInli test('should produce unhandledRejection when page.route raises', async ({ runInlineTest, server }) => { const result = await runInlineTest({ 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('fail', async ({ page }) => { await page.route('**/empty.html', async route => { throw new Error('foobar'); @@ -51,7 +51,7 @@ test('should produce unhandledRejection when page.route raises', async ({ runInl test('should produce uncaughtException when context.route raises', async ({ runInlineTest, server }) => { const result = await runInlineTest({ 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('fail', async ({ context, page }) => { await context.route('**/empty.html', route => { throw new Error('foobar'); @@ -67,7 +67,7 @@ test('should produce uncaughtException when context.route raises', async ({ runI test('should produce unhandledRejection when context.route raises', async ({ runInlineTest, server }) => { const result = await runInlineTest({ 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('fail', async ({ context, page }) => { await context.route('**/empty.html', async route => { throw new Error('foobar'); diff --git a/tests/playwright-test/repeat-each.spec.ts b/tests/playwright-test/repeat-each.spec.ts index c514098bb89cb..c0e67a2843e41 100644 --- a/tests/playwright-test/repeat-each.spec.ts +++ b/tests/playwright-test/repeat-each.spec.ts @@ -19,7 +19,7 @@ import { test, expect } from './playwright-test-fixtures'; test('should repeat from command line', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.spec.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('test', ({}, testInfo) => { console.log('REPEAT ' + testInfo.repeatEachIndex); expect(1).toBe(1); @@ -43,7 +43,7 @@ test('should repeat based on config', async ({ runInlineTest }) => { ] }; `, 'a.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('my test', ({}, testInfo) => {}); ` }); diff --git a/tests/playwright-test/reporter-attachment.spec.ts b/tests/playwright-test/reporter-attachment.spec.ts index 50d6d1ee0c8c4..0cf218697b590 100644 --- a/tests/playwright-test/reporter-attachment.spec.ts +++ b/tests/playwright-test/reporter-attachment.spec.ts @@ -20,7 +20,7 @@ import { test, expect } from './playwright-test-fixtures'; test('render text attachment', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('one', async ({}, testInfo) => { testInfo.attachments.push({ name: 'attachment', @@ -41,7 +41,7 @@ test('render text attachment', async ({ runInlineTest }) => { test('render screenshot attachment', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('one', async ({}, testInfo) => { testInfo.attachments.push({ name: 'screenshot', @@ -62,7 +62,7 @@ test('render screenshot attachment', async ({ runInlineTest }) => { test('render trace attachment', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('one', async ({}, testInfo) => { testInfo.attachments.push({ name: 'trace', @@ -84,7 +84,7 @@ test('render trace attachment', async ({ runInlineTest }) => { test(`testInfo.attach errors`, async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('fail1', async ({}, testInfo) => { await testInfo.attach('name', { path: 'foo.txt' }); }); @@ -107,7 +107,7 @@ test(`testInfo.attach errors`, async ({ runInlineTest }) => { test(`testInfo.attach errors with empty path`, async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('fail', async ({}, testInfo) => { await testInfo.attach('name', { path: '' }); }); @@ -120,7 +120,7 @@ test(`testInfo.attach errors with empty path`, async ({ runInlineTest }) => { test(`testInfo.attach error in fixture`, async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.test.ts': ` - import { test as base, expect } from '@playwright/test'; + import { test as base, expect } from '@okep/test'; const test = base.extend({ fixture: async ({}, use, testInfo) => { await use(); @@ -141,7 +141,7 @@ test(`testInfo.attach error in fixture`, async ({ runInlineTest }) => { test(`testInfo.attach success in fixture`, async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.test.ts': ` - import { test as base, expect } from '@playwright/test'; + import { test as base, expect } from '@okep/test'; const test = base.extend({ fixture: async ({}, use, testInfo) => { const filePath = testInfo.outputPath('foo.txt'); @@ -163,7 +163,7 @@ test(`testInfo.attach success in fixture`, async ({ runInlineTest }) => { test(`testInfo.attach allow empty string body`, async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('success', async ({}, testInfo) => { await testInfo.attach('name', { body: '', contentType: 'text/plain' }); expect(0).toBe(1); @@ -178,7 +178,7 @@ test(`testInfo.attach allow empty string body`, async ({ runInlineTest }) => { test(`testInfo.attach allow without options`, async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('success', async ({}, testInfo) => { await testInfo.attach('Full name'); expect(0).toBe(1); @@ -193,7 +193,7 @@ test(`testInfo.attach allow without options`, async ({ runInlineTest }) => { test(`testInfo.attach allow empty buffer body`, async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('success', async ({}, testInfo) => { await testInfo.attach('name', { body: Buffer.from(''), contentType: 'text/plain' }); expect(0).toBe(1); @@ -208,7 +208,7 @@ test(`testInfo.attach allow empty buffer body`, async ({ runInlineTest }) => { test(`testInfo.attach use name as prefix`, async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.test.ts': ` - import { test as base, expect } from '@playwright/test'; + import { test as base, expect } from '@okep/test'; const test = base.extend({ fixture: async ({}, use, testInfo) => { const filePath = testInfo.outputPath('foo.txt'); @@ -232,7 +232,7 @@ test(`testInfo.attach use name as prefix`, async ({ runInlineTest }) => { test(`testInfo.attach name should be sanitized`, async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.test.ts': ` - import { test as base, expect } from '@playwright/test'; + import { test as base, expect } from '@okep/test'; const test = base.extend({ fixture: async ({}, use, testInfo) => { const filePath = testInfo.outputPath('foo.txt'); @@ -256,7 +256,7 @@ test(`testInfo.attach name should be sanitized`, async ({ runInlineTest }) => { test(`testInfo.attach name can be empty string`, async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.test.ts': ` - import { test as base, expect } from '@playwright/test'; + import { test as base, expect } from '@okep/test'; const test = base.extend({ fixture: async ({}, use, testInfo) => { const filePath = testInfo.outputPath('foo.txt'); @@ -280,7 +280,7 @@ test(`testInfo.attach name can be empty string`, async ({ runInlineTest }) => { test(`testInfo.attach throw if name is not string`, async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.test.ts': ` - import { test as base, expect } from '@playwright/test'; + import { test as base, expect } from '@okep/test'; const test = base.extend({ fixture: async ({}, use, testInfo) => { const filePath = testInfo.outputPath('foo.txt'); @@ -303,7 +303,7 @@ test(`testInfo.attach throw if name is not string`, async ({ runInlineTest }) => test('render text attachment with multiple lines', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.test.js': ` - const { test, expect } = require('@playwright/test'); + const { test, expect } = require('@okep/test'); test('one', async ({}, testInfo) => { testInfo.attachments.push({ name: 'attachment', diff --git a/tests/playwright-test/reporter-base.spec.ts b/tests/playwright-test/reporter-base.spec.ts index 6d6e499605399..e34d4aa84901b 100644 --- a/tests/playwright-test/reporter-base.spec.ts +++ b/tests/playwright-test/reporter-base.spec.ts @@ -25,7 +25,7 @@ for (const useIntermediateMergeReport of [false, true] as const) { const title = 'title'.repeat(30); const result = await runInlineTest({ 'a.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('${title}', async ({}) => { expect(1).toBe(0); }); @@ -38,7 +38,7 @@ for (const useIntermediateMergeReport of [false, true] as const) { test('print the error name', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('foobar', async ({}) => { const error = new Error('my-message'); error.name = 'FooBarError'; @@ -54,7 +54,7 @@ for (const useIntermediateMergeReport of [false, true] as const) { test('print should print the error name without a message', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('foobar', async ({}) => { const error = new Error(); error.name = 'FooBarError'; @@ -70,7 +70,7 @@ for (const useIntermediateMergeReport of [false, true] as const) { test('should print an error in a codeframe', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('foobar', async ({}) => { const error = new Error('my-message'); error.name = 'FooBarError'; @@ -84,7 +84,7 @@ for (const useIntermediateMergeReport of [false, true] as const) { expect(result.failed).toBe(1); expect(result.output).toContain('FooBarError: my-message'); expect(result.output).not.toContain('at a.spec.ts:5'); - expect(result.output).toContain(` 2 | import { test, expect } from '@playwright/test';`); + expect(result.output).toContain(` 2 | import { test, expect } from '@okep/test';`); expect(result.output).toContain(` 3 | test('foobar', async ({}) => {`); expect(result.output).toContain(`> 4 | const error = new Error('my-message');`); }); @@ -99,7 +99,7 @@ for (const useIntermediateMergeReport of [false, true] as const) { module.exports = { assert }; `, 'a.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; const { assert } = require('utils/utils.js'); test('fail', async ({}) => { assert(false); @@ -127,7 +127,7 @@ for (const useIntermediateMergeReport of [false, true] as const) { `, 'a.spec.ts': ` import { ohMy } from './helper'; - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('foobar', async ({}) => { ohMy(); }); @@ -157,13 +157,13 @@ for (const useIntermediateMergeReport of [false, true] as const) { }; `, 'dir/a.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('slow test', async ({}) => { await new Promise(f => setTimeout(f, 2500)); }); `, 'dir/b.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('fast test', async ({}) => { await new Promise(f => setTimeout(f, 1)); }); @@ -190,7 +190,7 @@ for (const useIntermediateMergeReport of [false, true] as const) { }; `, 'dir/a.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('failing1', async ({}) => { expect(1).toBe(2); }); @@ -218,7 +218,7 @@ for (const useIntermediateMergeReport of [false, true] as const) { }; `, 'dir/a.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('first', async ({}) => { }); test('second (hanging)', async ({}) => { @@ -244,7 +244,7 @@ for (const useIntermediateMergeReport of [false, true] as const) { }; `, 'dir/a.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test.describe.parallel('suite', () => { test('inner slow test', async ({}) => { await new Promise(f => setTimeout(f, 1000)); @@ -272,7 +272,7 @@ for (const useIntermediateMergeReport of [false, true] as const) { }; `, 'dir/a.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('slow test', async ({}) => { await new Promise(f => setTimeout(f, 1000)); }); @@ -289,7 +289,7 @@ for (const useIntermediateMergeReport of [false, true] as const) { test('should print flaky failures', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('foobar', async ({}, testInfo) => { expect(testInfo.retry).toBe(1); }); @@ -303,7 +303,7 @@ for (const useIntermediateMergeReport of [false, true] as const) { test('should print flaky timeouts', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('foobar', async ({}, testInfo) => { if (!testInfo.retry) await new Promise(f => setTimeout(f, 2000)); @@ -318,7 +318,7 @@ for (const useIntermediateMergeReport of [false, true] as const) { test('should print stack-less errors', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('foobar', async ({}) => { const e = new Error('Hello'); delete e.stack; @@ -334,7 +334,7 @@ for (const useIntermediateMergeReport of [false, true] as const) { test('should print errors with inconsistent message/stack', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('foobar', async function myTest({}) { const e = new Error('Hello'); // Force stack to contain "Hello". @@ -361,7 +361,7 @@ for (const useIntermediateMergeReport of [false, true] as const) { test('should not crash on undefined body with manual attachments', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('one', async ({}, testInfo) => { testInfo.attachments.push({ name: 'foo.txt', @@ -380,7 +380,7 @@ for (const useIntermediateMergeReport of [false, true] as const) { test('should report fatal errors at the end', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.spec.ts': ` - import { test as base, expect } from '@playwright/test'; + import { test as base, expect } from '@okep/test'; const test = base.extend({ fixture: [async ({ }, use) => { await use(); @@ -391,7 +391,7 @@ for (const useIntermediateMergeReport of [false, true] as const) { }); `, 'b.spec.ts': ` - import { test as base, expect } from '@playwright/test'; + import { test as base, expect } from '@okep/test'; const test = base.extend({ fixture: [async ({ }, use) => { await use(); @@ -410,7 +410,7 @@ for (const useIntermediateMergeReport of [false, true] as const) { test('should contain at most 1 decimal for humanized timing', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('should work', () => {}); ` }); @@ -419,4 +419,4 @@ for (const useIntermediateMergeReport of [false, true] as const) { expect(result.output).toMatch(/\d+ passed \(\d+(\.\d)?(ms|s)\)/); }); }); -} \ No newline at end of file +} diff --git a/tests/playwright-test/reporter-blob.spec.ts b/tests/playwright-test/reporter-blob.spec.ts index 56b29ed2a8b10..ca20b1740fc10 100644 --- a/tests/playwright-test/reporter-blob.spec.ts +++ b/tests/playwright-test/reporter-blob.spec.ts @@ -15,11 +15,11 @@ */ import * as fs from 'fs'; -import type { PlaywrightTestConfig } from '@playwright/test'; +import type { PlaywrightTestConfig } from '@okep/test'; import path from 'path'; import url from 'url'; import type { HttpServer } from '../../packages/pw-recorder-core/src/utils'; -import { startHtmlReportServer } from '../../packages/playwright/lib/reporters/html'; +import { startHtmlReportServer } from '../../packages/pw-recorder/lib/reporters/html'; import { expect as baseExpect, test as baseTest, stripAnsi } from './playwright-test-fixtures'; import extractZip from '../../packages/pw-recorder-core/bundles/zip/node_modules/extract-zip'; import * as yazl from '../../packages/pw-recorder-core/bundles/zip/node_modules/yazl'; @@ -97,7 +97,7 @@ test('should call methods in right order', async ({ runInlineTest, mergeReports }; `, 'a.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('math 1', async ({}) => { expect(1 + 1).toBe(2); }); @@ -110,7 +110,7 @@ test('should call methods in right order', async ({ runInlineTest, mergeReports test.skip('skipped 1', async ({}) => {}); `, 'b.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('math 2', async ({}) => { expect(1 + 1).toBe(2); }); @@ -120,7 +120,7 @@ test('should call methods in right order', async ({ runInlineTest, mergeReports test.skip('skipped 2', async ({}) => {}); `, 'c.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('math 3', async ({}) => { expect(1 + 1).toBe(2); }); @@ -164,13 +164,13 @@ test('should merge into html with dependencies', async ({ runInlineTest, mergeRe }; `, 'setup.js': ` - import { test as setup } from '@playwright/test'; + import { test as setup } from '@okep/test'; setup('login once', async ({}) => { await setup.step('login step', async () => {}); }); `, 'a.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('math 1', async ({}) => { expect(1 + 1).toBe(2); }); @@ -183,7 +183,7 @@ test('should merge into html with dependencies', async ({ runInlineTest, mergeRe test.skip('skipped 1', async ({}) => {}); `, 'b.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('math 2', async ({}) => { expect(1 + 1).toBe(2); }); @@ -193,7 +193,7 @@ test('should merge into html with dependencies', async ({ runInlineTest, mergeRe test.skip('skipped 2', async ({}) => {}); `, 'c.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('math 3', async ({}) => { expect(1 + 1).toBe(2); }); @@ -246,7 +246,7 @@ test('should merge blob into blob', async ({ runInlineTest, mergeReports, showRe }; `, 'a.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('math 1', async ({}) => { expect(1 + 1).toBe(2); }); @@ -259,7 +259,7 @@ test('should merge blob into blob', async ({ runInlineTest, mergeReports, showRe test.skip('skipped 1', async ({}) => {}); `, 'b.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('math 2', async ({}) => { expect(1 + 1).toBe(2); }); @@ -306,7 +306,7 @@ test('should produce consistent step ids', { }; `, 'a.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('math 1', async ({}) => { expect(1 + 1).toBe(2); }); @@ -334,7 +334,7 @@ test('be able to merge incomplete shards', async ({ runInlineTest, mergeReports, }; `, 'a.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('math 1', async ({}) => { }); test('failing 1', async ({}) => { @@ -343,7 +343,7 @@ test('be able to merge incomplete shards', async ({ runInlineTest, mergeReports, test.skip('skipped 1', async ({}) => {}); `, 'b.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('math 2', async ({}) => { }); test('failing 2', async ({}) => { expect(1).toBe(2); @@ -351,7 +351,7 @@ test('be able to merge incomplete shards', async ({ runInlineTest, mergeReports, test.skip('skipped 2', async ({}) => {}); `, 'c.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('math 3', async ({}) => { expect(1 + 1).toBe(2); }); @@ -389,14 +389,14 @@ test('total time is from test run not from merge', async ({ runInlineTest, merge }; `, 'a.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('slow 1', async ({}) => { await new Promise(f => setTimeout(f, 2000)); expect(1 + 1).toBe(2); }); `, 'b.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('slow 1', async ({}) => { await new Promise(f => setTimeout(f, 1000)); expect(1 + 1).toBe(2); @@ -433,7 +433,7 @@ test('merge into list report by default', async ({ runInlineTest, mergeReports } }; `, 'a.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('math 1', async ({}) => { expect(1 + 1).toBe(2); }); @@ -446,7 +446,7 @@ test('merge into list report by default', async ({ runInlineTest, mergeReports } test.skip('skipped 1', async ({}) => {}); `, 'b.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('math 2', async ({}) => { expect(1 + 1).toBe(2); }); @@ -456,7 +456,7 @@ test('merge into list report by default', async ({ runInlineTest, mergeReports } test.skip('skipped 2', async ({}) => {}); `, 'c.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('math 3', async ({}) => { expect(1 + 1).toBe(2); }); @@ -521,7 +521,7 @@ test('should print progress', async ({ runInlineTest, mergeReports }) => { }; `, 'a.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('math 1', async ({}) => { expect(1 + 1).toBe(2); }); @@ -534,7 +534,7 @@ test('should print progress', async ({ runInlineTest, mergeReports }) => { test.skip('skipped 1', async ({}) => {}); `, 'b.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('math 2', async ({}) => { expect(1 + 1).toBe(2); }); @@ -544,7 +544,7 @@ test('should print progress', async ({ runInlineTest, mergeReports }) => { test.skip('skipped 2', async ({}) => {}); `, 'c.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('math 3', async ({}) => { expect(1 + 1).toBe(2); }); @@ -580,7 +580,7 @@ test('preserve attachments', async ({ runInlineTest, mergeReports, showReport, p }; `, 'a.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; import fs from 'fs'; test('first', async ({}) => { @@ -598,7 +598,7 @@ test('preserve attachments', async ({ runInlineTest, mergeReports, showReport, p test.skip('skipped 1', async ({}) => {}); `, 'b.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('math 2', async ({}) => { }); test('failing 2', async ({}) => { expect(1).toBe(2); @@ -643,7 +643,7 @@ test('generate html with attachment urls', async ({ runInlineTest, mergeReports, }; `, 'a.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; import fs from 'fs'; test('first', async ({}) => { @@ -661,7 +661,7 @@ test('generate html with attachment urls', async ({ runInlineTest, mergeReports, test.skip('skipped 1', async ({}) => {}); `, 'b.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('math 2', async ({}) => { }); test('failing 2', async ({}) => { expect(1).toBe(2); @@ -720,7 +720,7 @@ test('resource names should not clash between runs', async ({ runInlineTest, sho }; `, 'a.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; import fs from 'fs'; import path from 'path'; @@ -731,7 +731,7 @@ test('resource names should not clash between runs', async ({ runInlineTest, sho }); `, 'b.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; import fs from 'fs'; import path from 'path'; @@ -790,7 +790,7 @@ test('multiple output reports', async ({ runInlineTest, mergeReports, showReport }; `, 'a.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; import fs from 'fs'; test('first', async ({}) => { @@ -808,7 +808,7 @@ test('multiple output reports', async ({ runInlineTest, mergeReports, showReport test.skip('skipped 1', async ({}) => {}); `, 'b.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('math 2', async ({}) => { }); test('failing 2', async ({}) => { expect(1).toBe(2); @@ -850,7 +850,7 @@ test('multiple output reports based on config', async ({ runInlineTest, mergeRep }; `, 'a.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; import fs from 'fs'; test('first', async ({}) => { @@ -868,7 +868,7 @@ test('multiple output reports based on config', async ({ runInlineTest, mergeRep test.skip('skipped 1', async ({}) => {}); `, 'b.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('math 2', async ({}) => { }); test('failing 2', async ({}) => { expect(1).toBe(2); @@ -909,7 +909,7 @@ test('onError in the report', async ({ runInlineTest, mergeReports, showReport, }; `, 'a.test.ts': ` - import { test as base, expect } from '@playwright/test'; + import { test as base, expect } from '@okep/test'; const test = base.extend<{}, { errorInTearDown: string }>({ errorInTearDown: [async ({ }, use) => { @@ -925,7 +925,7 @@ test('onError in the report', async ({ runInlineTest, mergeReports, showReport, test.skip('skipped 1', async ({}) => {}); `, 'b.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('math 2', async ({}) => { }); test('failing 2', async ({}) => { expect(1).toBe(2); @@ -933,7 +933,7 @@ test('onError in the report', async ({ runInlineTest, mergeReports, showReport, test.skip('skipped 2', async ({}) => {}); `, 'c.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('math 3', async ({}) => { expect(1 + 1).toBe(2); @@ -995,19 +995,19 @@ test('preserve config fields', async ({ runInlineTest, mergeReports }) => { module.exports = ${JSON.stringify(config, null, 2)}; `, 'a.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('math 1', async ({}) => { expect(1 + 1).toBe(2); }); `, 'b.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('math 2', async ({}) => { expect(1 + 1).toBe(2); }); `, 'c.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('math 3', async ({}) => { expect(1 + 1).toBe(2); }); @@ -1079,7 +1079,7 @@ test('preserve stdout and stderr', async ({ runInlineTest, mergeReports }) => { }; `, 'a.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('a test', async ({}) => { expect(1 + 1).toBe(2); console.log('stdout text'); @@ -1129,7 +1129,7 @@ test('encode inline attachments', async ({ runInlineTest, mergeReports }) => { }; `, 'a.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('a test', async ({}) => { expect(1 + 1).toBe(2); test.info().attachments.push({ @@ -1170,7 +1170,7 @@ test('preserve steps in html report', async ({ runInlineTest, mergeReports, show }; `, 'tests/a.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test.beforeAll(() => { expect(1).toBe(1); }) @@ -1225,7 +1225,7 @@ test('support fileName option', async ({ runInlineTest, mergeReports }) => { }; `, 'a.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('math 1 @smoke', async ({}) => {}); `, }); @@ -1250,7 +1250,7 @@ test('support PLAYWRIGHT_BLOB_OUTPUT_DIR env variable', async ({ runInlineTest, }; `, 'a.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('math 1 @smoke', async ({}) => {}); `, }; @@ -1274,7 +1274,7 @@ test('support PLAYWRIGHT_BLOB_OUTPUT_NAME env variable', async ({ runInlineTest, }; `, 'a.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('math 1 @smoke', async ({}) => {}); `, }; @@ -1299,7 +1299,7 @@ test('support outputFile option', async ({ runInlineTest, mergeReports }) => { }; `, 'a.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('math 1 @smoke', async ({}) => {}); `, }); @@ -1324,11 +1324,11 @@ test('support PLAYWRIGHT_BLOB_OUTPUT_FILE environment variable', async ({ runInl }; `, 'a.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('math 1 @smoke', async ({}) => {}); `, 'b.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('math 1 @smoke', async ({}) => {}); `, }; @@ -1357,7 +1357,7 @@ test('keep projects with same name different bot name separate', async ({ runInl }; `, 'a.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('test 1', async ({}) => { expect('${reportName}').toBe('second'); }); `, }); @@ -1395,7 +1395,7 @@ test('blob-report should be next to package.json', async ({ runInlineTest }, tes module.exports = { projects: [ {} ] }; `, 'foo/bar/baz/tests/a.spec.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; const fs = require('fs'); test('pass', ({}, testInfo) => { }); @@ -1418,7 +1418,7 @@ test('blob report should include version', async ({ runInlineTest }) => { }; `, 'tests/a.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('test 1', async ({}) => {}); `, }; @@ -1466,11 +1466,11 @@ test('merge-reports should throw if report version is from the future', async ({ }; `, 'tests/a.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('test 1', async ({}) => {}); `, 'tests/b.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('test 1', async ({}) => {}); `, }; @@ -1507,7 +1507,7 @@ test('should merge blob reports with same name', async ({ runInlineTest, mergeRe }; `, 'a.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('math 1', async ({}) => { expect(1 + 1).toBe(2); }); @@ -1520,7 +1520,7 @@ test('should merge blob reports with same name', async ({ runInlineTest, mergeRe test.skip('skipped 1', async ({}) => {}); `, 'b.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('math 2', async ({}) => { expect(1 + 1).toBe(2); }); @@ -1562,7 +1562,7 @@ test('reporter list in the custom config', async ({ runInlineTest, mergeReports module.exports = { reporter: 'blob' }; `, 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('first', async ({}) => { }); @@ -1615,7 +1615,7 @@ test('merge reports with different rootDirs', async ({ runInlineTest, mergeRepor reporter: [['blob', { outputDir: 'blob-report' }]] };`, 'dir1/tests1/a.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('math 1', async ({}) => { }); `, }; @@ -1626,7 +1626,7 @@ test('merge reports with different rootDirs', async ({ runInlineTest, mergeRepor reporter: [['blob', { outputDir: 'blob-report' }]] };`, 'dir2/tests2/b.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('math 2', async ({}) => { }); `, }; @@ -1669,11 +1669,11 @@ test('merge reports same rootDirs', async ({ runInlineTest, mergeReports }) => { reporter: [['blob', { outputDir: 'blob-report' }]] };`, 'tests/dir1/a.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('math 1', async ({}) => { }); `, 'tests/dir2/b.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('math 2', async ({}) => { }); `, }; @@ -1728,7 +1728,7 @@ test('merge reports with different rootDirs and path separators', async ({ runIn reporter: [['blob', { outputDir: 'blob-report' }]] };`, 'dir1/tests1/a.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('math 1', async ({}) => { }); `, }; @@ -1739,7 +1739,7 @@ test('merge reports with different rootDirs and path separators', async ({ runIn reporter: [['blob', { outputDir: 'blob-report' }]] };`, 'dir2/tests2/b.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('math 2', async ({}) => { }); `, }; @@ -1789,11 +1789,11 @@ test('merge reports without --config preserves path separators', async ({ runInl reporter: [['blob', { outputDir: 'blob-report' }]] };`, 'dir1/tests1/a.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('math 1', async ({}) => { }); `, 'dir1/tests2/b.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('math 2', async ({}) => { }); `, }; @@ -1857,7 +1857,7 @@ test('merge reports must not change test ids when there is no need to', async ({ ] };`, 'a.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('test 1', async ({}) => { }); test('test 2', async ({}) => { }); test('test 3', async ({}) => { }); @@ -1912,7 +1912,7 @@ test('TestSuite.project() should return owning project', async ({ runInlineTest, projects: [{name: 'my-project'}] };`, 'tests/a.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('math 1', async ({}) => { }); `, }; @@ -1986,13 +1986,13 @@ test('preserve static annotations when tests did not run', async ({ runInlineTes }; `, 'setup.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('setup', { annotation: [{ type: "sample", description: "uno" }] }, async ({}) => { expect(1).toBe(2); }); `, 'a.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('first', { annotation: [{ type: "sample", description: "uno" }] }, async ({}) => {}); test.skip('second', { annotation: [{ type: "sample", description: "dos" }] }, async ({}) => {}); ` @@ -2032,7 +2032,7 @@ test('project filter in report name', async ({ runInlineTest }) => { }; `, 'a.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('math 1 @smoke', async ({}) => {}); `, }; diff --git a/tests/playwright-test/reporter-dot.spec.ts b/tests/playwright-test/reporter-dot.spec.ts index 5afda3f7bda2d..90c9f9399db43 100644 --- a/tests/playwright-test/reporter-dot.spec.ts +++ b/tests/playwright-test/reporter-dot.spec.ts @@ -24,7 +24,7 @@ for (const useIntermediateMergeReport of [false, true] as const) { test('render expected', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('one', async ({}) => { expect(1).toBe(1); }); @@ -37,7 +37,7 @@ for (const useIntermediateMergeReport of [false, true] as const) { test('render unexpected', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('one', async ({}) => { expect(1).toBe(0); }); @@ -50,7 +50,7 @@ for (const useIntermediateMergeReport of [false, true] as const) { test('render unexpected after retry', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('one', async ({}) => { expect(1).toBe(0); }); @@ -65,7 +65,7 @@ for (const useIntermediateMergeReport of [false, true] as const) { test('render flaky', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('one', async ({}, testInfo) => { expect(testInfo.retry).toBe(3); }); @@ -85,7 +85,7 @@ for (const useIntermediateMergeReport of [false, true] as const) { module.exports = { reporter: 'dot' }; `, 'a.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('one', async ({}) => { expect(1).toBe(1); }); @@ -98,7 +98,7 @@ for (const useIntermediateMergeReport of [false, true] as const) { test('render 243 tests in rows by 80', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; for (let i = 0; i < 243; i++) { test('test' + i, () => {}); } @@ -112,4 +112,4 @@ for (const useIntermediateMergeReport of [false, true] as const) { colors.green('·').repeat(3)); }); }); -} \ No newline at end of file +} diff --git a/tests/playwright-test/reporter-github.spec.ts b/tests/playwright-test/reporter-github.spec.ts index 7f91fa8795d7e..8b3c1df91f3e3 100644 --- a/tests/playwright-test/reporter-github.spec.ts +++ b/tests/playwright-test/reporter-github.spec.ts @@ -30,7 +30,7 @@ for (const useIntermediateMergeReport of [false, true] as const) { test('print GitHub annotations for success', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('example1', async ({}) => { expect(1 + 1).toBe(2); }); @@ -45,7 +45,7 @@ for (const useIntermediateMergeReport of [false, true] as const) { test('print GitHub annotations for failed tests', async ({ runInlineTest }, testInfo) => { const result = await runInlineTest({ 'a.test.js': ` - const { test, expect } = require('@playwright/test'); + const { test, expect } = require('@okep/test'); test('example', async ({}) => { expect(1 + 1).toBe(3); }); @@ -67,7 +67,7 @@ for (const useIntermediateMergeReport of [false, true] as const) { }; `, 'a.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('slow test', async ({}) => { await new Promise(f => setTimeout(f, 200)); }); @@ -82,7 +82,7 @@ for (const useIntermediateMergeReport of [false, true] as const) { test('print GitHub annotations for global error', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.test.ts': ` - import { test as base, expect } from '@playwright/test'; + import { test as base, expect } from '@okep/test'; const test = base.extend({ w: [async ({}, use) => { await use(); diff --git a/tests/playwright-test/reporter-html.spec.ts b/tests/playwright-test/reporter-html.spec.ts index 30e8e17ba0d32..68b7a10d5f170 100644 --- a/tests/playwright-test/reporter-html.spec.ts +++ b/tests/playwright-test/reporter-html.spec.ts @@ -19,7 +19,7 @@ import path from 'path'; import url from 'url'; import { test as baseTest, expect as baseExpect, createImage } from './playwright-test-fixtures'; import type { HttpServer } from '../../packages/pw-recorder-core/src/utils'; -import { startHtmlReportServer } from '../../packages/playwright/lib/reporters/html'; +import { startHtmlReportServer } from '../../packages/pw-recorder/lib/reporters/html'; import { msToString } from '../../packages/web/src/uiUtils'; const { spawnAsync } = require('../../packages/pw-recorder-core/lib/utils'); @@ -53,7 +53,7 @@ for (const useIntermediateMergeReport of [false] as const) { module.exports = { name: 'project-name' }; `, 'a.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('passes', async ({}) => {}); test('fails', async ({}) => { expect(1).toBe(2); @@ -89,7 +89,7 @@ for (const useIntermediateMergeReport of [false] as const) { test('should allow navigating to testId=test.id', async ({ runInlineTest, page, showReport }) => { const result = await runInlineTest({ 'a.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('passes', async ({ page }) => { console.log('TESTID=' + test.info().testId); await expect(1).toBe(1); @@ -121,7 +121,7 @@ for (const useIntermediateMergeReport of [false] as const) { module.exports = { preserveOutput: 'failures-only' }; `, 'a.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('passes', async ({ page }, testInfo) => { expect(2).toEqual(2); }); @@ -137,7 +137,7 @@ for (const useIntermediateMergeReport of [false] as const) { module.exports = { preserveOutput: 'failures-only' }; `, 'a.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('passes', async ({ page }, testInfo) => { const screenshot = testInfo.outputPath('screenshot.png'); await page.screenshot({ path: screenshot }); @@ -163,7 +163,7 @@ for (const useIntermediateMergeReport of [false] as const) { 'a.test.js-snapshots/expected-darwin.png': expected, 'a.test.js-snapshots/expected-win32.png': expected, 'a.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('fails', async ({ page }, testInfo) => { await page.setContent('Hello World'); const screenshot = await page.screenshot(); @@ -236,7 +236,7 @@ for (const useIntermediateMergeReport of [false] as const) { '__screenshots__/a.test.js/fails-2.png': whiteImage, '__screenshots__/a.test.js/fails-3.png': redImage, 'a.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('fails', async ({ page }, testInfo) => { testInfo.snapshotSuffix = ''; await expect.soft(page).toHaveScreenshot({ timeout: 1000 }); @@ -270,7 +270,7 @@ for (const useIntermediateMergeReport of [false] as const) { 'a.test.js-snapshots/expected-darwin.png': expected, 'a.test.js-snapshots/expected-win32.png': expected, 'a.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('fails', async ({ page }, testInfo) => { await page.setContent('Hello World'); const screenshot = await page.screenshot(); @@ -300,7 +300,7 @@ for (const useIntermediateMergeReport of [false] as const) { module.exports = { use: { viewport: { width: 200, height: 200 }} }; `, 'a.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('fails', async ({ page }, testInfo) => { testInfo.snapshotSuffix = ''; await page.evaluate(() => { @@ -339,7 +339,7 @@ for (const useIntermediateMergeReport of [false] as const) { 'a.test.js-snapshots/expected-darwin': expected, 'a.test.js-snapshots/expected-win32': expected, 'a.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('fails', async ({ page }, testInfo) => { await page.setContent('Hello World'); const screenshot = await page.screenshot(); @@ -369,7 +369,7 @@ for (const useIntermediateMergeReport of [false] as const) { }; `, 'a.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('fails', async ({ page }) => { await page.setContent('Failed state'); await expect(true).toBeFalsy(); @@ -401,7 +401,7 @@ for (const useIntermediateMergeReport of [false] as const) { }; `, 'a.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('passes', async ({ page }) => { await page.evaluate('2 + 2'); }); @@ -426,7 +426,7 @@ for (const useIntermediateMergeReport of [false] as const) { test('should include stdio', async ({ runInlineTest, page, showReport }) => { const result = await runInlineTest({ 'a.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('fails', async ({ page }) => { console.log('First line'); console.log('Second line'); @@ -449,7 +449,7 @@ for (const useIntermediateMergeReport of [false] as const) { test('should highlight error', async ({ runInlineTest, page, showReport }) => { const result = await runInlineTest({ 'a.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('fails', async ({ page }) => { await expect(true).toBeFalsy(); }); @@ -469,7 +469,7 @@ for (const useIntermediateMergeReport of [false] as const) { module.exports = { use: { trace: 'on' } }; `, 'a.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; async function evaluateWrapper(page, expression) { await page.evaluate(expression); } @@ -505,7 +505,7 @@ for (const useIntermediateMergeReport of [false] as const) { module.exports = { use: { trace: 'on' } }; `, 'a.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('passes', async ({ page }) => { await page.evaluate('2 + 2'); }); @@ -535,7 +535,7 @@ for (const useIntermediateMergeReport of [false] as const) { module.exports = { use: { trace: 'on' } }; `, 'a.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('passes', async ({ page }) => { await page.evaluate('2 + 2'); }); @@ -556,7 +556,7 @@ for (const useIntermediateMergeReport of [false] as const) { module.exports = { use: { trace: 'on' } }; `, 'a.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('passes', async ({ playwright, page }) => { await page.evaluate('2 + 2'); const request = await playwright.request.newContext(); @@ -590,7 +590,7 @@ for (const useIntermediateMergeReport of [false] as const) { module.exports = { use: { trace: 'on' } }; `, 'a.test.js': ` - import { test, expect, request } from '@playwright/test'; + import { test, expect, request } from '@okep/test'; test('log two contexts', async function({ }) { const api1 = await request.newContext(); const api2 = await request.newContext(); @@ -622,7 +622,7 @@ for (const useIntermediateMergeReport of [false] as const) { module.exports = { use: { trace: 'on' } }; `, 'a.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('passes', async ({ page }) => { await page.evaluate('2 + 2'); }); @@ -652,7 +652,7 @@ for (const useIntermediateMergeReport of [false] as const) { module.exports = { timeout: 3000 }; `, 'a.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test.beforeAll(() => { console.log('beforeAll 1'); }); @@ -723,7 +723,7 @@ for (const useIntermediateMergeReport of [false] as const) { module.exports = { timeout: 1500 }; `, 'a.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('annotated test', async ({ page }) => { test.info().annotations.push({ type: 'issue', description: 'I am not interested in this test' }); }); @@ -743,7 +743,7 @@ for (const useIntermediateMergeReport of [false] as const) { module.exports = { timeout: 1500 }; `, 'a.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('pass test', async ({ page }) => { test.info().annotations.push({ type: 'issue', description: '${server.EMPTY_PAGE}' }); }); @@ -764,7 +764,7 @@ for (const useIntermediateMergeReport of [false] as const) { test('should render text attachments as text', async ({ runInlineTest, page, showReport }) => { const result = await runInlineTest({ 'a.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('passing', async ({ page }, testInfo) => { testInfo.attachments.push({ name: 'example.txt', @@ -805,7 +805,7 @@ for (const useIntermediateMergeReport of [false] as const) { test('should have link for opening HTML attachments in new tab', async ({ runInlineTest, page, showReport }) => { const result = await runInlineTest({ 'a.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('passing', async ({ page }, testInfo) => { testInfo.attach('axe-report.html', { contentType: 'text/html', @@ -831,7 +831,7 @@ for (const useIntermediateMergeReport of [false] as const) { test('should use file-browser friendly extensions for buffer attachments based on contentType', async ({ runInlineTest, showReport, page }, testInfo) => { const result = await runInlineTest({ 'a.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('passing', async ({ page }, testInfo) => { await testInfo.attach('screenshot', { body: await page.screenshot(), contentType: 'image/png' }); await testInfo.attach('some-pdf', { body: Buffer.from('foo'), contentType: 'application/pdf' }); @@ -879,8 +879,8 @@ for (const useIntermediateMergeReport of [false] as const) { test('should strikethrough textual diff', async ({ runInlineTest, showReport, page }) => { const result = await runInlineTest({ 'helper.ts': ` - import { test as base } from '@playwright/test'; - export * from '@playwright/test'; + import { test as base } from '@okep/test'; + export * from '@okep/test'; export const test = base.extend({ auto: [ async ({}, run, testInfo) => { testInfo.snapshotSuffix = ''; @@ -906,8 +906,8 @@ for (const useIntermediateMergeReport of [false] as const) { test('should strikethrough textual diff with commonalities', async ({ runInlineTest, showReport, page }) => { const result = await runInlineTest({ 'helper.ts': ` - import { test as base } from '@playwright/test'; - export * from '@playwright/test'; + import { test as base } from '@okep/test'; + export * from '@okep/test'; export const test = base.extend({ auto: [ async ({}, run, testInfo) => { testInfo.snapshotSuffix = ''; @@ -934,7 +934,7 @@ for (const useIntermediateMergeReport of [false] as const) { test.info().annotations.push({ type: 'issue', description: 'https://github.com/microsoft/playwright/issues/10859' }); const result = await runInlineTest({ 'a.spec.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('sample', async ({}, testInfo) => { if (testInfo.repeatEachIndex === 2) throw new Error('ouch'); @@ -957,7 +957,7 @@ for (const useIntermediateMergeReport of [false] as const) { test.info().annotations.push({ type: 'issue', description: 'https://github.com/microsoft/playwright/issues/10098' }); const result = await runInlineTest({ 'a.spec.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('sample', async ({}, testInfo) => { for (let i = 0; i < 10; ++i) expect(1).toBe(1); @@ -980,7 +980,7 @@ for (const useIntermediateMergeReport of [false] as const) { test.info().annotations.push({ type: 'issue', description: 'https://github.com/microsoft/playwright/issues/11742' }); const result = await runInlineTest({ 'inner.js': ` - const { test, expect } = require('@playwright/test'); + const { test, expect } = require('@okep/test'); test('sample', async ({}) => { expect(2).toBe(2); }); `, 'a.spec.js': `require('./inner')` @@ -999,13 +999,13 @@ for (const useIntermediateMergeReport of [false] as const) { const files = { 'uncommitted.txt': `uncommitted file`, 'playwright.config.ts': ` - import { gitCommitInfo } from 'playwright/lib/plugins'; - import { test, expect } from '@playwright/test'; + import { gitCommitInfo } from 'pw-recorder/lib/plugins'; + import { test, expect } from '@okep/test'; const plugins = [gitCommitInfo()]; - export default { '@playwright/test': { plugins } }; + export default { '@okep/test': { plugins } }; `, 'example.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('sample', async ({}) => { expect(2).toBe(2); }); `, }; @@ -1053,8 +1053,8 @@ for (const useIntermediateMergeReport of [false] as const) { const result = await runInlineTest({ 'uncommitted.txt': `uncommitted file`, 'playwright.config.ts': ` - import { gitCommitInfo } from 'playwright/lib/plugins'; - import { test, expect } from '@playwright/test'; + import { gitCommitInfo } from 'pw-recorder/lib/plugins'; + import { test, expect } from '@okep/test'; const plugin = gitCommitInfo({ info: { 'revision.id': '1234567890', @@ -1064,11 +1064,11 @@ for (const useIntermediateMergeReport of [false] as const) { 'revision.email': 'shakespeare@example.local', }, }); - export default { '@playwright/test': { plugins: [plugin] } }; + export default { '@okep/test': { plugins: [plugin] } }; `, 'example.spec.ts': ` - import { gitCommitInfo } from 'playwright/lib/plugins'; - import { test, expect } from '@playwright/test'; + import { gitCommitInfo } from 'pw-recorder/lib/plugins'; + import { test, expect } from '@okep/test'; test('sample', async ({}) => { expect(2).toBe(2); }); `, }, { reporter: 'dot,html' }, { PLAYWRIGHT_HTML_OPEN: 'never', GITHUB_REPOSITORY: 'microsoft/playwright-example-for-test', GITHUB_RUN_ID: 'example-run-id', GITHUB_SERVER_URL: 'https://playwright.dev', GITHUB_SHA: 'example-sha' }, undefined); @@ -1096,7 +1096,7 @@ for (const useIntermediateMergeReport of [false] as const) { export default {}; `, 'example.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('my sample test', async ({}) => { expect(2).toBe(2); }); `, }, { reporter: 'dot,html' }, { PLAYWRIGHT_HTML_OPEN: 'never' }, undefined); @@ -1120,7 +1120,7 @@ for (const useIntermediateMergeReport of [false] as const) { }; `, 'example.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('my sample test', async ({}) => { expect(2).toBe(2); }); `, }, { reporter: 'dot,html' }, { PLAYWRIGHT_HTML_OPEN: 'never' }); @@ -1143,7 +1143,7 @@ for (const useIntermediateMergeReport of [false] as const) { } `, 'a.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('passes', async ({}) => { }); `, @@ -1163,7 +1163,7 @@ for (const useIntermediateMergeReport of [false] as const) { } `, 'a.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('passes', async ({}) => { }); `, @@ -1182,7 +1182,7 @@ for (const useIntermediateMergeReport of [false] as const) { module.exports = { reporter: [['html', { outputFolder: '../my-report/' }]] }; `, 'nested/project/a.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('one', async ({}) => { expect(1).toBe(1); }); @@ -1200,7 +1200,7 @@ for (const useIntermediateMergeReport of [false] as const) { module.exports = { projects: [ {} ] }; `, 'foo/bar/baz/tests/a.spec.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; const fs = require('fs'); test('pass', ({}, testInfo) => { }); @@ -1224,7 +1224,7 @@ for (const useIntermediateMergeReport of [false] as const) { module.exports = { projects: [ {} ] }; `, 'foo/bar/baz/tests/a.spec.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; const fs = require('fs'); test('pass', ({}, testInfo) => { }); @@ -1252,19 +1252,19 @@ for (const useIntermediateMergeReport of [false] as const) { }; `, 'a.test.js': ` - const { expect, test } = require('@playwright/test'); + const { expect, test } = require('@okep/test'); test('@smoke @passed passed', async ({}) => { expect(1).toBe(1); }); `, 'b.test.js': ` - const { expect, test } = require('@playwright/test'); + const { expect, test } = require('@okep/test'); test('@smoke @failed failed', async ({}) => { expect(1).toBe(2); }); `, 'c.test.js': ` - const { expect, test } = require('@playwright/test'); + const { expect, test } = require('@okep/test'); test('@regression @failed failed', { tag: '@foo' }, async ({}) => { expect(1).toBe(2); }); @@ -1347,7 +1347,7 @@ for (const useIntermediateMergeReport of [false] as const) { }; `, 'a.test.js': ` - const { expect, test } = require('@playwright/test'); + const { expect, test } = require('@okep/test'); test('pass', async ({}) => { expect(1).toBe(1); }); @@ -1389,7 +1389,7 @@ for (const useIntermediateMergeReport of [false] as const) { }; `, 'a.test.js': ` - const { expect, test } = require('@playwright/test'); + const { expect, test } = require('@okep/test'); test('@flaky pass', async ({}) => { expect(1).toBe(1); }); @@ -1430,7 +1430,7 @@ for (const useIntermediateMergeReport of [false] as const) { }; `, 'a.test.js': ` - const { expect, test } = require('@playwright/test'); + const { expect, test } = require('@okep/test'); test('@finally @oddly @questioningly @sleepily @warmly @healthily @smoke @flaky this is a very long test title that should not overflow and should be truncated. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.', async ({}) => { expect(1).toBe(1); }); @@ -1451,7 +1451,7 @@ for (const useIntermediateMergeReport of [false] as const) { test('with describe. with dash. should show filtered tests by labels when click on label', async ({ runInlineTest, showReport, page }) => { const result = await runInlineTest({ 'a.test.js': ` - const { expect, test } = require('@playwright/test'); + const { expect, test } = require('@okep/test'); test.describe('Error Pages', () => { test('@regression passes', async ({}) => { expect(1).toBe(1); @@ -1462,7 +1462,7 @@ for (const useIntermediateMergeReport of [false] as const) { }); `, 'b.test.js': ` - const { expect, test } = require('@playwright/test'); + const { expect, test } = require('@okep/test'); test.describe('Error Pages', () => { test('@smoke fails', async ({}) => { @@ -1540,7 +1540,7 @@ for (const useIntermediateMergeReport of [false] as const) { test('tags with special symbols', async ({ runInlineTest, showReport, page }) => { const result = await runInlineTest({ 'a.test.js': ` - const { expect, test } = require('@playwright/test'); + const { expect, test } = require('@okep/test'); const tags = ['@smoke-p1', '@issue[123]', '@issue#123', '@$$$', '@tl/dr']; test.describe('Error Pages', () => { @@ -1583,13 +1583,13 @@ for (const useIntermediateMergeReport of [false] as const) { test('click label should change URL', async ({ runInlineTest, showReport, page }) => { const result = await runInlineTest({ 'a.test.js': ` - const { expect, test } = require('@playwright/test'); + const { expect, test } = require('@okep/test'); test('@regression passes', async ({}) => { expect(1).toBe(1); }); `, 'b.test.js': ` - const { expect, test } = require('@playwright/test'); + const { expect, test } = require('@okep/test'); test('@smoke fails', async ({}) => { expect(1).toBe(2); }); @@ -1624,7 +1624,7 @@ for (const useIntermediateMergeReport of [false] as const) { test('filter should update stats', async ({ runInlineTest, showReport, page }) => { const result = await runInlineTest({ 'a.test.js': ` - const { expect, test } = require('@playwright/test'); + const { expect, test } = require('@okep/test'); const names = ['one foo', 'two foo', 'three bar', 'four bar', 'five baz']; for (const name of names) { test('a-' + name, async ({}) => { @@ -1634,7 +1634,7 @@ for (const useIntermediateMergeReport of [false] as const) { } `, 'b.test.js': ` - const { expect, test } = require('@playwright/test'); + const { expect, test } = require('@okep/test'); const names = ['one foo', 'two foo', 'three bar', 'four bar', 'five baz']; for (const name of names) { test('b-' + name, async ({}) => { @@ -1698,7 +1698,7 @@ for (const useIntermediateMergeReport of [false] as const) { test('labels should be applied together with status filter', async ({ runInlineTest, showReport, page }) => { const result = await runInlineTest({ 'a.test.js': ` - const { expect, test } = require('@playwright/test'); + const { expect, test } = require('@okep/test'); test('@regression passes', async ({}) => { expect(1).toBe(1); }); @@ -1708,7 +1708,7 @@ for (const useIntermediateMergeReport of [false] as const) { }); `, 'b.test.js': ` - const { expect, test } = require('@playwright/test'); + const { expect, test } = require('@okep/test'); test('@smoke fails', async ({}) => { expect(1).toBe(2); }); @@ -1764,7 +1764,7 @@ for (const useIntermediateMergeReport of [false] as const) { test('tests should be filtered by label input in search field', async ({ runInlineTest, showReport, page }) => { const result = await runInlineTest({ 'a.test.js': ` - const { expect, test } = require('@playwright/test'); + const { expect, test } = require('@okep/test'); test('@regression passes', async ({}) => { expect(1).toBe(1); }); @@ -1774,7 +1774,7 @@ for (const useIntermediateMergeReport of [false] as const) { }); `, 'b.test.js': ` - const { expect, test } = require('@playwright/test'); + const { expect, test } = require('@okep/test'); test('@smoke fails', async ({}) => { expect(1).toBe(2); }); @@ -1815,19 +1815,19 @@ for (const useIntermediateMergeReport of [false] as const) { test('if label contains similar words only one label should be selected', async ({ runInlineTest, showReport, page }) => { const result = await runInlineTest({ 'a.test.js': ` - const { expect, test } = require('@playwright/test'); + const { expect, test } = require('@okep/test'); test('@company passes', async ({}) => { expect(1).toBe(1); }); `, 'b.test.js': ` - const { expect, test } = require('@playwright/test'); + const { expect, test } = require('@okep/test'); test('@company_information fails', async ({}) => { expect(1).toBe(2); }); `, 'c.test.js': ` - const { expect, test } = require('@playwright/test'); + const { expect, test } = require('@okep/test'); test('@company_information_widget fails', async ({}) => { expect(1).toBe(2); }); @@ -1893,19 +1893,19 @@ for (const useIntermediateMergeReport of [false] as const) { test('handling of meta or ctrl key', async ({ runInlineTest, showReport, page, }) => { const result = await runInlineTest({ 'a.test.js': ` - const { expect, test } = require('@playwright/test'); + const { expect, test } = require('@okep/test'); test('@smoke @regression passes', async ({}) => { expect(1).toBe(1); }); `, 'b.test.js': ` - const { expect, test } = require('@playwright/test'); + const { expect, test } = require('@okep/test'); test('@smoke @flaky passes', async ({}) => { expect(1).toBe(1); }); `, 'c.test.js': ` - const { expect, test } = require('@playwright/test'); + const { expect, test } = require('@okep/test'); test('@regression @flaky passes', async ({}) => { expect(1).toBe(1); }); @@ -2024,7 +2024,7 @@ for (const useIntermediateMergeReport of [false] as const) { }; `, 'a.test.js': ` - const { expect, test } = require('@playwright/test'); + const { expect, test } = require('@okep/test'); test.describe('Root describe', () => { test.describe('@Monitoring', () => { test('Test passed -- @call @call-details @e2e @regression #VQ457', async ({}) => { @@ -2034,7 +2034,7 @@ for (const useIntermediateMergeReport of [false] as const) { }); `, 'b.test.js': ` - const { expect, test } = require('@playwright/test'); + const { expect, test } = require('@okep/test'); test.describe('Root describe', () => { test.describe('@Notifications', () => { test('Test failed -- @call @call-details @e2e @regression #VQ458', async ({}) => { @@ -2044,7 +2044,7 @@ for (const useIntermediateMergeReport of [false] as const) { }); `, 'c.test.js': ` - const { expect, test } = require('@playwright/test'); + const { expect, test } = require('@okep/test'); test('Test without describe -- @call @call-details @e2e @regression #VQ459', async ({}) => { expect(1).toBe(0); }); @@ -2107,7 +2107,7 @@ for (const useIntermediateMergeReport of [false] as const) { 'main.spec.ts': ` import firstTest from './first'; import secondTest from './second'; - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test.describe('main', () => { test.describe('first', firstTest); @@ -2118,7 +2118,7 @@ for (const useIntermediateMergeReport of [false] as const) { }); `, 'first.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; // comments to change the line number // comment @@ -2132,7 +2132,7 @@ for (const useIntermediateMergeReport of [false] as const) { } `, 'second.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; export default function() { test('passes', () => {}); @@ -2154,7 +2154,7 @@ for (const useIntermediateMergeReport of [false] as const) { test.info().annotations.push({ type: 'issue', description: 'https://github.com/microsoft/playwright/issues/29984' }); await runInlineTest({ 'main.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('test 0', async ({}) => {}); test.describe('describe 1', () => { test('test 1', async ({}) => {}); @@ -2186,12 +2186,12 @@ for (const useIntermediateMergeReport of [false] as const) { test('tests should filter by file', async ({ runInlineTest, showReport, page }) => { const result = await runInlineTest({ 'file-a.test.js': ` - const { test } = require('@playwright/test'); + const { test } = require('@okep/test'); test('a test 1', async ({}) => {}); test('a test 2', async ({}) => {}); `, 'file-b.test.js': ` - const { test } = require('@playwright/test'); + const { test } = require('@okep/test'); test('b test 1', async ({}) => {}); test('b test 2', async ({}) => {}); `, @@ -2221,7 +2221,7 @@ for (const useIntermediateMergeReport of [false] as const) { test('tests should filter by status', async ({ runInlineTest, showReport, page }) => { const result = await runInlineTest({ 'a.test.js': ` - const { test, expect } = require('@playwright/test'); + const { test, expect } = require('@okep/test'); test('failed title', async ({}) => { expect(1).toBe(1); }); test('passes title', async ({}) => { expect(1).toBe(2); }); `, @@ -2244,7 +2244,7 @@ for (const useIntermediateMergeReport of [false] as const) { test('tests should filter by annotation texts', async ({ runInlineTest, showReport, page }) => { const result = await runInlineTest({ 'a.test.js': ` - const { test, expect } = require('@playwright/test'); + const { test, expect } = require('@okep/test'); test('annotated test',{ annotation :[{type:'key',description:'value'}]}, async ({}) => {expect(1).toBe(1);}); test('non-annotated test', async ({}) => {expect(1).toBe(2);}); `, @@ -2267,7 +2267,7 @@ for (const useIntermediateMergeReport of [false] as const) { test('tests should filter by fileName:line/column', async ({ runInlineTest, showReport, page }) => { const result = await runInlineTest({ 'a.test.js': ` - const { test, expect } = require('@playwright/test'); + const { test, expect } = require('@okep/test'); test('test1', async ({}) => { expect(1).toBe(1); }); test('test2', async ({}) => { expect(1).toBe(2); }); `, @@ -2297,7 +2297,7 @@ for (const useIntermediateMergeReport of [false] as const) { test('should properly display beforeEach with and without title', async ({ runInlineTest, showReport, page }) => { const result = await runInlineTest({ 'a.test.js': ` - const { test, expect } = require('@playwright/test'); + const { test, expect } = require('@okep/test'); test.beforeEach('titled hook', () => { console.log('titled hook'); }); @@ -2326,7 +2326,7 @@ for (const useIntermediateMergeReport of [false] as const) { test('should properly display beforeAll with and without title', async ({ runInlineTest, showReport, page }) => { const result = await runInlineTest({ 'a.test.js': ` - const { test, expect } = require('@playwright/test'); + const { test, expect } = require('@okep/test'); test.beforeAll('titled hook', () => { console.log('titled hook'); }); @@ -2355,7 +2355,7 @@ for (const useIntermediateMergeReport of [false] as const) { test('should properly display afterEach with and without title', async ({ runInlineTest, showReport, page }) => { const result = await runInlineTest({ 'a.test.js': ` - const { test, expect } = require('@playwright/test'); + const { test, expect } = require('@okep/test'); test.afterEach('titled hook', () => { console.log('titled hook'); }); @@ -2384,7 +2384,7 @@ for (const useIntermediateMergeReport of [false] as const) { test('should properly display afterAll with and without title', async ({ runInlineTest, showReport, page }) => { const result = await runInlineTest({ 'a.test.js': ` - const { test, expect } = require('@playwright/test'); + const { test, expect } = require('@okep/test'); test.afterAll('titled hook', () => { console.log('titled hook'); }); @@ -2413,7 +2413,7 @@ for (const useIntermediateMergeReport of [false] as const) { test('should display top-level errors', async ({ runInlineTest, showReport, page }) => { const result = await runInlineTest({ 'a.test.js': ` - const { test, expect } = require('@playwright/test'); + const { test, expect } = require('@okep/test'); test('passes', async ({}) => { }); `, @@ -2437,7 +2437,7 @@ for (const useIntermediateMergeReport of [false] as const) { test('should not render anonymous describe', async ({ runInlineTest, showReport, page }) => { const result = await runInlineTest({ 'a.test.js': ` - const { expect, test } = require('@playwright/test'); + const { expect, test } = require('@okep/test'); test.describe('Root describe', () => { test.describe(() => { test('Test passed', async ({}) => { diff --git a/tests/playwright-test/reporter-json.spec.ts b/tests/playwright-test/reporter-json.spec.ts index f8ec8b9b0ba8a..0320ad0212140 100644 --- a/tests/playwright-test/reporter-json.spec.ts +++ b/tests/playwright-test/reporter-json.spec.ts @@ -21,7 +21,7 @@ import { test, expect, stripAnsi } from './playwright-test-fixtures'; test('should support spec.ok and stats', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('math works!', async ({}) => { expect(1 + 1).toBe(2); }); @@ -45,7 +45,7 @@ test('should support spec.ok and stats', async ({ runInlineTest }) => { test('should not report skipped due to sharding', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('one', async () => { }); test('two', async () => { @@ -53,7 +53,7 @@ test('should not report skipped due to sharding', async ({ runInlineTest }) => { }); `, 'b.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('three', async () => { }); test('four', async () => { @@ -90,7 +90,7 @@ test('should report projects and stats', async ({ runInlineTest }, testInfo) => }; `, 'a.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('math works!', async ({}) => { expect(1 + 1).toBe(2); }); @@ -122,7 +122,7 @@ test('should report projects and stats', async ({ runInlineTest }, testInfo) => test('should show steps', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('math works!', async ({}) => { expect(1 + 1).toBe(2); await test.step('math works in a step', async () => { @@ -159,7 +159,7 @@ test('should show steps', async ({ runInlineTest }) => { test('should display tags separately from title', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('math works! @USR-MATH-001 @USR-MATH-002', { tag: '@foo' }, async ({}) => { test.info().annotations.push({ type: 'issue', description: 'issue-link' }); test.info().annotations.push({ type: 'novalue' }); @@ -174,7 +174,7 @@ test('should display tags separately from title', async ({ runInlineTest }) => { test('should have relative always-posix paths', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.test.js': ` - const { test, expect } = require('@playwright/test'); + const { test, expect } = require('@okep/test'); test('math works!', async ({}) => { expect(1 + 1).toBe(2); }); @@ -192,7 +192,7 @@ test('should have error position in results', async ({ }) => { const result = await runInlineTest({ 'a.test.js': ` - const { test, expect } = require('@playwright/test'); + const { test, expect } = require('@okep/test'); test('math works!', async ({}) => { expect(1 + 1).toBe(3); }); @@ -210,7 +210,7 @@ test('should add dot in addition to file json with CI', async ({ runInlineTest } module.exports = { reporter: [['json', { outputFile: 'a.json' }]] }; `, 'a.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('one', async ({}) => { expect(1).toBe(1); }); @@ -227,7 +227,7 @@ test('should add line in addition to file json without CI', async ({ runInlineTe module.exports = { reporter: [['json', { outputFile: 'a.json' }]] }; `, 'a.test.js': ` - const { test, expect } = require('@playwright/test'); + const { test, expect } = require('@okep/test'); test('one', async ({}) => { expect(1).toBe(1); }); @@ -240,7 +240,7 @@ test('should add line in addition to file json without CI', async ({ runInlineTe test('should have starting time in results', async ({ runInlineTest }, testInfo) => { const result = await runInlineTest({ 'a.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('math works!', async ({}) => { expect(1 + 1).toBe(2); }); @@ -258,7 +258,7 @@ test.describe('report location', () => { module.exports = { reporter: [['json', { outputFile: '../my-report/a.json' }]] }; `, 'nested/project/a.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('one', async ({}) => { expect(1).toBe(1); }); @@ -276,7 +276,7 @@ test.describe('report location', () => { module.exports = { projects: [ {} ] }; `, 'foo/bar/baz/tests/a.spec.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; const fs = require('fs'); test('pass', ({}, testInfo) => { }); @@ -297,7 +297,7 @@ test.describe('report location', () => { module.exports = { projects: [ {} ] }; `, 'foo/bar/baz/tests/a.spec.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; const fs = require('fs'); test('pass', ({}, testInfo) => { }); @@ -316,7 +316,7 @@ test.describe('report location', () => { module.exports = { projects: [ {} ] }; `, 'tests/a.spec.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; const fs = require('fs'); test('pass', ({}, testInfo) => { }); diff --git a/tests/playwright-test/reporter-junit.spec.ts b/tests/playwright-test/reporter-junit.spec.ts index 2b182e00c0b25..53fd92f3b88ff 100644 --- a/tests/playwright-test/reporter-junit.spec.ts +++ b/tests/playwright-test/reporter-junit.spec.ts @@ -26,13 +26,13 @@ for (const useIntermediateMergeReport of [false, true] as const) { test('should render expected', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('one', async ({}) => { expect(1).toBe(1); }); `, 'b.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('two', async ({}) => { expect(1).toBe(1); }); @@ -53,7 +53,7 @@ for (const useIntermediateMergeReport of [false, true] as const) { test('should render unexpected', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('one', async ({}) => { expect(1).toBe(0); }); @@ -73,7 +73,7 @@ for (const useIntermediateMergeReport of [false, true] as const) { test('should render unexpected after retry', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('one', async ({}) => { expect(1).toBe(0); }); @@ -91,7 +91,7 @@ for (const useIntermediateMergeReport of [false, true] as const) { test('should render flaky', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('one', async ({}, testInfo) => { expect(testInfo.retry).toBe(3); }); @@ -105,7 +105,7 @@ for (const useIntermediateMergeReport of [false, true] as const) { const result = await runInlineTest({ 'a.test.ts': ` import colors from 'colors/safe'; - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('one', async ({}) => { console.log(colors.yellow('Hello world')); console.log('Hello again'); @@ -135,7 +135,7 @@ for (const useIntermediateMergeReport of [false, true] as const) { `, 'a.test.ts': ` import colors from 'colors/safe'; - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('one', async ({}) => { console.log(colors.yellow('Hello world')); }); @@ -156,7 +156,7 @@ for (const useIntermediateMergeReport of [false, true] as const) { }; `, 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('one', async ({}) => { process.stdout.write('Hello world &"\\'<>]]>'); }); @@ -173,7 +173,7 @@ for (const useIntermediateMergeReport of [false, true] as const) { test('should render skipped', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('one', async () => { console.log('Hello world'); }); @@ -193,7 +193,7 @@ for (const useIntermediateMergeReport of [false, true] as const) { test('should report skipped due to sharding', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('one', async () => { }); test('two', async () => { @@ -201,7 +201,7 @@ for (const useIntermediateMergeReport of [false, true] as const) { }); `, 'b.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('three', async () => { }); test('four', async () => { @@ -225,7 +225,7 @@ for (const useIntermediateMergeReport of [false, true] as const) { module.exports = { }; `, 'a.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('one', async ({}) => { expect(1).toBe(1); }); @@ -251,7 +251,7 @@ for (const useIntermediateMergeReport of [false, true] as const) { module.exports = { projects: [ { name: 'project1' }, { name: 'project2' } ] }; `, 'a.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('one', async ({}) => { expect(1).toBe(1); }); @@ -289,7 +289,7 @@ for (const useIntermediateMergeReport of [false, true] as const) { }; `, 'a.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('one', async ({}) => { expect(1).toBe(1); }); @@ -311,7 +311,7 @@ for (const useIntermediateMergeReport of [false, true] as const) { test.skip(useIntermediateMergeReport, 'Blob report hashes attachment paths'); const result = await runInlineTest({ 'a.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test.use({ screenshot: 'on' }); test('one', async ({ page }, testInfo) => { await page.setContent('hello'); @@ -341,7 +341,7 @@ for (const useIntermediateMergeReport of [false, true] as const) { module.exports = { reporter: [['junit', { outputFile: '../my-report/junit/a.xml' }]] }; `, 'project/a.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test.use({ screenshot: 'on' }); test('one', async ({ page }, testInfo) => { await page.setContent('hello'); @@ -376,7 +376,7 @@ for (const useIntermediateMergeReport of [false, true] as const) { const result = await runInlineTest({ 'playwright.config.ts': `module.exports = { reporter: 'junit' };`, 'a.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('one', async ({}, testInfo) => { testInfo.annotations.push({ type: 'test_description', description: 'sample description' }); }); @@ -395,7 +395,7 @@ for (const useIntermediateMergeReport of [false, true] as const) { const result = await runInlineTest({ 'playwright.config.ts': `module.exports = { reporter: 'junit' };`, 'a.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('one', async ({}, testInfo) => { test.slow(); }); @@ -421,7 +421,7 @@ for (const useIntermediateMergeReport of [false, true] as const) { }; `, 'a.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('one', async ({}, testInfo) => { testInfo.annotations.push({ type: 'test_id', description: '1234' }); testInfo.annotations.push({ type: 'test_key', description: 'CALC-2' }); @@ -448,7 +448,7 @@ for (const useIntermediateMergeReport of [false, true] as const) { test('should not embed attachments to a custom testcase property, if not explicitly requested', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('one', async ({}, testInfo) => { const file = testInfo.outputPath('evidence1.txt'); require('fs').writeFileSync(file, 'hello', 'utf8'); @@ -474,7 +474,7 @@ for (const useIntermediateMergeReport of [false, true] as const) { module.exports = { reporter: [['junit', { outputFile: '../my-report/a.xml' }]] }; `, 'nested/project/a.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('one', async ({}) => { expect(1).toBe(1); }); @@ -488,7 +488,7 @@ for (const useIntermediateMergeReport of [false, true] as const) { const result = await runInlineTest({ 'foo/package.json': `{ "name": "foo" }`, 'foo/bar/baz/tests/a.spec.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; const fs = require('fs'); test('pass', ({}, testInfo) => { }); @@ -505,7 +505,7 @@ for (const useIntermediateMergeReport of [false, true] as const) { const result = await runInlineTest({ 'foo/package.json': `{ "name": "foo" }`, 'foo/bar/baz/tests/a.spec.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; const fs = require('fs'); test('pass', ({}, testInfo) => { }); @@ -528,7 +528,7 @@ for (const useIntermediateMergeReport of [false, true] as const) { }; `, 'bar/baz/tests/a.spec.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; const fs = require('fs'); test('pass', ({}, testInfo) => { }); @@ -545,7 +545,7 @@ for (const useIntermediateMergeReport of [false, true] as const) { module.exports = { projects: [ {} ] }; `, 'tests/a.spec.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; const fs = require('fs'); test('pass', ({}, testInfo) => { }); @@ -566,7 +566,7 @@ for (const useIntermediateMergeReport of [false, true] as const) { }; `, 'bar/baz/tests/a.spec.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; const fs = require('fs'); test('pass', ({}, testInfo) => { }); @@ -582,7 +582,7 @@ for (const useIntermediateMergeReport of [false, true] as const) { test.info().annotations.push({ type: 'issue', description: 'https://github.com/microsoft/playwright/issues/30518' }); const result = await runInlineTest({ 'a.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('one', async ({}) => { await new Promise(f => setTimeout(f, 1000)); }); @@ -594,4 +594,4 @@ for (const useIntermediateMergeReport of [false, true] as const) { expect(time).toBeGreaterThan(1); }); }); -} \ No newline at end of file +} diff --git a/tests/playwright-test/reporter-line.spec.ts b/tests/playwright-test/reporter-line.spec.ts index 14959877b5813..e9c632e77a8bd 100644 --- a/tests/playwright-test/reporter-line.spec.ts +++ b/tests/playwright-test/reporter-line.spec.ts @@ -23,7 +23,7 @@ for (const useIntermediateMergeReport of [false, true] as const) { test('render unexpected after retry', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.test.js': ` - const { test, expect } = require('@playwright/test'); + const { test, expect } = require('@okep/test'); test('one', async ({}) => { expect(1).toBe(0); }); @@ -46,7 +46,7 @@ for (const useIntermediateMergeReport of [false, true] as const) { test('render flaky', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('one', async ({}, testInfo) => { expect(testInfo.retry).toBe(3); }); @@ -60,7 +60,7 @@ for (const useIntermediateMergeReport of [false, true] as const) { test('should print flaky failures', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('foobar', async ({}, testInfo) => { expect(testInfo.retry).toBe(1); }); @@ -74,7 +74,7 @@ for (const useIntermediateMergeReport of [false, true] as const) { test('should work on CI', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.test.js': ` - const { test, expect } = require('@playwright/test'); + const { test, expect } = require('@okep/test'); test('one', async ({}) => { expect(1).toBe(0); }); @@ -90,7 +90,7 @@ for (const useIntermediateMergeReport of [false, true] as const) { test('should print output', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('foobar', async ({}, testInfo) => { process.stdout.write('one'); process.stdout.write('two'); @@ -114,7 +114,7 @@ for (const useIntermediateMergeReport of [false, true] as const) { }, async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('passes', async ({}) => { await test.step(\`outer 1.0\`, async () => { @@ -134,7 +134,7 @@ for (const useIntermediateMergeReport of [false, true] as const) { test('should render failed test steps', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('passes', async ({}) => { await test.step('outer 1.0', async () => { await test.step('inner 1.1', async () => { @@ -152,7 +152,7 @@ for (const useIntermediateMergeReport of [false, true] as const) { test('should not render more than one failed test steps in header', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('passes', async ({}) => { await test.step('outer 1.0', async () => { await test.step('inner 1.1', async () => { @@ -173,7 +173,7 @@ for (const useIntermediateMergeReport of [false, true] as const) { test('should not render more than one failed test steps in header (2)', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('passes', async ({}) => { await test.step('outer 1.0', async () => { await test.step('inner 1.1', async () => { @@ -189,4 +189,4 @@ for (const useIntermediateMergeReport of [false, true] as const) { expect(result.exitCode).toBe(1); }); }); -} \ No newline at end of file +} diff --git a/tests/playwright-test/reporter-list.spec.ts b/tests/playwright-test/reporter-list.spec.ts index c57190a5d74af..774bd12d0fad4 100644 --- a/tests/playwright-test/reporter-list.spec.ts +++ b/tests/playwright-test/reporter-list.spec.ts @@ -33,7 +33,7 @@ for (const useIntermediateMergeReport of [false, true] as const) { ] }; `, 'a.test.ts': ` - const { test, expect } = require('@playwright/test'); + const { test, expect } = require('@okep/test'); test('fails', async ({}) => { expect(1).toBe(0); }); @@ -58,7 +58,7 @@ for (const useIntermediateMergeReport of [false, true] as const) { test('render steps', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('passes', async ({}) => { await test.step('outer 1.0', async () => { await test.step('inner 1.1', async () => {}); @@ -94,7 +94,7 @@ for (const useIntermediateMergeReport of [false, true] as const) { test('render steps inline', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('passes', async ({}) => { await test.step('outer 1.0', async () => { await test.step('inner 1.1', async () => {}); @@ -129,7 +129,7 @@ for (const useIntermediateMergeReport of [false, true] as const) { test('render steps in non-TTY mode', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('passes', async ({}) => { await test.step('outer 1.0', async () => { await test.step('inner 1.1', async () => {}); @@ -159,7 +159,7 @@ for (const useIntermediateMergeReport of [false, true] as const) { const TTY_WIDTH = 80; const result = await runInlineTest({ 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('passes', async ({}) => { console.log('a'.repeat(80) + 'b'.repeat(20)); }); @@ -178,7 +178,7 @@ for (const useIntermediateMergeReport of [false, true] as const) { test('render retries', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('flaky', async ({}, testInfo) => { expect(testInfo.retry).toBe(1); }); @@ -203,7 +203,7 @@ for (const useIntermediateMergeReport of [false, true] as const) { ] }; `, 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('failure in very long name', async ({}) => { expect(1).toBe(0); }); @@ -244,7 +244,7 @@ for (const useIntermediateMergeReport of [false, true] as const) { test('render failed test steps', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('passes', async ({}) => { await test.step('outer 1.0', async () => { await test.step('inner 1.1', async () => { diff --git a/tests/playwright-test/reporter-markdown.spec.ts b/tests/playwright-test/reporter-markdown.spec.ts index d24f2561c12c1..d66b43c82bd23 100644 --- a/tests/playwright-test/reporter-markdown.spec.ts +++ b/tests/playwright-test/reporter-markdown.spec.ts @@ -27,7 +27,7 @@ test('simple report', async ({ runInlineTest }) => { }; `, 'dir1/a.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('math 1', async ({}) => { expect(1 + 1).toBe(2); }); @@ -40,7 +40,7 @@ test('simple report', async ({ runInlineTest }) => { test.skip('skipped 1', async ({}) => {}); `, 'dir2/b.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('math 2', async ({}) => { expect(1 + 1).toBe(2); }); @@ -50,7 +50,7 @@ test('simple report', async ({ runInlineTest }) => { test.skip('skipped 2', async ({}) => {}); `, 'c.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('math 3', async ({}) => { expect(1 + 1).toBe(2); }); @@ -87,7 +87,7 @@ test('custom report file', async ({ runInlineTest }) => { }; `, 'a.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('math 1', async ({}) => { expect(1 + 1).toBe(2); }); @@ -111,7 +111,7 @@ test('report error without snippet', async ({ runInlineTest }) => { }; `, 'a.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('math 1', async ({}) => { const e = new Error('My error'); e.stack = null; @@ -139,11 +139,11 @@ test('report with worker error', async ({ runInlineTest }) => { }; `, 'a.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; throw new Error('My error 1'); `, 'b.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; throw new Error('My error 2'); `, }; @@ -155,4 +155,4 @@ test('report with worker error', async ({ runInlineTest }) => { **0 passed** :heavy_check_mark::heavy_check_mark::heavy_check_mark: `); -}); \ No newline at end of file +}); diff --git a/tests/playwright-test/reporter-onend.spec.ts b/tests/playwright-test/reporter-onend.spec.ts index 38665ea2e638c..4902daf23bb87 100644 --- a/tests/playwright-test/reporter-onend.spec.ts +++ b/tests/playwright-test/reporter-onend.spec.ts @@ -30,7 +30,7 @@ test('should override exit code', async ({ runInlineTest }) => { 'reporter.ts': reporter, 'playwright.config.ts': `module.exports = { reporter: './reporter' };`, 'a.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('fail', async ({}) => { expect(1 + 1).toBe(3); }); diff --git a/tests/playwright-test/reporter.spec.ts b/tests/playwright-test/reporter.spec.ts index f036e3e494199..dfb2babffa164 100644 --- a/tests/playwright-test/reporter.spec.ts +++ b/tests/playwright-test/reporter.spec.ts @@ -139,7 +139,7 @@ for (const useIntermediateMergeReport of [false, true] as const) { }; `, 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('not run', async ({}) => { }); test.only('is run', async ({}) => { @@ -172,7 +172,7 @@ onExit }; `, 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('pass', async ({}) => { }); ` @@ -204,7 +204,7 @@ onExit }; `, 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('pass', async ({}) => { }); ` @@ -231,7 +231,7 @@ onExit }; `, 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('pass', async ({}) => { }); ` @@ -250,7 +250,7 @@ onExit test('should not have internal error when steps are finished after timeout', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.test.ts': ` - import { test as base, expect } from '@playwright/test'; + import { test as base, expect } from '@okep/test'; const test = base.extend({ page: async ({ page }, use) => { await use(page); @@ -279,7 +279,7 @@ onExit }; `, 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test.only('pass', () => {}); ` }, { 'reporter': '', 'forbid-only': true }); @@ -350,7 +350,7 @@ onExit }; `, 'a.spec.js': ` - const { test, expect } = require('@playwright/test'); + const { test, expect } = require('@okep/test'); test('test', () => {}); `, }, { 'reporter': '' }); @@ -367,7 +367,7 @@ onExit test('should report correct tests/suites when using grep', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.spec.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test.describe('@foo', () => { test('test1', async ({ }) => { @@ -429,7 +429,7 @@ var __reExport = (target, module2, desc) => { var __toModule = (module2) => { return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", module2 && module2.__esModule && "default" in module2 ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2); }; -var import_test = __toModule(require("@playwright/test")); +var import_test = __toModule(require("@okep/test")); (0, import_test.test)("pass", async () => { }); //# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vc3JjL2Euc3BlYy50cyJdLAogICJzb3VyY2VzQ29udGVudCI6IFsiaW1wb3J0IHsgdGVzdCB9IGZyb20gXCJAcGxheXdyaWdodC90ZXN0XCI7XG5cbnRlc3QoJ3Bhc3MnLCBhc3luYyAoKSA9PiB7fSk7Il0sCiAgIm1hcHBpbmdzIjogIjs7Ozs7Ozs7Ozs7Ozs7Ozs7O0FBQUEsa0JBQXFCO0FBRXJCLHNCQUFLLFFBQVEsWUFBWTtBQUFBOyIsCiAgIm5hbWVzIjogW10KfQo=`, @@ -454,7 +454,7 @@ var import_test = __toModule(require("@playwright/test")); }; `, 'a.spec.js': ` - const { test, expect } = require('@playwright/test'); + const { test, expect } = require('@okep/test'); test('test', () => {}); `, }, { 'reporter': '', 'workers': 1 }); @@ -467,7 +467,7 @@ var import_test = __toModule(require("@playwright/test")); 'reporter.ts': smallReporterJS, 'playwright.config.ts': `module.exports = { reporter: [['./reporter', { printSteps: true, printErrorSnippet: true }]] };`, 'a.spec.js': ` - const { test, expect } = require('@playwright/test'); + const { test, expect } = require('@okep/test'); test('test', async () => { await test.step('step', async () => { expect(1).toBe(2); @@ -524,7 +524,7 @@ onExit 'reporter.ts': smallReporterJS, 'playwright.config.ts': `module.exports = { reporter: [['./reporter', { printSteps: true, printErrorSnippet: true }]] };`, 'a.spec.js': ` - const { test, expect } = require('@playwright/test'); + const { test, expect } = require('@okep/test'); throw new Error('test'); `, }, { 'reporter': '', 'workers': 1 }); @@ -536,7 +536,7 @@ onError: Error: test @ a.spec.js:3 at a.spec.js:3 1 | - 2 | const { test, expect } = require('@playwright/test'); + 2 | const { test, expect } = require('@okep/test'); > 3 | throw new Error('test'); | ^ 4 | @@ -563,7 +563,7 @@ test('should report a stable test.id', async ({ runInlineTest }) => { module.exports = { reporter: [[ './reporter.ts' ]] }; `, 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('example test', async ({}) => { }); ` @@ -603,7 +603,7 @@ test('should report annotations from test declaration', async ({ runInlineTest } }; `, 'stdio.spec.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('none', () => { expect(test.info().annotations).toEqual([]); }); @@ -675,7 +675,7 @@ test('tests skipped in serial mode receive onTestBegin/onTestEnd', async ({ runI 'reporter.ts': smallReporterJS, 'playwright.config.ts': `module.exports = { reporter: [['./reporter', { printTestStatus: true }]] };`, 'a.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test.describe.configure({ mode: 'serial', retries: 1 }); diff --git a/tests/playwright-test/resolver.spec.ts b/tests/playwright-test/resolver.spec.ts index 037ba14f223cf..346ca57e6e2bc 100644 --- a/tests/playwright-test/resolver.spec.ts +++ b/tests/playwright-test/resolver.spec.ts @@ -19,7 +19,7 @@ import { test, expect } from './playwright-test-fixtures'; test('should print tsconfig parsing error', async ({ runInlineTest }) => { const files = { 'a.spec.ts': ` - import { test } from '@playwright/test'; + import { test } from '@okep/test'; test('pass', async () => {}); `, 'tsconfig.json': ` @@ -58,21 +58,21 @@ test('should respect path resolver', async ({ runInlineTest }) => { }`, 'a.test.ts': ` import { foo } from 'util/b'; - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('test', ({}, testInfo) => { expect(testInfo.project.name).toBe(foo); }); `, 'b.test.ts': ` import { foo } from 'util2/b'; - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('test', ({}, testInfo) => { expect(testInfo.project.name).toBe(foo); }); `, 'c.test.ts': ` import { foo } from 'util3'; - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('test', ({}, testInfo) => { expect(testInfo.project.name).toBe(foo); }); @@ -99,7 +99,7 @@ test('should respect path resolver', async ({ runInlineTest }) => { import { foo } from 'parent-util/b'; // This import should pick up /tsconfig through the helper import { foo as foo2 } from '../helper'; - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('test', ({}, testInfo) => { expect(testInfo.project.name).toBe(foo); expect(testInfo.project.name).toBe(foo2); @@ -133,14 +133,14 @@ test('should respect baseurl', async ({ runInlineTest }) => { }`, 'a.test.ts': ` import { foo } from 'util/b'; - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('test', ({}, testInfo) => { expect(testInfo.project.name).toBe(foo); }); `, 'b.test.ts': ` import { foo } from 'util2'; - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('test', ({}, testInfo) => { expect(testInfo.project.name).toBe(foo); }); @@ -170,7 +170,7 @@ test('should respect baseurl w/o paths', async ({ runInlineTest }) => { 'dir2/inner.spec.ts': ` // This import should pick up ../foo/bar/util/b due to baseUrl. import { foo } from 'foo/bar/util/b'; - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('test', ({}, testInfo) => { expect(foo).toBe(42); }); @@ -206,7 +206,7 @@ test('should fallback to *:* when baseurl and paths are specified', async ({ run import { foo } from 'foo/bar/util/b'; // This import should pick up ../shared/x due to baseUrl+paths. import { x } from 'shared/x'; - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('test', ({}, testInfo) => { expect(foo).toBe(42); expect(x).toBe(43); @@ -235,7 +235,7 @@ test('should use the location of the tsconfig as the paths root when no baseUrl 'dir2/inner.spec.ts': ` // This import should pick up ../foo/bar/util/b due to paths. import { foo } from 'foo/bar/util/b'; - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('test', ({}, testInfo) => { expect(foo).toBe(42); }); @@ -274,7 +274,7 @@ test('should respect complex path resolver', async ({ runInlineTest }) => { }`, 'a.spec.ts': ` import { foo } from 'prefix-matchedstar'; - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('test', ({}, testInfo) => { expect(testInfo.project.name).toBe(foo); }); @@ -284,7 +284,7 @@ test('should respect complex path resolver', async ({ runInlineTest }) => { `, 'b.spec.ts': ` import { foo } from 'prefix-matchedstar-suffix'; - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('test', ({}, testInfo) => { expect(testInfo.project.name).toBe(foo); }); @@ -294,7 +294,7 @@ test('should respect complex path resolver', async ({ runInlineTest }) => { `, 'c.spec.ts': ` import { foo } from 'matchedstar-suffix'; - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('test', ({}, testInfo) => { expect(testInfo.project.name).toBe(foo); }); @@ -304,7 +304,7 @@ test('should respect complex path resolver', async ({ runInlineTest }) => { `, 'd.spec.ts': ` import { foo } from 'no-star'; - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('test', ({}, testInfo) => { expect(testInfo.project.name).toBe(foo); }); @@ -314,7 +314,7 @@ test('should respect complex path resolver', async ({ runInlineTest }) => { `, 'e.spec.ts': ` import { foo } from 'longest-prefix'; - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('test', ({}, testInfo) => { expect(testInfo.project.name).toBe(foo); }); @@ -329,7 +329,7 @@ test('should respect complex path resolver', async ({ runInlineTest }) => { `, 'f.spec.ts': ` import { foo } from 'barfoobar'; - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('test', ({}, testInfo) => { expect(testInfo.project.name).toBe(foo); }); @@ -339,7 +339,7 @@ test('should respect complex path resolver', async ({ runInlineTest }) => { `, 'g.spec.ts': ` import { foo } from 'foo/[bar]'; - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('test', ({}, testInfo) => { expect(testInfo.project.name).toBe(foo); }); @@ -368,7 +368,7 @@ test('should not use baseurl for relative imports', async ({ runInlineTest }) => 'frontend/playwright/tests/forms_cms_standard.spec.ts': ` // This relative import should not use baseUrl import { foo } from '../utils'; - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('test', ({}, testInfo) => { expect(foo).toBe(42); }); @@ -412,7 +412,7 @@ test('should not use baseurl for relative imports when dir with same name exists // This absolute import should use baseUrl import { bar } from '.bar'; - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('test', ({}, testInfo) => { expect(foo).toBe(42); expect(index).toBe(42); @@ -441,7 +441,7 @@ test('should respect path resolver for JS files when allowJs', async ({ runInlin }`, 'a.test.js': ` const { foo } = require('util/b'); - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('test', ({}, testInfo) => { expect(testInfo.project.name).toBe(foo); }); @@ -468,7 +468,7 @@ test('should not respect path resolver for JS files w/o allowJS', async ({ runIn }`, 'a.test.js': ` const { foo } = require('util/b'); - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('test', ({}, testInfo) => { expect(testInfo.project.name).toBe(foo); }); @@ -495,14 +495,14 @@ test('should respect path resolver for JS and TS files from jsconfig.json', asyn }`, 'a.test.js': ` const { foo } = require('util/b'); - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('test', ({}, testInfo) => { expect(testInfo.project.name).toBe(foo); }); `, 'b.test.ts': ` import { foo } from 'util/b'; - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('test', ({}, testInfo) => { expect(testInfo.project.name).toBe(foo); }); @@ -543,7 +543,7 @@ test('should support extends in tsconfig.json', async ({ runInlineTest }) => { // This js file is affected by tsconfig because allowJs is inherited. // Next line resolve to the final baseUrl ("dir") + relative path mapping ("./foo/bar/util/*"). const { foo } = require('util/file'); - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('test', ({}, testInfo) => { expect(foo).toBe('foo'); }); @@ -573,7 +573,7 @@ test('should resolve paths relative to the originating config when extending and // This resolves relative to the base tsconfig that defined path mapping, // because there is no baseUrl in the final tsconfig. const { foo } = require('~/file'); - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('test', ({}, testInfo) => { expect(foo).toBe('foo'); }); @@ -612,7 +612,7 @@ test('should respect tsconfig project references', async ({ runInlineTest }) => `, 'a.test.ts': ` import { foo } from 'util/b'; - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('test', ({}, testInfo) => { expect(foo).toBe('foo'); }); @@ -660,7 +660,7 @@ test('should respect --tsconfig option', async ({ runInlineTest }) => { }`, 'tests42/a.test.ts': ` import { foo } from '~/foo'; - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('test', ({}) => { expect(foo).toBe(42); }); @@ -685,7 +685,7 @@ test.describe('directory imports', () => { export const foo: 'bar'; `, 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; import { foo } from './foo-pkg'; test('pass', async () => { const bar: 'bar' = foo; @@ -714,7 +714,7 @@ test.describe('directory imports', () => { { "type": "module" } `, 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; import { foo } from './foo-pkg'; test('pass', async () => { const bar: 'bar' = foo; @@ -743,7 +743,7 @@ test.describe('directory imports', () => { `, 'tests/hello.test.ts': ` import { greet } from '@acme/lib'; - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('hello', async ({}) => { const foo: number = greet(); expect(foo).toBe(2); @@ -787,7 +787,7 @@ test.describe('directory imports', () => { `, 'tests/hello.test.ts': ` import { greet } from '@acme/lib'; - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('hello', async ({}) => { const foo: number = greet(); expect(foo).toBe(2); @@ -846,7 +846,7 @@ test.describe('directory imports', () => { `, 'example.spec.ts': ` import { foo } from 'app/pkg'; - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('test', ({}) => { const bar: number = foo; expect(bar).toBe(42); @@ -893,7 +893,7 @@ test.describe('directory imports', () => { `, 'example.spec.ts': ` import { foo } from 'app/pkg'; - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('test', ({}) => { const bar: number = foo; expect(bar).toBe(42); @@ -924,7 +924,7 @@ test.describe('directory imports', () => { { "name": "test-project" } `, 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; import { foo } from 'foo-pkg'; test('pass', async () => { const bar: 'bar' = foo; @@ -966,7 +966,7 @@ test.describe('directory imports', () => { { "name": "test-project", "type": "module" } `, 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; import { foo } from 'foo-pkg'; test('pass', async () => { const bar: 'bar' = foo; @@ -1029,7 +1029,7 @@ test.describe('directory imports', () => { `, 'example.spec.ts': ` import { filename } from 'app/pkg'; - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('test', ({}) => { const foo: 'index.js' = filename; expect(foo).toBe('index.js'); @@ -1081,7 +1081,7 @@ test.describe('directory imports', () => { `, 'example.spec.ts': ` import { filename } from 'app/pkg'; - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('test', ({}) => { const foo: 'index.js' = filename; expect(foo).toBe('index.js'); diff --git a/tests/playwright-test/retry.spec.ts b/tests/playwright-test/retry.spec.ts index b5dfc7a347f79..84b77f6ab279c 100644 --- a/tests/playwright-test/retry.spec.ts +++ b/tests/playwright-test/retry.spec.ts @@ -19,7 +19,7 @@ import { test, expect } from './playwright-test-fixtures'; test('should retry failures', async ({ runInlineTest }) => { const result = await runInlineTest({ 'retry-failures.spec.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('flake', async ({}, testInfo) => { // Passes on the second run. expect(testInfo.retry).toBe(1); @@ -46,7 +46,7 @@ test('should retry based on config', async ({ runInlineTest }) => { ] }; `, 'a.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('pass', ({}, testInfo) => { // Passes on the third run. expect(testInfo.retry).toBe(2); @@ -66,7 +66,7 @@ test('should retry based on test.describe.configure', async ({ runInlineTest }) module.exports = { retries: 2 }; `, 'a.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test.describe.configure({ retries: 1 }); test('fail 1', ({}, testInfo) => { console.log('%%fail1-' + testInfo.retry); @@ -74,7 +74,7 @@ test('should retry based on test.describe.configure', async ({ runInlineTest }) }); `, 'b.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('fail 4', ({}, testInfo) => { console.log('%%fail4-' + testInfo.retry); expect(1).toBe(2); @@ -118,7 +118,7 @@ test('should retry based on test.describe.configure', async ({ runInlineTest }) test('should retry timeout', async ({ runInlineTest }) => { const { exitCode, passed, failed, output } = await runInlineTest({ 'one-timeout.spec.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('timeout', async () => { await new Promise(f => setTimeout(f, 10000)); }); @@ -133,7 +133,7 @@ test('should retry timeout', async ({ runInlineTest }) => { test('should fail on unexpected pass with retries', async ({ runInlineTest }) => { const { exitCode, failed, output } = await runInlineTest({ 'unexpected-pass.spec.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('succeeds', () => { test.fail(); expect(1 + 1).toBe(2); @@ -148,7 +148,7 @@ test('should fail on unexpected pass with retries', async ({ runInlineTest }) => test('should retry unexpected pass', async ({ runInlineTest }) => { const { exitCode, passed, failed, output } = await runInlineTest({ 'unexpected-pass.spec.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('succeeds', () => { test.fail(); expect(1 + 1).toBe(2); @@ -164,7 +164,7 @@ test('should retry unexpected pass', async ({ runInlineTest }) => { test('should not retry expected failure', async ({ runInlineTest }) => { const { exitCode, passed, failed, output } = await runInlineTest({ 'expected-failure.spec.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('fails', () => { test.fail(); expect(1 + 1).toBe(3); @@ -184,7 +184,7 @@ test('should not retry expected failure', async ({ runInlineTest }) => { test('should retry unhandled rejection', async ({ runInlineTest }) => { const result = await runInlineTest({ 'unhandled-rejection.spec.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('unhandled rejection', async () => { setTimeout(() => { throw new Error('Unhandled rejection in the test'); @@ -203,7 +203,7 @@ test('should retry unhandled rejection', async ({ runInlineTest }) => { test('should retry beforeAll failure', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.spec.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test.beforeAll(async () => { throw new Error('BeforeAll is bugged!'); }); @@ -224,7 +224,7 @@ test('should retry beforeAll failure', async ({ runInlineTest }) => { test('should retry worker fixture setup failure', async ({ runInlineTest }) => { const result = await runInlineTest({ 'helper.ts': ` - import { test as base, expect } from '@playwright/test'; + import { test as base, expect } from '@okep/test'; export const test = base.extend({ worker: [ async () => { throw new Error('worker setup is bugged!'); @@ -247,7 +247,7 @@ test('should retry worker fixture setup failure', async ({ runInlineTest }) => { test('failed and skipped on retry should be marked as flaky', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.spec.ts': ` - import { test } from '@playwright/test'; + import { test } from '@okep/test'; test('flaky test', async ({}, testInfo) => { if (!testInfo.retry) throw new Error('Failed on first run'); diff --git a/tests/playwright-test/runner.spec.ts b/tests/playwright-test/runner.spec.ts index 701b1e825d1f5..f659a1d2e0c41 100644 --- a/tests/playwright-test/runner.spec.ts +++ b/tests/playwright-test/runner.spec.ts @@ -21,7 +21,7 @@ import { test, expect, parseTestRunnerOutput, countTimes } from './playwright-te test('it should not allow multiple tests with the same name per suite', async ({ runInlineTest }) => { const result = await runInlineTest({ 'tests/example.spec.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test.describe('suite', () => { test('i-am-a-duplicate', async () => {}); }); @@ -40,12 +40,12 @@ test('it should not allow multiple tests with the same name per suite', async ({ test('it should not allow multiple tests with the same name in multiple files', async ({ runInlineTest }) => { const result = await runInlineTest({ 'tests/example1.spec.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('i-am-a-duplicate', async () => {}); test('i-am-a-duplicate', async () => {}); `, 'tests/example2.spec.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('i-am-a-duplicate', async () => {}); test('i-am-a-duplicate', async () => {}); `, @@ -67,7 +67,7 @@ test('it should not allow a focused test when forbid-only is used', async ({ run }; `, 'tests/focused-test.spec.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test.only('i-am-focused', async () => {}); ` }); @@ -80,7 +80,7 @@ test('it should not allow a focused test when forbid-only is used', async ({ run test('should continue with other tests after worker process suddenly exits', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.spec.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('passed1', () => {}); test('passed2', () => {}); test('failed1', () => { process.exit(0); }); @@ -101,7 +101,7 @@ test('should report subprocess creation error', async ({ runInlineTest }, testIn process.exit(42); `, 'a.spec.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('fails', () => {}); test('does not run', () => {}); // Infect subprocesses to immediately exit when spawning a worker. @@ -132,7 +132,7 @@ test('should ignore subprocess creation error because of SIGINT', async ({ inter ); `, 'a.spec.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('fails', () => {}); test('skipped', () => {}); // Infect subprocesses to immediately hang when spawning a worker. @@ -159,7 +159,7 @@ test('sigint should stop workers', async ({ interactWithTestRunner }) => { const testProcess = await interactWithTestRunner({ 'a.spec.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('interrupted1', async () => { console.log('\\n%%SEND-SIGINT%%1'); await new Promise(f => setTimeout(f, 3000)); @@ -169,7 +169,7 @@ test('sigint should stop workers', async ({ interactWithTestRunner }) => { }); `, 'b.spec.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('interrupted2', async () => { console.log('\\n%%SEND-SIGINT%%2'); await new Promise(f => setTimeout(f, 3000)); @@ -179,7 +179,7 @@ test('sigint should stop workers', async ({ interactWithTestRunner }) => { }); `, }, { 'workers': 2, 'reporter': 'line,json' }, { - PW_TEST_REPORTER: path.join(__dirname, '../../packages/playwright/lib/reporters/json.js'), + PW_TEST_REPORTER: path.join(__dirname, '../../packages/pw-recorder/lib/reporters/json.js'), PLAYWRIGHT_JSON_OUTPUT_NAME: 'report.json', }); await testProcess.waitForOutput('%%SEND-SIGINT%%', 2); @@ -212,7 +212,7 @@ test('sigint should stop workers', async ({ interactWithTestRunner }) => { test('should use the first occurring error when an unhandled exception was thrown', async ({ runInlineTest }) => { const result = await runInlineTest({ 'unhandled-exception.spec.js': ` - const { test: base, expect } = require('@playwright/test'); + const { test: base, expect } = require('@okep/test'); const test = base.extend({ context: async ({}, test) => { await test(123) @@ -244,7 +244,7 @@ test('worker interrupt should report errors', async ({ interactWithTestRunner }) const testProcess = await interactWithTestRunner({ 'a.spec.ts': ` - import { test as base, expect } from '@playwright/test'; + import { test as base, expect } from '@okep/test'; const test = base.extend({ throwOnTeardown: async ({}, use) => { let reject; @@ -274,7 +274,7 @@ test('worker interrupt should report errors', async ({ interactWithTestRunner }) test('should not stall when workers are available', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.spec.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; const { writeFile, waitForFile } = require('./utils.js'); test('fails-1', async ({}, testInfo) => { await waitForFile(testInfo, 'lockA'); @@ -289,7 +289,7 @@ test('should not stall when workers are available', async ({ runInlineTest }) => }); `, 'b.spec.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; const { writeFile, waitForFile } = require('./utils.js'); test('passes-2', async ({}, testInfo) => { console.log('\\n%%passes-2-started'); @@ -340,7 +340,7 @@ test('should not stall when workers are available', async ({ runInlineTest }) => test('should teardown workers that are redundant', async ({ runInlineTest }) => { const result = await runInlineTest({ 'helper.js': ` - const { test: base, expect } = require('@playwright/test'); + const { test: base, expect } = require('@okep/test'); module.exports = base.extend({ w: [async ({}, use) => { console.log('\\n%%worker setup'); @@ -390,7 +390,7 @@ test('should not hang if test suites in worker are inconsistent with runner', as }; `, 'a.spec.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; const { getNames } = require('./names'); const names = getNames(); for (const index in names) { @@ -430,7 +430,7 @@ test('sigint should stop global setup', async ({ interactWithTestRunner }) => { }; `, 'a.spec.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('test', async () => { }); `, }, { 'workers': 1 }); @@ -471,11 +471,11 @@ test('sigint should stop plugins', async ({ interactWithTestRunner }) => { } })); module.exports = { - '@playwright/test': { plugins } + '@okep/test': { plugins } }; `, 'a.spec.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('test', async () => { console.log('testing!'); }); @@ -520,10 +520,10 @@ test('sigint should stop plugins 2', async ({ interactWithTestRunner }) => { console.log('Plugin2 teardown'); } })); - module.exports = { '@playwright/test': { plugins } }; + module.exports = { '@okep/test': { plugins } }; `, 'a.spec.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('test', async () => { console.log('testing!'); }); @@ -546,7 +546,7 @@ test('sigint should stop plugins 2', async ({ interactWithTestRunner }) => { test('should not crash with duplicate titles and .only', async ({ runInlineTest }) => { const result = await runInlineTest({ 'example.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('non unique title', () => { console.log('do not run me'); }); test.skip('non unique title', () => { console.log('do not run me'); }); test.only('non unique title', () => { console.log('do run me'); }); @@ -565,7 +565,7 @@ test('should not crash with duplicate titles and .only', async ({ runInlineTest test('should not crash with duplicate titles and line filter', async ({ runInlineTest }) => { const result = await runInlineTest({ 'example.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('non unique title', () => { console.log('do not run me'); }); test.skip('non unique title', () => { console.log('do not run me'); }); test('non unique title', () => { console.log('do run me'); }); @@ -582,12 +582,12 @@ test('should not crash with duplicate titles and line filter', async ({ runInlin test('should not load tests not matching filter', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; console.log('in a.spec.ts'); test('test1', () => {}); `, 'example.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; console.log('in example.spec.ts'); test('test2', () => {}); ` @@ -602,7 +602,7 @@ test('should filter by sourcemapped file names', async ({ runInlineTest }) => { const result = await runInlineTest({ 'gherkin.spec.js': ` -import { test } from '@playwright/test'; +import { test } from '@okep/test'; test('should run', () => {}); //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdoZXJraW4uZmVhdHVyZSJdLCJuYW1lcyI6WyJOb25lIl0sIm1hcHBpbmdzIjoiQUFBQUE7QUFBQUE7QUFBQUE7QUFBQUE7QUFBQUE7QUFBQUEiLCJmaWxlIjoiZ2hlcmtpbi5mZWF0dXJlIiwic291cmNlc0NvbnRlbnQiOlsiVGVzdCJdfQ==`, @@ -626,7 +626,7 @@ throw new Error('should not load nomap.spec.js');`, test('should not hang on worker error in test file', async ({ runInlineTest }) => { const result = await runInlineTest({ 'example.spec.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; if (process.env.TEST_WORKER_INDEX) process.exit(1); test('test 1', async () => {}); @@ -654,7 +654,7 @@ test('fast double SIGINT should be ignored', async ({ interactWithTestRunner }) } `, 'a.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('interrupted', async ({ }) => { console.log('\\n%%SEND-SIGINT%%'); await new Promise(() => {}); @@ -688,7 +688,7 @@ test('slow double SIGINT should be respected', async ({ interactWithTestRunner } } `, 'a.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('interrupted', async ({ }) => { console.log('\\n%%SEND-SIGINT%%'); await new Promise(() => {}); @@ -729,7 +729,7 @@ test('slow double SIGINT should be respected in reporter.onExit', async ({ inter } `, 'a.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('interrupted', async ({ }) => { console.log('\\n%%SEND-SIGINT%%'); await new Promise(() => {}); @@ -753,7 +753,7 @@ test('slow double SIGINT should be respected in reporter.onExit', async ({ inter test('unhandled exception in test.fail should restart worker and continue', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('bad', async () => { test.fail(); @@ -800,7 +800,7 @@ test('wait for workers to finish before reporter.onEnd', async ({ runInlineTest } `, 'a.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('first', async ({ }) => { await new Promise(() => {}); }); @@ -824,7 +824,7 @@ test('wait for workers to finish before reporter.onEnd', async ({ runInlineTest test('should run last failed tests', async ({ runInlineTest }) => { const workspace = { 'a.spec.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('pass', async () => {}); test('fail', async () => { expect(1).toBe(2); diff --git a/tests/playwright-test/shard.spec.ts b/tests/playwright-test/shard.spec.ts index e82a434f5233a..3f6db501f411d 100644 --- a/tests/playwright-test/shard.spec.ts +++ b/tests/playwright-test/shard.spec.ts @@ -18,7 +18,7 @@ import { test, expect } from './playwright-test-fixtures'; const tests = { 'a1.spec.ts': ` - import { test } from '@playwright/test'; + import { test } from '@okep/test'; test('test1', async () => { console.log('\\n%%a1-test1-done'); }); @@ -33,7 +33,7 @@ const tests = { }); `, 'a2.spec.ts': ` - import { test } from '@playwright/test'; + import { test } from '@okep/test'; test.describe.configure({ mode: 'parallel' }); test('test1', async () => { console.log('\\n%%a2-test1-done'); @@ -43,7 +43,7 @@ const tests = { }); `, 'a3.spec.ts': ` - import { test } from '@playwright/test'; + import { test } from '@okep/test'; test.describe.configure({ mode: 'parallel' }); test('test1', async () => { console.log('\\n%%a3-test1-done'); @@ -53,7 +53,7 @@ const tests = { }); `, 'a4.spec.ts': ` - import { test } from '@playwright/test'; + import { test } from '@okep/test'; test('test1', async () => { console.log('\\n%%a4-test1-done'); }); @@ -171,14 +171,14 @@ test('should work with workers=1 and --fully-parallel', async ({ runInlineTest } test.info().annotations.push({ type: 'issue', description: 'https://github.com/microsoft/playwright/issues/21226' }); const tests = { 'a1.spec.ts': ` - import { test } from '@playwright/test'; + import { test } from '@okep/test'; test('should pass', async ({ }) => { }); test.skip('should skip', async ({ }) => { }); `, 'a2.spec.ts': ` - import { test } from '@playwright/test'; + import { test } from '@okep/test'; test('should pass', async ({ }) => { }); `, @@ -203,13 +203,13 @@ test('should skip dependency when project is sharded out', async ({ runInlineTes }; `, 'test.spec.ts': ` - import { test } from '@playwright/test'; + import { test } from '@okep/test'; test('test', async ({}) => { console.log('\\n%%test in ' + test.info().project.name); }); `, 'setup.ts': ` - import { test } from '@playwright/test'; + import { test } from '@okep/test'; test('setup', async ({}) => { console.log('\\n%%setup in ' + test.info().project.name); }); @@ -231,7 +231,7 @@ test('should not shard mode:default suites', async ({ runInlineTest }) => { const tests = { 'a1.spec.ts': ` - import { test } from '@playwright/test'; + import { test } from '@okep/test'; test('test0', async ({ }) => { console.log('\\n%%test0'); }); @@ -240,7 +240,7 @@ test('should not shard mode:default suites', async ({ runInlineTest }) => { }); `, 'a2.spec.ts': ` - import { test } from '@playwright/test'; + import { test } from '@okep/test'; test.describe.configure({ mode: 'parallel' }); test.describe(() => { diff --git a/tests/playwright-test/snapshot-path-template.spec.ts b/tests/playwright-test/snapshot-path-template.spec.ts index 4f260469b7b3a..b662cebc131c2 100644 --- a/tests/playwright-test/snapshot-path-template.spec.ts +++ b/tests/playwright-test/snapshot-path-template.spec.ts @@ -25,7 +25,7 @@ async function getSnapshotPaths(runInlineTest, testInfo, playwrightConfig, pathA module.exports = ${JSON.stringify(playwrightConfig, null, 2)} `, 'a/b/c/d.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test.describe('suite', () => { test('test should work', async ({ page }, testInfo) => { console.log([ @@ -124,7 +124,7 @@ test('arg should receive default arg', async ({ runInlineTest }, testInfo) => { } `, 'a.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('is a test', async ({ page }) => { await expect(page).toHaveScreenshot(); }); diff --git a/tests/playwright-test/stable-test-runner/index.d.ts b/tests/playwright-test/stable-test-runner/index.d.ts index 71da899b22da4..4a4fc8557e440 100644 --- a/tests/playwright-test/stable-test-runner/index.d.ts +++ b/tests/playwright-test/stable-test-runner/index.d.ts @@ -14,4 +14,4 @@ * limitations under the License. */ -export * from './node_modules/@playwright/test'; +export * from './node_modules/@okep/test'; diff --git a/tests/playwright-test/stdio.spec.ts b/tests/playwright-test/stdio.spec.ts index b29ef2a07c9e7..8381ba18b946e 100644 --- a/tests/playwright-test/stdio.spec.ts +++ b/tests/playwright-test/stdio.spec.ts @@ -19,7 +19,7 @@ import { test, expect } from './playwright-test-fixtures'; test('should get top level stdio', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.spec.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; console.log('\\n%% top level stdout'); console.error('\\n%% top level stderr'); test('is a test', () => { @@ -42,7 +42,7 @@ test('should get top level stdio', async ({ runInlineTest }) => { test('should get stdio from worker fixture teardown', async ({ runInlineTest }) => { const result = await runInlineTest({ 'helper.ts': ` - import { test as base, expect } from '@playwright/test'; + import { test as base, expect } from '@okep/test'; export const test = base.extend({ fixture: [ async ({}, run) => { console.log('\\n%% worker setup'); @@ -68,7 +68,7 @@ test('should ignore stdio when quiet', async ({ runInlineTest }) => { module.exports = { quiet: true }; `, 'a.spec.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('is a test', () => { console.log('\\n%% stdout in a test'); console.error('\\n%% stderr in a test'); @@ -88,7 +88,7 @@ test('should support console colors but not tty', { const result = await runInlineTest({ 'a.spec.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('console log', () => { console.log('process.stdout.isTTY = ' + process.stdout.isTTY); console.log('process.stderr.isTTY = ' + process.stderr.isTTY); @@ -107,7 +107,7 @@ test('should support console colors but not tty', { test('should not throw type error when using assert', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.spec.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; const assert = require('assert'); test('assert no type error', () => { assert.strictEqual(1, 2); @@ -121,7 +121,7 @@ test('should not throw type error when using assert', async ({ runInlineTest }) test('should have debug colors by default, but respect DEBUG_COLORS=0', async ({ runInlineTest }) => { const files = { 'a.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; import debug from 'debug'; test('passes', () => { const dbg = debug('example'); diff --git a/tests/playwright-test/test-extend.spec.ts b/tests/playwright-test/test-extend.spec.ts index 94ee2bf19a250..0ed2d76b17196 100644 --- a/tests/playwright-test/test-extend.spec.ts +++ b/tests/playwright-test/test-extend.spec.ts @@ -19,7 +19,7 @@ import { test, expect } from './playwright-test-fixtures'; test('test.extend should work', async ({ runInlineTest }) => { const { output, passed } = await runInlineTest({ 'helper.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; global.logs = []; function createDerivedFixtures(suffix) { @@ -130,7 +130,7 @@ test('config should override options but not fixtures', async ({ runInlineTest } }; `, 'a.test.ts': ` - import { test as base, expect } from '@playwright/test'; + import { test as base, expect } from '@okep/test'; const test1 = base.extend({ param: [ 'default', { option: true } ] }); test1('default', async ({ param }) => { console.log('default-' + param); @@ -168,7 +168,7 @@ test('mergeTests should be able to merge', async ({ runInlineTest }) => { }; `, 'a.test.ts': ` - import { test, expect, mergeTests } from '@playwright/test'; + import { test, expect, mergeTests } from '@okep/test'; const base = test.extend({ myFixture: 'abc', }); @@ -205,7 +205,7 @@ test('mergeTests should be able to merge', async ({ runInlineTest }) => { test('test.extend should print nice message when used as mergeTests', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.test.ts': ` - import { test as base, expect } from '@playwright/test'; + import { test as base, expect } from '@okep/test'; const test1 = base.extend({}); const test2 = base.extend({}); const test3 = test1.extend(test2); @@ -221,7 +221,7 @@ test('test.extend should print nice message when used as mergeTests', async ({ r test('mergeTests should print nice message when used as extend', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.test.ts': ` - import { test as base, expect, mergeTests } from '@playwright/test'; + import { test as base, expect, mergeTests } from '@okep/test'; const test3 = mergeTests(base, {}); test3('test', () => {}); `, @@ -239,7 +239,7 @@ test('test.use() with undefined should not be ignored', async ({ runInlineTest } }; `, 'a.test.ts': ` - import { test as base, expect } from '@playwright/test'; + import { test as base, expect } from '@okep/test'; const test = base.extend({ option1: [ 'default', { option: true } ], option2: [ 'default', { option: true } ], @@ -291,7 +291,7 @@ test('undefined values in config and test.use should be reverted to default', as }; `, 'a.test.ts': ` - import { test as base, expect } from '@playwright/test'; + import { test as base, expect } from '@okep/test'; const test = base.extend({ option1: [ 'default1', { option: true } ], option2: [ 'default2', { option: true } ], diff --git a/tests/playwright-test/test-grep.spec.ts b/tests/playwright-test/test-grep.spec.ts index 39bb50d02c461..8f8bced58af87 100644 --- a/tests/playwright-test/test-grep.spec.ts +++ b/tests/playwright-test/test-grep.spec.ts @@ -22,7 +22,7 @@ test('config.grep should work', async ({ runInlineTest }) => { module.exports = { grep: /test1/ }; `, 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('test1', async () => { console.log('\\n%% test1'); }); test('test2', async () => { console.log('\\n%% test2'); }); `, @@ -38,7 +38,7 @@ test('config.grepInvert should work', async ({ runInlineTest }) => { module.exports = { grepInvert: /test1/ }; `, 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('test1', async () => { console.log('\\n%% test1'); }); test('test2', async () => { console.log('\\n%% test2'); }); `, @@ -54,7 +54,7 @@ test('project.grep should work', async ({ runInlineTest }) => { module.exports = { projects: [ { grep: /test1/ } ] }; `, 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('test1', async () => { console.log('\\n%% test1'); }); test('test2', async () => { console.log('\\n%% test2'); }); `, @@ -70,7 +70,7 @@ test('project.grepInvert should work', async ({ runInlineTest }) => { module.exports = { projects: [ { grepInvert: /test1/ } ] }; `, 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('test1', async () => { console.log('\\n%% test1'); }); test('test2', async () => { console.log('\\n%% test2'); }); `, @@ -86,7 +86,7 @@ test('config.grep should intersect with --grep and --grepInvert', async ({ runIn module.exports = { grep: /test./, grepInvert: /test4/ }; `, 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('test1', async () => { console.log('\\n%% test1'); }); test('test2', async () => { console.log('\\n%% test2'); }); test('test3', async () => { console.log('\\n%% test3'); }); diff --git a/tests/playwright-test/test-ignore.spec.ts b/tests/playwright-test/test-ignore.spec.ts index b552380faa8bf..6244983f9eef2 100644 --- a/tests/playwright-test/test-ignore.spec.ts +++ b/tests/playwright-test/test-ignore.spec.ts @@ -19,15 +19,15 @@ import * as path from 'path'; const tests = { 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('pass', ({}) => {}); `, 'b.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('pass', ({}) => {}); `, 'c.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('pass', ({}) => {}); ` }; @@ -55,19 +55,19 @@ test('should ignore a folder', async ({ runInlineTest }) => { module.exports = { testIgnore: 'folder/**' }; `, 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('pass', ({}) => {}); `, 'folder/a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('pass', ({}) => {}); `, 'folder/b.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('pass', ({}) => {}); `, 'folder/c.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('pass', ({}) => {}); ` }); @@ -78,19 +78,19 @@ test('should ignore a folder', async ({ runInlineTest }) => { test('should ignore a node_modules', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('pass', ({}) => {}); `, 'node_modules/a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('pass', ({}) => {}); `, 'node_modules/b.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('pass', ({}) => {}); `, 'folder/c.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('pass', ({}) => {}); ` }); @@ -126,15 +126,15 @@ test('should use an array for testMatch', async ({ runInlineTest }) => { module.exports = { testMatch: ['b.test.ts', /\\${path.sep}a.[tes]{4}.TS$/i] }; `, 'dir/a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('pass', ({}) => {}); `, 'b.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('pass', ({}) => {}); `, 'c.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('pass', ({}) => {}); ` }); @@ -150,15 +150,15 @@ test('should match absolute path', async ({ runInlineTest }) => { module.exports = { testDir: path.join(__dirname, 'dir'), testMatch: /dir\\${path.sep}a/ }; `, 'dir/a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('pass', ({}) => {}); `, 'dir/b.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('pass', ({}) => {}); `, 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('pass', ({}) => {}); ` }); @@ -174,15 +174,15 @@ test('should match cli string argument', async ({ runInlineTest }) => { module.exports = { testDir: path.join(__dirname, 'dir') }; `, 'dir/a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('pass', ({}) => {}); `, 'dir/b.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('pass', ({}) => {}); `, 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('pass', ({}) => {}); ` }, {}, {}, { additionalArgs: [`dir\\${path.sep}a`] }); @@ -194,15 +194,15 @@ test('should match cli string argument', async ({ runInlineTest }) => { test('should match regex string argument', async ({ runInlineTest }) => { const result = await runInlineTest({ 'dir/filea.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('pass', ({}) => {}); `, 'dir/fileb.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('pass', ({}) => {}); `, 'filea.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('pass', ({}) => {}); ` }, {}, {}, { additionalArgs: ['/filea.*ts/'] }); @@ -215,11 +215,11 @@ test('should match regex string with a colon argument', async ({ runInlineTest } test.skip(process.platform === 'win32', 'Windows does not support colons in the file name'); const result = await runInlineTest({ 'fileb.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('pass', ({}) => {}); `, 'weird:file.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('pass', ({}) => {}); ` }, {}, {}, { additionalArgs: ['/weird:file\.test\.ts/'] }); @@ -231,15 +231,15 @@ test('should match regex string with a colon argument', async ({ runInlineTest } test('should match case insensitive', async ({ runInlineTest }) => { const result = await runInlineTest({ 'capital/A.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('pass', ({}) => {}); `, 'lowercase/a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('pass', ({}) => {}); `, 'b.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('pass', ({}) => {}); ` }, {}, {}, { additionalArgs: ['a.test.ts'] }); @@ -251,19 +251,19 @@ test('should match case insensitive', async ({ runInlineTest }) => { test('should match by directory', async ({ runInlineTest }) => { const result = await runInlineTest({ 'dir-a/file.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('pass', ({}) => {}); `, 'dir-b/file1.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('pass', ({}) => {}); `, 'dir-b/file2.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('pass', ({}) => {}); `, 'file.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('pass', ({}) => {}); ` }, {}, {}, { additionalArgs: ['dir-b'] }); @@ -278,19 +278,19 @@ test('should ignore node_modules even with custom testIgnore', async ({ runInlin module.exports = { testIgnore: 'a.test.ts' }; `, 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('pass', ({}) => {}); `, 'node_modules/a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('pass', ({}) => {}); `, 'node_modules/b.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('pass', ({}) => {}); `, 'folder/c.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('pass', ({}) => {}); ` }); @@ -304,11 +304,11 @@ test('should only match files with JS/TS file extensions', async ({ runInlineTes module.exports = { testMatch: /foobar/ }; `, 'foobar.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('pass', ({}) => {}); `, 'foobar.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('pass', ({}) => {}); `, 'foobar.test.ts-snapshots/compares-page-screenshot-chromium-linux-test-chromium.png': ` @@ -322,7 +322,7 @@ test('should only match files with JS/TS file extensions', async ({ runInlineTes test('should match dot-files', async ({ runInlineTest }) => { const result = await runInlineTest({ '.a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('pass', ({}) => {}); `, }); @@ -334,11 +334,11 @@ test('should match dot-files', async ({ runInlineTest }) => { test('should match in dot-directories', async ({ runInlineTest }) => { const result = await runInlineTest({ '.dir/a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('pass', ({}) => {}); `, '.dir/b.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('pass', ({}) => {}); `, }); @@ -355,19 +355,19 @@ test('should always work with unix separators', async ({ runInlineTest }) => { module.exports = { testDir: path.join(__dirname, 'dir') }; `, 'dir/a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('pass', ({}) => {}); `, 'dir/b.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('pass', ({}) => {}); `, 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('pass', ({}) => {}); ` }, {}, {}, { additionalArgs: [`dir/a`] }); expect(result.passed).toBe(1); expect(result.report.suites.map(s => s.file).sort()).toEqual(['a.test.ts']); expect(result.exitCode).toBe(0); -}); \ No newline at end of file +}); diff --git a/tests/playwright-test/test-info.spec.ts b/tests/playwright-test/test-info.spec.ts index 938352b7072d1..385000e7a1bca 100644 --- a/tests/playwright-test/test-info.spec.ts +++ b/tests/playwright-test/test-info.spec.ts @@ -19,7 +19,7 @@ import { test, expect } from './playwright-test-fixtures'; test('should work directly', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('test 1', async ({}, testInfo) => { expect(testInfo.title).toBe('test 1'); }); @@ -34,8 +34,8 @@ test('should work directly', async ({ runInlineTest }) => { test('should work via fixture', async ({ runInlineTest }) => { const result = await runInlineTest({ 'helper.ts': ` - import { test as base } from '@playwright/test'; - export * from '@playwright/test'; + import { test as base } from '@okep/test'; + export * from '@okep/test'; export const test = base.extend({ title: async ({}, run, testInfo) => { await run(testInfo.title); @@ -58,8 +58,8 @@ test('should work via fixture', async ({ runInlineTest }) => { test('should work via test.info', async ({ runInlineTest }) => { const result = await runInlineTest({ 'helper.ts': ` - import { test as base } from '@playwright/test'; - export * from '@playwright/test'; + import { test as base } from '@okep/test'; + export * from '@okep/test'; export const test = base.extend({ title: async ({}, run) => { await run(base.info().title); @@ -83,7 +83,7 @@ test('should work via test.info', async ({ runInlineTest }) => { test('should throw outside test', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test.info(); test('test 1', async ({title}) => {}); `, diff --git a/tests/playwright-test/test-modifiers.spec.ts b/tests/playwright-test/test-modifiers.spec.ts index 0dd41bd0abd59..6fdbba3518a19 100644 --- a/tests/playwright-test/test-modifiers.spec.ts +++ b/tests/playwright-test/test-modifiers.spec.ts @@ -19,7 +19,7 @@ import { test, expect, expectTestHelper } from './playwright-test-fixtures'; test('test modifiers should work', async ({ runInlineTest }) => { const result = await runInlineTest({ 'helper.ts': ` - import { test as base, expect } from '@playwright/test'; + import { test as base, expect } from '@okep/test'; export const test = base.extend({ foo: true, }); @@ -135,7 +135,7 @@ test.describe('test modifier annotations', () => { test('should work', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test.describe('suite1', () => { test('no marker', () => {}); @@ -168,7 +168,7 @@ test.describe('test modifier annotations', () => { test('should work alongside top-level modifier', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test.fixme(); @@ -199,7 +199,7 @@ test.describe('test modifier annotations', () => { test('should work alongside top-level modifier wrapper-style', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test.describe.skip('suite1', () => { test('no marker', () => {}); @@ -228,7 +228,7 @@ test.describe('test modifier annotations', () => { test('should work with nesting', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test.fixme(); @@ -258,7 +258,7 @@ test.describe('test modifier annotations', () => { test('should work with only', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test.describe.only("suite", () => { test.skip('focused skip by suite', () => {}); @@ -282,7 +282,7 @@ test.describe('test modifier annotations', () => { test('should not multiple on retry', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('retry', () => { test.info().annotations.push({ type: 'example' }); expect(1).toBe(2); @@ -299,7 +299,7 @@ test.describe('test modifier annotations', () => { test('should not multiply on repeat-each', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('retry', () => { test.info().annotations.push({ type: 'example' }); }); @@ -316,7 +316,7 @@ test.describe('test modifier annotations', () => { test('test modifiers should check types', async ({ runTSC }) => { const result = await runTSC({ 'helper.ts': ` - import { test as base, expect } from '@playwright/test'; + import { test as base, expect } from '@okep/test'; export const test = base.extend<{ foo: boolean }>({ foo: async ({}, use, testInfo) => { testInfo.skip(); @@ -383,7 +383,7 @@ test('test modifiers should check types', async ({ runTSC }) => { test('should skip inside fixture', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.test.ts': ` - import { test as base, expect } from '@playwright/test'; + import { test as base, expect } from '@okep/test'; const test = base.extend({ foo: async ({}, run, testInfo) => { testInfo.skip(true, 'reason'); @@ -403,7 +403,7 @@ test('should skip inside fixture', async ({ runInlineTest }) => { test('modifier with a function should throw in the test', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('skipped', async ({}) => { test.skip(() => true); }); @@ -416,7 +416,7 @@ test('modifier with a function should throw in the test', async ({ runInlineTest test('test.skip with worker fixtures only should skip before hooks and tests', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.test.ts': ` - import { test as base, expect } from '@playwright/test'; + import { test as base, expect } from '@okep/test'; const test = base.extend({ foo: [ 'foo', { scope: 'worker' }], }); @@ -462,7 +462,7 @@ test('test.skip with worker fixtures only should skip before hooks and tests', a test('test.skip without a callback in describe block should skip hooks', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; const logs = []; test.beforeAll(() => { console.log('%%beforeAll'); @@ -491,7 +491,7 @@ test('test.skip without a callback in describe block should skip hooks', async ( test('test.skip should not define a skipped test inside another test', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; const logs = []; test('passes', () => { test.skip('foo', () => { @@ -509,7 +509,7 @@ test('test.skip should not define a skipped test inside another test', async ({ test('modifier timeout should be reported', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test.skip(async () => new Promise(() => {})); test('fails', () => { }); @@ -524,7 +524,7 @@ test('modifier timeout should be reported', async ({ runInlineTest }) => { test('should run beforeAll/afterAll hooks if modifier throws', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test.skip(() => { console.log('%%modifier'); throw new Error('Oh my'); @@ -558,7 +558,7 @@ test('should run beforeAll/afterAll hooks if modifier throws', async ({ runInlin test('should skip all tests from beforeAll', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test.beforeAll(() => { console.log('%%beforeAll'); test.skip(true, 'reason'); @@ -612,7 +612,7 @@ test('should report skipped tests in-order with correct properties', async ({ ru module.exports = { reporter: [['./reporter.ts']] }; `, 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test.describe.configure({ timeout: 1234, retries: 3 }); test('test1', async ({}) => { }); @@ -646,7 +646,7 @@ test('should report skipped tests in-order with correct properties', async ({ ru test('should skip tests if beforeEach has skip', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test.beforeEach(() => { test.skip(); }); @@ -666,7 +666,7 @@ test('should skip tests if beforeEach has skip', async ({ runInlineTest }) => { test('static modifiers should be added in serial mode', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.test.ts': ` - import { test } from '@playwright/test'; + import { test } from '@okep/test'; test.describe.configure({ mode: 'serial' }); test('failed', async ({}) => { @@ -694,17 +694,17 @@ test('static modifiers should be added in serial mode', async ({ runInlineTest } test('should contain only one slow modifier', async ({ runInlineTest }) => { const result = await runInlineTest({ 'slow.test.ts': ` - import { test } from '@playwright/test'; + import { test } from '@okep/test'; test.slow(); test('pass', { annotation: { type: 'issue', description: 'my-value' } }, () => {}); `, 'skip.test.ts': ` - import { test } from '@playwright/test'; + import { test } from '@okep/test'; test.skip(); test('pass', { annotation: { type: 'issue', description: 'my-value' } }, () => {}); `, 'fixme.test.ts': ` - import { test } from '@playwright/test'; + import { test } from '@okep/test'; test.fixme(); test('pass', { annotation: { type: 'issue', description: 'my-value' } }, () => {}); `, @@ -719,7 +719,7 @@ test('should contain only one slow modifier', async ({ runInlineTest }) => { test('should skip beforeEach hooks upon modifiers', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.test.ts': ` - import { test } from '@playwright/test'; + import { test } from '@okep/test'; test('top', () => {}); test.describe(() => { diff --git a/tests/playwright-test/test-output-dir.spec.ts b/tests/playwright-test/test-output-dir.spec.ts index 7768bd5e86dec..ee978ed95ec05 100644 --- a/tests/playwright-test/test-output-dir.spec.ts +++ b/tests/playwright-test/test-output-dir.spec.ts @@ -28,7 +28,7 @@ test('should work and remove non-failures', async ({ runInlineTest }, testInfo) }; `, 'dir/my-test.spec.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('test 1', async ({}, testInfo) => { if (testInfo.retry) { expect(testInfo.outputDir).toContain('my-test-test-1-chromium-retry' + testInfo.retry); @@ -70,7 +70,7 @@ test('should work and remove non-failures', async ({ runInlineTest }, testInfo) test('should include repeat token', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.spec.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('test', ({}, testInfo) => { if (testInfo.repeatEachIndex) expect(testInfo.outputPath('')).toContain('repeat' + testInfo.repeatEachIndex); @@ -90,7 +90,7 @@ test('should default to package.json directory', async ({ runInlineTest }, testI module.exports = { reporters: [], projects: [ {} ] }; `, 'foo/bar/baz/tests/a.spec.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; const fs = require('fs'); test('pass', ({}, testInfo) => { expect(process.cwd()).toBe(__dirname); @@ -111,7 +111,7 @@ test('should default to package.json directory', async ({ runInlineTest }, testI test('should be unique for beforeAll hook from different workers', async ({ runInlineTest }, testInfo) => { const result = await runInlineTest({ 'a.spec.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test.beforeAll(({}, testInfo) => { console.log('\\n%%' + testInfo.outputDir); }); @@ -135,7 +135,7 @@ test('should be unique for beforeAll hook from different workers', async ({ runI test('should include the project name', async ({ runInlineTest }) => { const result = await runInlineTest({ 'helper.ts': ` - import { test as base, expect } from '@playwright/test'; + import { test as base, expect } from '@okep/test'; export const test = base.extend({ auto: [ async ({}, run, testInfo) => { testInfo.snapshotSuffix = ''; @@ -219,7 +219,7 @@ test('should include the project name', async ({ runInlineTest }) => { test('should include path option in snapshot', async ({ runInlineTest }) => { const result = await runInlineTest({ 'helper.ts': ` - import { test as base, expect } from '@playwright/test'; + import { test as base, expect } from '@okep/test'; export const test = base.extend({ auto: [ async ({}, run, testInfo) => { testInfo.snapshotSuffix = 'suffix'; @@ -248,7 +248,7 @@ test('should include path option in snapshot', async ({ runInlineTest }) => { test('should error if outputPath is resolved to outside of parent', async ({ runInlineTest }) => { const result = await runInlineTest({ 'helper.ts': ` - import { test as base, expect } from '@playwright/test'; + import { test as base, expect } from '@okep/test'; export const test = base.extend({ auto: [ async ({}, run, testInfo) => { testInfo.snapshotSuffix = 'suffix'; @@ -297,7 +297,7 @@ test('should remove output dirs for projects run', async ({ runInlineTest }, tes ] }; `, 'a.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('my test', ({}, testInfo) => {}); ` }, { output: '' }); @@ -315,7 +315,7 @@ test('should remove folders with preserveOutput=never', async ({ runInlineTest } export default { preserveOutput: 'never' }; `, 'dir/my-test.spec.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('test 1', async ({}, testInfo) => { require('fs').writeFileSync(testInfo.outputPath('file.txt'), 'content', 'utf-8'); if (testInfo.retry < 2) @@ -334,7 +334,7 @@ test('should remove folders with preserveOutput=never', async ({ runInlineTest } test('should preserve failed results', async ({ runInlineTest }, testInfo) => { const result = await runInlineTest({ 'dir/my-test.spec.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('test 1', async ({}, testInfo) => { require('fs').writeFileSync(testInfo.outputPath('file.txt'), 'content', 'utf-8'); if (testInfo.retry < 2) @@ -353,7 +353,7 @@ test('should preserve failed results', async ({ runInlineTest }, testInfo) => { test('should accept a relative path for outputDir', async ({ runInlineTest }, testInfo) => { const result = await runInlineTest({ 'my-test.spec.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('test', async ({}, testInfo) => { expect(testInfo.outputDir).toBe(${JSON.stringify(path.join(testInfo.outputDir, './my-output-dir', 'my-test-test'))}); }); @@ -376,7 +376,7 @@ test('should have output dir based on rootDir (cwd)', async ({ runInlineTest }, outputDir: 'test-results/', };`, 'e2e/example.spec.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; const fs = require('fs'); test('hello world', async ({ }, testInfo) => { fs.writeFileSync(testInfo.outputPath('foo.txt'), 'hello'); @@ -391,7 +391,7 @@ test('should have output dir based on rootDir (cwd)', async ({ runInlineTest }, test('should allow nonAscii characters in the output dir', async ({ runInlineTest }, testInfo) => { const result = await runInlineTest({ 'my-test.spec.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('こんにちは世界', async ({}, testInfo) => { console.log('\\n%%' + testInfo.outputDir); }); @@ -404,7 +404,7 @@ test('should allow nonAscii characters in the output dir', async ({ runInlineTes test('should allow shorten long output dirs characters in the output dir', async ({ runInlineTest }, testInfo) => { const result = await runInlineTest({ 'very/deep/and/long/file/name/that/i/want/to/be/trimmed/my-test.spec.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test.describe('this is a really long description that would be too long for a file path', () => { test('and this is an even longer test name that just keeps going and going and we should shorten it', async ({}, testInfo) => { console.log('\\n%%' + testInfo.outputDir); @@ -419,7 +419,7 @@ test('should allow shorten long output dirs characters in the output dir', async test('should not mangle double dashes', async ({ runInlineTest }, testInfo) => { const result = await runInlineTest({ 'my--file.spec.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('my--test', async ({}, testInfo) => { console.log('\\n%%' + testInfo.outputDir); }); @@ -432,7 +432,7 @@ test('should not mangle double dashes', async ({ runInlineTest }, testInfo) => { test('should allow include the describe name the output dir', async ({ runInlineTest }, testInfo) => { const result = await runInlineTest({ 'my-test.spec.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test.describe('hello', () => { test('world', async ({}, testInfo) => { console.log('\\n%%' + testInfo.outputDir); diff --git a/tests/playwright-test/test-parallel.spec.ts b/tests/playwright-test/test-parallel.spec.ts index 3939a940633f9..be6eeed0a4730 100644 --- a/tests/playwright-test/test-parallel.spec.ts +++ b/tests/playwright-test/test-parallel.spec.ts @@ -19,7 +19,7 @@ import { test, expect, countTimes } from './playwright-test-fixtures'; test('test.describe.parallel should throw inside test.describe.serial', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test.describe.serial('serial suite', () => { test.describe.parallel('parallel suite', () => { }); @@ -34,7 +34,7 @@ test('test.describe.parallel should throw inside test.describe.serial', async ({ test('test.describe.parallel should work', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test.describe.parallel('parallel suite', () => { test('test1', async ({}, testInfo) => { console.log('\\n%% worker=' + testInfo.workerIndex); @@ -63,7 +63,7 @@ test('test.describe.parallel should work', async ({ runInlineTest }) => { test('test.describe.parallel should work in file', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test.describe.configure({ mode: 'parallel' }); test('test1', async ({}, testInfo) => { console.log('\\n%% worker=' + testInfo.workerIndex); @@ -91,7 +91,7 @@ test('test.describe.parallel should work in file', async ({ runInlineTest }) => test('test.describe.parallel should work in describe', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test.describe('parallel suite', () => { test.describe.configure({ mode: 'parallel' }); test('test1', async ({}, testInfo) => { @@ -124,7 +124,7 @@ test('config.fullyParallel should work', async ({ runInlineTest }) => { module.exports = { fullyParallel: true }; `, 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('test1', async ({}, testInfo) => { console.log('\\n%% worker=' + testInfo.workerIndex); await new Promise(f => setTimeout(f, 1000)); @@ -154,7 +154,7 @@ test('project.fullyParallel should work', async ({ runInlineTest }) => { module.exports = { projects: [ { fullyParallel: true } ] }; `, 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('test1', async ({}, testInfo) => { console.log('\\n%% worker=' + testInfo.workerIndex); await new Promise(f => setTimeout(f, 1000)); @@ -181,7 +181,7 @@ test('project.fullyParallel should work', async ({ runInlineTest }) => { test('parallel mode should minimize running beforeAll/afterAll hooks', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test.describe.configure({ mode: 'parallel' }); test.beforeAll(() => { console.log('\\n%%beforeAll'); @@ -204,7 +204,7 @@ test('parallel mode should minimize running beforeAll/afterAll hooks', async ({ test('parallel mode should minimize running beforeAll/afterAll hooks 2', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test.describe.configure({ mode: 'parallel' }); test.beforeAll(() => { console.log('\\n%%beforeAll'); diff --git a/tests/playwright-test/test-serial.spec.ts b/tests/playwright-test/test-serial.spec.ts index 5059b8108b0c0..2806c5c0981fb 100644 --- a/tests/playwright-test/test-serial.spec.ts +++ b/tests/playwright-test/test-serial.spec.ts @@ -19,7 +19,7 @@ import { test, expect } from './playwright-test-fixtures'; test('test.describe.serial should work', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test.describe.serial('serial suite', () => { test('test1', async ({}) => { console.log('\\n%%test1'); @@ -58,7 +58,7 @@ test('test.describe.serial should work', async ({ runInlineTest }) => { test('test.describe.serial should work in describe', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test.describe('serial suite', () => { test.describe.configure({ mode: 'serial' }); test('test1', async ({}) => { @@ -98,7 +98,7 @@ test('test.describe.serial should work in describe', async ({ runInlineTest }) = test('test.describe.serial should work with retry', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test.describe.serial('serial suite', () => { test('test1', async ({}) => { console.log('\\n%%test1'); @@ -143,7 +143,7 @@ test('test.describe.serial should work with retry', async ({ runInlineTest }) => test('test.describe.serial should work with retry and beforeAll failure', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test.describe.serial('serial suite', () => { test('test1', async ({}) => { console.log('\\n%%test1'); @@ -178,7 +178,7 @@ test('test.describe.serial should work with retry and beforeAll failure', async test('test.describe.serial should work with retry and afterAll failure', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test.describe.serial('serial suite', () => { test.describe('inner suite', () => { let firstRun = false; @@ -215,7 +215,7 @@ test('test.describe.serial should work with retry and afterAll failure', async ( test('test.describe.serial.only should work', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('test1', async ({}) => { console.log('\\n%%test1'); }); @@ -245,7 +245,7 @@ test('test.describe.serial.only should work', async ({ runInlineTest }) => { test('test.describe.serial should work with test.fail', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test.describe.serial('suite', () => { test('zero', () => { console.log('\\n%%zero'); @@ -283,7 +283,7 @@ test('test.describe.serial should work with test.fail', async ({ runInlineTest } test('test.describe.serial should work with test.fail and retries', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test.describe.serial('suite', () => { test('zero', () => { console.log('\\n%%zero'); @@ -326,7 +326,7 @@ test('test.describe.serial should work with test.fail and retries', async ({ run test('test.describe.serial should work inside test.describe.parallel', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test.describe.parallel('parallel suite', () => { test.describe.serial('serial suite', () => { test('one', async ({}) => { @@ -374,7 +374,7 @@ test('test.describe.serial should work with fullyParallel', async ({ runInlineTe module.exports = { fullyParallel: true }; `, 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test.describe.serial('serial suite', () => { test('one', async ({}) => { await new Promise(f => setTimeout(f, 1000)); @@ -398,7 +398,7 @@ test('test.describe.serial should work with fullyParallel', async ({ runInlineTe test('serial fail + skip is failed', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test.describe.configure({ mode: 'serial', retries: 1 }); test.describe.serial('serial suite', () => { test('one', async () => { @@ -424,7 +424,7 @@ test('serial fail + skip is failed', async ({ runInlineTest }) => { test('serial skip + fail is failed', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test.describe.configure({ mode: 'serial', retries: 1 }); test.describe.serial('serial suite', () => { test('one', async () => { diff --git a/tests/playwright-test/test-server.spec.ts b/tests/playwright-test/test-server.spec.ts index 6f03b2c80429f..394199334a15e 100644 --- a/tests/playwright-test/test-server.spec.ts +++ b/tests/playwright-test/test-server.spec.ts @@ -15,7 +15,7 @@ */ import { test as baseTest, expect } from './ui-mode-fixtures'; -import { TestServerConnection } from '../../packages/playwright/lib/isomorphic/testServerConnection'; +import { TestServerConnection } from '../../packages/pw-recorder/lib/isomorphic/testServerConnection'; import { playwrightCtConfigText } from './playwright-test-fixtures'; import ws from 'ws'; import type { TestChildProcess } from '../config/commonFixtures'; @@ -78,7 +78,7 @@ const ctFiles = { export const Button = () => ; `, 'src/button.test.tsx': ` - import { test, expect } from '@playwright/experimental-ct-react'; + import { test, expect } from '@okep/experimental-ct-react'; import { Button } from './button'; test('pass', async ({ mount }) => { @@ -94,7 +94,7 @@ test('file watching', async ({ startTestServer, writeFiles }, testInfo) => { export const expected = 42; `, 'a.test.ts': ` - import { test } from '@playwright/test'; + import { test } from '@okep/test'; import { expected } from "./utils"; test('foo', () => { expect(123).toBe(expected); @@ -125,7 +125,7 @@ test('stdio interception', async ({ startTestServer, writeFiles }) => { await testServerConnection.initialize({ interceptStdio: true }); await writeFiles({ 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('foo', () => { console.log("this goes to stdout"); console.error("this goes to stderr"); diff --git a/tests/playwright-test/test-step.spec.ts b/tests/playwright-test/test-step.spec.ts index cbd4ec38c4026..8309389d05a21 100644 --- a/tests/playwright-test/test-step.spec.ts +++ b/tests/playwright-test/test-step.spec.ts @@ -17,7 +17,7 @@ import { test, expect, stripAnsi } from './playwright-test-fixtures'; const stepIndentReporter = ` -import { FullConfig, Location, Reporter, Suite, TestStep } from '@playwright/test/reporter'; +import { FullConfig, Location, Reporter, Suite, TestStep } from '@okep/test/reporter'; import * as path from 'path'; function formatPrefix(str: string) { @@ -119,7 +119,7 @@ test('should report api step hierarchy', async ({ runInlineTest }) => { }; `, 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('pass', async ({ page }) => { await test.step('outer step 1', async () => { await test.step('inner step 1.1', async () => {}); @@ -163,7 +163,7 @@ test('should report before hooks step error', async ({ runInlineTest }) => { }; `, 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test.beforeEach(async ({}) => { throw new Error('oh my'); }); @@ -193,7 +193,7 @@ test('should not report nested after hooks', async ({ runInlineTest }) => { }; `, 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('timeout', async ({ page }) => { await test.step('my step', async () => { await new Promise(() => {}); @@ -242,7 +242,7 @@ test('should report test.step from fixtures', async ({ runInlineTest }) => { }; `, 'a.test.ts': ` - import { test as base, expect } from '@playwright/test'; + import { test as base, expect } from '@okep/test'; const test = base.extend({ foo: async ({}, use) => { await base.step('setup foo', () => {}); @@ -290,7 +290,7 @@ test('should report expect step locations', async ({ runInlineTest }) => { }; `, 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('pass', async ({}) => { expect(true).toBeTruthy(); }); @@ -314,7 +314,7 @@ test('should report custom expect steps', async ({ runInlineTest }) => { }; `, 'a.test.ts': ` - import { test, expect as baseExpect } from '@playwright/test'; + import { test, expect as baseExpect } from '@okep/test'; const expect = baseExpect.extend({ toBeWithinRange(received, floor, ceiling) { @@ -365,7 +365,7 @@ hook |Worker Cleanup test('should not pass arguments and return value from step', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('steps with return values', async ({ page }) => { const v1 = await test.step('my step', (...args) => { expect(args.length).toBe(0); @@ -395,7 +395,7 @@ test('should mark step as failed when soft expect fails', async ({ runInlineTest }; `, 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('pass', async ({}) => { await test.step('outer', async () => { await test.step('inner', async () => { @@ -432,7 +432,7 @@ test('should nest steps based on zones', async ({ runInlineTest }) => { }; `, 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test.beforeAll(async () => { await test.step('in beforeAll', () => {}); }); @@ -507,7 +507,7 @@ test('should not mark page.close as failed when page.click fails', async ({ runI }; `, 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; let page: Page; test.beforeAll(async ({ browser }) => { @@ -551,7 +551,7 @@ test('should not propagate errors from within toPass', async ({ runInlineTest }) 'reporter.ts': stepIndentReporter, 'playwright.config.ts': `module.exports = { reporter: './reporter', };`, 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('pass', async () => { let i = 0; await expect(() => { @@ -579,7 +579,7 @@ test('should show final toPass error', async ({ runInlineTest }) => { 'reporter.ts': stepIndentReporter, 'playwright.config.ts': `module.exports = { reporter: './reporter', };`, 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('fail', async () => { await expect(() => { expect(true).toBe(false); @@ -606,7 +606,7 @@ test('should propagate nested soft errors', async ({ runInlineTest }) => { 'reporter.ts': stepIndentReporter, 'playwright.config.ts': `module.exports = { reporter: './reporter', };`, 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('fail', async () => { await test.step('first outer', async () => { await test.step('first inner', async () => { @@ -650,7 +650,7 @@ test('should not propagate nested hard errors', async ({ runInlineTest }) => { 'reporter.ts': stepIndentReporter, 'playwright.config.ts': `module.exports = { reporter: './reporter', };`, 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('fail', async () => { await test.step('first outer', async () => { await test.step('first inner', async () => { @@ -694,7 +694,7 @@ test('should step w/o box', async ({ runInlineTest }) => { 'reporter.ts': stepIndentReporter, 'playwright.config.ts': `module.exports = { reporter: [['./reporter', { printErrorLocation: true }]], };`, 'a.test.ts': - ` /*1*/ import { test, expect } from '@playwright/test'; + ` /*1*/ import { test, expect } from '@okep/test'; /*2*/ test('fail', async () => { /*3*/ await test.step('boxed step', async () => { /*4*/ expect(1).toBe(2); @@ -727,7 +727,7 @@ test('should step w/ box', async ({ runInlineTest }) => { 'reporter.ts': stepIndentReporter, 'playwright.config.ts': `module.exports = { reporter: [['./reporter', { printErrorLocation: true }]], };`, 'a.test.ts': - ` /*1*/ import { test, expect } from '@playwright/test'; + ` /*1*/ import { test, expect } from '@okep/test'; /*2*/ test('fail', async () => { /*3*/ const helper = async () => { /*4*/ await test.step('boxed step', async () => { @@ -760,7 +760,7 @@ test('should soft step w/ box', async ({ runInlineTest }) => { 'reporter.ts': stepIndentReporter, 'playwright.config.ts': `module.exports = { reporter: [['./reporter', { printErrorLocation: true }]], };`, 'a.test.ts': - ` /*1*/ import { test, expect } from '@playwright/test'; + ` /*1*/ import { test, expect } from '@okep/test'; /*2*/ test('fail', async () => { /*3*/ const helper = async () => { /*4*/ await test.step('boxed step', async () => { @@ -797,7 +797,7 @@ test('should not generate dupes for named expects', async ({ runInlineTest }) => }; `, 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('timeout', async ({ page }) => { await page.setContent('
hi
'); await expect(page.locator('div'), 'Checking color') @@ -833,7 +833,7 @@ test('step inside expect.toPass', async ({ runInlineTest }) => { }; `, 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('pass', async ({}) => { await test.step('step 1', async () => { let counter = 0 @@ -881,7 +881,7 @@ test('library API call inside expect.toPass', async ({ runInlineTest }) => { }; `, 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('pass', async ({page}) => { let counter = 0 await expect(async () => { @@ -929,7 +929,7 @@ test('library API call inside expect.poll', async ({ runInlineTest }) => { }; `, 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('pass', async ({page}) => { let counter = 0 const a = []; @@ -981,7 +981,7 @@ test('web assertion inside expect.poll', async ({ runInlineTest }) => { }; `, 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('pass', async ({ page }) => { await page.setContent('
foo
'); let counter = 0 @@ -1032,7 +1032,7 @@ test('should report expect steps', async ({ runInlineTest }) => { }; `, 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('fail', async ({}) => { expect(true).toBeTruthy(); expect(false).toBeTruthy(); @@ -1077,7 +1077,7 @@ test('should report api steps', async ({ runInlineTest }) => { 'reporter.ts': stepIndentReporter, 'playwright.config.ts': `module.exports = { reporter: [['./reporter', { skipErrorMessage: true }]] };`, 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('pass', async ({ page, request }) => { await Promise.all([ page.waitForNavigation(), @@ -1157,7 +1157,7 @@ test('should report api step failure', async ({ runInlineTest }) => { }; `, 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('fail', async ({ page }) => { await page.setContent(''); await page.click('input', { timeout: 1 }); @@ -1191,7 +1191,7 @@ test('should show nice stacks for locators', async ({ runInlineTest }) => { 'reporter.ts': stepIndentReporter, 'playwright.config.ts': `module.exports = { reporter: [['./reporter', { printErrorLocation: true }]] };`, 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('pass', async ({ page }) => { await page.setContent(''); const locator = page.locator('button'); @@ -1223,7 +1223,7 @@ test('should allow passing location to test.step', async ({ runInlineTest, runTS const result = await runInlineTest({ 'reporter.ts': stepIndentReporter, 'helper.ts': ` - import { Location, TestType } from '@playwright/test'; + import { Location, TestType } from '@okep/test'; export async function dummyStep(test: TestType<{}, {}>, title: string, action: () => void, location: Location) { await test.step(title, action, { location }); @@ -1239,7 +1239,7 @@ test('should allow passing location to test.step', async ({ runInlineTest, runTS }; `, 'a.test.ts': ` - import { test } from '@playwright/test'; + import { test } from '@okep/test'; import { dummyStep, getCustomLocation } from './helper'; test('custom location test', async () => { @@ -1258,7 +1258,7 @@ hook |After Hooks const { exitCode } = await runTSC({ 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('should work', async () => { const location = { file: 'dummy-file.ts', line: 123, column: 45 }; await test.step('step1', () => {}, { location }); diff --git a/tests/playwright-test/test-tag.spec.ts b/tests/playwright-test/test-tag.spec.ts index 9487e31ea3a42..fd0d7fe2e575b 100644 --- a/tests/playwright-test/test-tag.spec.ts +++ b/tests/playwright-test/test-tag.spec.ts @@ -40,7 +40,7 @@ test('should have correct tags', async ({ runInlineTest }) => { }; `, 'stdio.spec.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('no-tags', () => { }); test('foo-tag @inline', { tag: '@foo' }, () => { @@ -93,7 +93,7 @@ test('config.grep should work', async ({ runInlineTest }) => { module.exports = { grep: /@tag1/ }; `, 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('test1', { tag: '@tag1' }, async () => { console.log('\\n%% test1'); }); test('test2', async () => { console.log('\\n%% test2'); }); `, @@ -112,7 +112,7 @@ test('config.project.grep should work', async ({ runInlineTest }) => { ] }; `, 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('test1', { tag: '@tag1' }, async () => { console.log('\\n%% test1-' + test.info().project.name); }); test('test2', async () => { console.log('\\n%% test2-' + test.info().project.name); }); `, @@ -125,7 +125,7 @@ test('config.project.grep should work', async ({ runInlineTest }) => { test('--grep should work', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('test1', { tag: '@tag1' }, async () => { console.log('\\n%% test1'); }); test('test2', async () => { console.log('\\n%% test2'); }); `, @@ -138,7 +138,7 @@ test('--grep should work', async ({ runInlineTest }) => { test('should enforce @ symbol', async ({ runInlineTest }) => { const result = await runInlineTest({ 'stdio.spec.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('test1', { tag: 'foo' }, () => { }); ` @@ -150,7 +150,7 @@ test('should enforce @ symbol', async ({ runInlineTest }) => { test('should be included in testInfo', async ({ runInlineTest }, testInfo) => { const result = await runInlineTest({ 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('test without tag', async ({}, testInfo) => { expect(testInfo.tags).toStrictEqual([]); }); @@ -165,7 +165,7 @@ test('should be included in testInfo', async ({ runInlineTest }, testInfo) => { test('should be included in testInfo if coming from describe', async ({ runInlineTest }, testInfo) => { const result = await runInlineTest({ 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test.describe('describe with tag', { tag: '@tag2' }, async ()=>{ test('test with tag', async ({}, testInfo) => { expect(testInfo.tags).toStrictEqual(["@tag2"]); diff --git a/tests/playwright-test/test-use.spec.ts b/tests/playwright-test/test-use.spec.ts index 8a2bcd240191d..5ecea72d3d266 100644 --- a/tests/playwright-test/test-use.spec.ts +++ b/tests/playwright-test/test-use.spec.ts @@ -19,7 +19,7 @@ import { test, expect } from './playwright-test-fixtures'; test('should merge options', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.test.ts': ` - import { test as base, expect } from '@playwright/test'; + import { test as base, expect } from '@okep/test'; const test = base.extend({ foo: 'foo', bar: 'bar', @@ -40,8 +40,8 @@ test('should merge options', async ({ runInlineTest }) => { test('should run tests with different test options in the same worker', async ({ runInlineTest }) => { const result = await runInlineTest({ 'helper.ts': ` - import { test as base } from '@playwright/test'; - export * from '@playwright/test'; + import { test as base } from '@okep/test'; + export * from '@okep/test'; export const test = base.extend({ foo: 'foo', }); @@ -77,7 +77,7 @@ test('should run tests with different test options in the same worker', async ({ test('should throw when setting worker options in describe', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.test.ts': ` - import { test as base, expect } from '@playwright/test'; + import { test as base, expect } from '@okep/test'; const test = base.extend({ foo: [undefined, { scope: 'worker' }], }); @@ -100,8 +100,8 @@ test('should throw when setting worker options in describe', async ({ runInlineT test('should run tests with different worker options', async ({ runInlineTest }) => { const result = await runInlineTest({ 'helper.ts': ` - import { test as base } from '@playwright/test'; - export * from '@playwright/test'; + import { test as base } from '@okep/test'; + export * from '@okep/test'; export const test = base.extend({ foo: [undefined, { scope: 'worker' }], }); @@ -144,8 +144,8 @@ test('should run tests with different worker options', async ({ runInlineTest }) test('should use options from the config', async ({ runInlineTest }) => { const result = await runInlineTest({ 'helper.ts': ` - import { test as base } from '@playwright/test'; - export * from '@playwright/test'; + import { test as base } from '@okep/test'; + export * from '@okep/test'; export const test = base.extend({ foo: [ 'foo', { option: true } ], }); @@ -175,7 +175,7 @@ test('should use options from the config', async ({ runInlineTest }) => { test('test.use() should throw if called from beforeAll ', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test.beforeAll(() => { test.use({}); }); diff --git a/tests/playwright-test/timeout.spec.ts b/tests/playwright-test/timeout.spec.ts index cb4e365b4b0ff..f6081089fc827 100644 --- a/tests/playwright-test/timeout.spec.ts +++ b/tests/playwright-test/timeout.spec.ts @@ -19,7 +19,7 @@ import { test, expect } from './playwright-test-fixtures'; test('should run fixture teardown on timeout', async ({ runInlineTest }) => { const result = await runInlineTest({ 'helper.ts': ` - import { test as base, expect } from '@playwright/test'; + import { test as base, expect } from '@okep/test'; export const test = base.extend({ foo: async ({}, run, testInfo) => { await run(); @@ -42,7 +42,7 @@ test('should run fixture teardown on timeout', async ({ runInlineTest }) => { test('should respect test.setTimeout', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('fails', async ({}) => { await new Promise(f => setTimeout(f, 1500)); }); @@ -72,7 +72,7 @@ test('should respect test.setTimeout', async ({ runInlineTest }) => { test('should respect test.setTimeout outside of the test', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test.setTimeout(1000); test('fails', async ({}) => { @@ -102,7 +102,7 @@ test('should respect test.setTimeout outside of the test', async ({ runInlineTes test('should timeout when calling test.setTimeout too late', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('fails', async ({}) => { await new Promise(f => setTimeout(f, 500)); test.setTimeout(100); @@ -119,7 +119,7 @@ test('should timeout when calling test.setTimeout too late', async ({ runInlineT test('should respect test.slow', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('fails', async ({}) => { await new Promise(f => setTimeout(f, 1500)); }); @@ -146,7 +146,7 @@ test('should respect test.slow', async ({ runInlineTest }) => { test('should ignore test.setTimeout when debugging', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.spec.ts': ` - import { test as base, expect } from '@playwright/test'; + import { test as base, expect } from '@okep/test'; const test = base.extend({ fixture: async ({}, use) => { test.setTimeout(100); @@ -167,7 +167,7 @@ test('should ignore test.setTimeout when debugging', async ({ runInlineTest }) = test('should respect fixture timeout', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.spec.ts': ` - import { test as base, expect } from '@playwright/test'; + import { test as base, expect } from '@okep/test'; const test = base.extend({ fixture: [async ({}, use) => { await new Promise(f => setTimeout(f, 300)); @@ -208,7 +208,7 @@ test('should respect fixture timeout', async ({ runInlineTest }) => { test('should respect test.setTimeout in the worker fixture', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.spec.ts': ` - import { test as base, expect } from '@playwright/test'; + import { test as base, expect } from '@okep/test'; const test = base.extend({ fixture: [async ({}, use) => { await new Promise(f => setTimeout(f, 300)); @@ -248,7 +248,7 @@ test('should respect test.setTimeout in the worker fixture', async ({ runInlineT test('fixture time in beforeAll hook should not affect test', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.spec.ts': ` - import { test as base, expect } from '@playwright/test'; + import { test as base, expect } from '@okep/test'; const test = base.extend({ fixture: async ({}, use) => { await new Promise(f => setTimeout(f, 2000)); @@ -270,7 +270,7 @@ test('fixture time in beforeAll hook should not affect test', async ({ runInline test('fixture timeout in beforeAll hook should not affect test', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.spec.ts': ` - import { test as base, expect } from '@playwright/test'; + import { test as base, expect } from '@okep/test'; const test = base.extend({ fixture: [async ({}, use) => { await new Promise(f => setTimeout(f, 1000)); @@ -293,7 +293,7 @@ test('fixture timeout in beforeAll hook should not affect test', async ({ runInl test('fixture time in beforeEach hook should affect test', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.spec.ts': ` - import { test as base, expect } from '@playwright/test'; + import { test as base, expect } from '@okep/test'; const test = base.extend({ fixture: async ({}, use) => { await new Promise(f => setTimeout(f, 500)); @@ -317,7 +317,7 @@ test('fixture time in beforeEach hook should affect test', async ({ runInlineTes test('test timeout should still run hooks before fixtures teardown', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.spec.ts': ` - import { test as base, expect } from '@playwright/test'; + import { test as base, expect } from '@okep/test'; const test = base.extend({ auto: [async ({}, use) => { console.log('\\n%%before-auto'); @@ -356,7 +356,7 @@ test('test timeout should still run hooks before fixtures teardown', async ({ ru test('should not include fixtures with own timeout and beforeAll in test duration', async ({ runInlineTest }) => { const result = await runInlineTest({ 'c.spec.ts': ` - import { test as base, expect } from '@playwright/test'; + import { test as base, expect } from '@okep/test'; const test = base.extend({ foo: [async ({}, use) => { await new Promise(f => setTimeout(f, 1000)); @@ -395,7 +395,7 @@ test('should not include fixtures with own timeout and beforeAll in test duratio test('should run fixture teardowns after timeout with soft expect error', async ({ runInlineTest }) => { const result = await runInlineTest({ 'helper.ts': ` - import { test as base, expect } from '@playwright/test'; + import { test as base, expect } from '@okep/test'; export const test = base.extend({ foo: async ({}, run, testInfo) => { await run(); @@ -435,7 +435,7 @@ test('should run fixture teardowns after timeout with soft expect error', async test('should respect test.describe.configure', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test.describe.configure({ timeout: 1000 }); test('test1', async ({}) => { console.log('test1-' + test.info().timeout); @@ -459,7 +459,7 @@ test('should respect test.describe.configure', async ({ runInlineTest }) => { test('beforeEach timeout should prevent others from running', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test.beforeEach(async () => { console.log('\\n%%beforeEach1'); await new Promise(f => setTimeout(f, 2500)); @@ -483,7 +483,7 @@ test('beforeEach timeout should prevent others from running', async ({ runInline test('should report up to 3 timeout errors', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.spec.ts': ` - import { test as base } from '@playwright/test'; + import { test as base } from '@okep/test'; const test = base.extend<{}, { autoWorker: void }>({ autoWorker: [ @@ -518,7 +518,7 @@ test('should report up to 3 timeout errors', async ({ runInlineTest }) => { test('should complain when worker fixture times out during worker cleanup', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.spec.ts': ` - import { test as base, expect } from '@playwright/test'; + import { test as base, expect } from '@okep/test'; const test = base.extend({ slowTeardown: [async ({}, use) => { await use('hey'); @@ -538,7 +538,7 @@ test('should complain when worker fixture times out during worker cleanup', asyn test('should allow custom worker fixture timeout longer than force exit cap', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.spec.ts': ` - import { test as base, expect } from '@playwright/test'; + import { test as base, expect } from '@okep/test'; const test = base.extend({ slowTeardown: [async ({}, use) => { await use('hey'); @@ -564,7 +564,7 @@ test('should run fixture teardown with custom timeout after test timeout', { }, async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.spec.ts': ` - import { test as base, expect } from '@playwright/test'; + import { test as base, expect } from '@okep/test'; const test = base.extend({ foo: [async ({}, use) => { console.log('\\n%%foo setup'); @@ -591,7 +591,7 @@ test('should run fixture teardown with custom timeout after test timeout', { test('should run fixture teardown with custom timeout after afterEach timeout', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.spec.ts': ` - import { test as base, expect } from '@playwright/test'; + import { test as base, expect } from '@okep/test'; let counter = 0; const test = base.extend({ foo: [async ({}, use) => { @@ -630,7 +630,7 @@ test('should run fixture teardown with custom timeout after afterEach timeout', test('test.setTimeout should be able to change custom fixture timeout', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.spec.ts': ` - import { test as base, expect } from '@playwright/test'; + import { test as base, expect } from '@okep/test'; const test = base.extend({ foo: [async ({}, use) => { console.log('\\n%%foo setup'); diff --git a/tests/playwright-test/to-have-screenshot.spec.ts b/tests/playwright-test/to-have-screenshot.spec.ts index a7aada7ced490..00715b879a371 100644 --- a/tests/playwright-test/to-have-screenshot.spec.ts +++ b/tests/playwright-test/to-have-screenshot.spec.ts @@ -41,7 +41,7 @@ test('should fail to screenshot a page with infinite animation', async ({ runInl }, }), 'a.spec.js': ` - const { test, expect } = require('@playwright/test'); + const { test, expect } = require('@okep/test'); test('is a test', async ({ page }) => { await page.goto('${infiniteAnimationURL}'); await expect(page).toHaveScreenshot({ timeout: 2000 }); @@ -64,7 +64,7 @@ test('should disable animations by default', async ({ runInlineTest }, testInfo) const result = await runInlineTest({ ...playwrightConfig({}), 'a.spec.js': ` - const { test, expect } = require('@playwright/test'); + const { test, expect } = require('@okep/test'); test('is a test', async ({ page }) => { await page.goto('${cssTransitionURL}'); await expect(page).toHaveScreenshot({ timeout: 2000 }); @@ -81,7 +81,7 @@ test('should not retry missing expectation errors', async ({ runInlineTest }, te retries: 2, }), 'a.spec.js': ` - const { test, expect } = require('@playwright/test'); + const { test, expect } = require('@okep/test'); test('is a test', async ({ page }) => { await page.goto('${cssTransitionURL}'); await expect(page).toHaveScreenshot('foo.png', { timeout: 1000 }); @@ -102,7 +102,7 @@ test('should not retry serial mode suites with missing expectation errors', asyn retries: 2, }), 'a.spec.js': ` - const { test, expect } = require('@playwright/test'); + const { test, expect } = require('@okep/test'); test.describe.serial('outer', () => { test('last', async ({ page }) => { }); @@ -132,7 +132,7 @@ test.describe('expect config animations option', () => { expect: { toHaveScreenshot: { animations: 'disabled' } }, }), 'a.spec.js': ` - const { test, expect } = require('@playwright/test'); + const { test, expect } = require('@okep/test'); test('is a test', async ({ page }) => { await page.goto('${cssTransitionURL}'); await expect(page).toHaveScreenshot({ timeout: 2000 }); @@ -149,7 +149,7 @@ test.describe('expect config animations option', () => { expect: { toHaveScreenshot: { animations: 'allow' } }, }), 'a.spec.js': ` - const { test, expect } = require('@playwright/test'); + const { test, expect } = require('@okep/test'); test('is a test', async ({ page }) => { await page.goto('${cssTransitionURL}'); await expect(page).toHaveScreenshot({ timeout: 2000 }); @@ -167,7 +167,7 @@ test('should fail with proper error when unsupported argument is given', async ( const result = await runInlineTest({ ...playwrightConfig({}), 'a.spec.js': ` - const { test, expect } = require('@playwright/test'); + const { test, expect } = require('@okep/test'); test('is a test', async ({ page }) => { await page.goto('${cssTransitionURL}'); await expect(page).toHaveScreenshot({ @@ -192,7 +192,7 @@ test('should have scale:css by default', async ({ runInlineTest }, testInfo) => snapshotPathTemplate: '__screenshots__/{testFilePath}/{arg}{ext}', }), 'a.spec.js': ` - const { test, expect } = require('@playwright/test'); + const { test, expect } = require('@okep/test'); test('is a test', async ({ browser }) => { const context = await browser.newContext({ viewport: { width: ${IMG_WIDTH}, height: ${IMG_HEIGHT} }, @@ -221,7 +221,7 @@ test('should ignore non-documented options in toHaveScreenshot config', async ({ }, }), 'a.spec.js': ` - const { test, expect } = require('@playwright/test'); + const { test, expect } = require('@okep/test'); test('is a test', async ({ page }) => { await expect(page).toHaveScreenshot('snapshot.png'); }); @@ -245,7 +245,7 @@ test('should report toHaveScreenshot step with expectation name in title', async `, ...playwrightConfig({ reporter: './reporter' }), 'a.spec.js': ` - const { test, expect } = require('@playwright/test'); + const { test, expect } = require('@okep/test'); test('is a test', async ({ page }) => { // Named expectation. await expect(page).toHaveScreenshot('foo.png', { timeout: 2000 }); @@ -283,7 +283,7 @@ test('should not fail when racing with navigation', async ({ runInlineTest }, te }), '__screenshots__/a.spec.js/snapshot.png': createImage(10, 10, 255, 0, 0), 'a.spec.js': ` - const { test, expect } = require('@playwright/test'); + const { test, expect } = require('@okep/test'); test('is a test', async ({ page }) => { await Promise.all([ page.goto('${infiniteAnimationURL}'), @@ -306,7 +306,7 @@ test('should successfully screenshot a page with infinite animation with disable snapshotPathTemplate: '__screenshots__/{testFilePath}/{arg}{ext}', }), 'a.spec.js': ` - const { test, expect } = require('@playwright/test'); + const { test, expect } = require('@okep/test'); test('is a test', async ({ page }) => { await page.goto('${infiniteAnimationURL}'); await expect(page).toHaveScreenshot({ @@ -326,7 +326,7 @@ test('should support clip option for page', async ({ runInlineTest }, testInfo) }), '__screenshots__/a.spec.js/snapshot.png': createImage(50, 50, 255, 255, 255), 'a.spec.js': ` - const { test, expect } = require('@playwright/test'); + const { test, expect } = require('@okep/test'); test('is a test', async ({ page }) => { await expect(page).toHaveScreenshot({ name: 'snapshot.png', @@ -345,7 +345,7 @@ test('should support omitBackground option for locator', async ({ runInlineTest snapshotPathTemplate: '__screenshots__/{testFilePath}/{arg}{ext}', }), 'a.spec.js': ` - const { test, expect } = require('@playwright/test'); + const { test, expect } = require('@okep/test'); test('is a test', async ({ page }) => { await page.evaluate(() => { document.body.style.setProperty('width', '100px'); @@ -384,7 +384,7 @@ test('should fail to screenshot an element with infinite animation', async ({ ru }], }), 'a.spec.js': ` - const { test, expect } = require('@playwright/test'); + const { test, expect } = require('@okep/test'); test('is a test', async ({ page }) => { await page.goto('${infiniteAnimationURL}'); await expect(page.locator('body')).toHaveScreenshot({ timeout: 2000 }); @@ -413,7 +413,7 @@ test('should fail to screenshot an element that keeps moving', async ({ runInlin }, }), 'a.spec.js': ` - const { test, expect } = require('@playwright/test'); + const { test, expect } = require('@okep/test'); test('is a test', async ({ page }) => { await page.goto('${infiniteAnimationURL}'); await expect(page.locator('div')).toHaveScreenshot({ timeout: 2000 }); @@ -435,7 +435,7 @@ test('should generate default name', async ({ runInlineTest }, testInfo) => { snapshotPathTemplate: '__screenshots__/{testFilePath}/{arg}{ext}', }), 'a.spec.js': ` - const { test, expect } = require('@playwright/test'); + const { test, expect } = require('@okep/test'); test('is a test', async ({ page }) => { await expect(page).toHaveScreenshot(); }); @@ -449,7 +449,7 @@ test('should generate default name', async ({ runInlineTest }, testInfo) => { test('should compile with different option combinations', async ({ runTSC }) => { const result = await runTSC({ 'playwright.config.ts': ` - import { defineConfig } from '@playwright/test'; + import { defineConfig } from '@okep/test'; export default defineConfig({ expect: { timeout: 10000, @@ -465,7 +465,7 @@ test('should compile with different option combinations', async ({ runTSC }) => }); `, 'a.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('is a test', async ({ page }) => { await expect(page).toHaveScreenshot(); await expect(page).toHaveScreenshot('img.png'); @@ -495,7 +495,7 @@ test('should fail when screenshot is different size', async ({ runInlineTest }) }), '__screenshots__/a.spec.js/snapshot.png': createImage(22, 33), 'a.spec.js': ` - const { test, expect } = require('@playwright/test'); + const { test, expect } = require('@okep/test'); test('is a test', async ({ page }) => { await expect(page).toHaveScreenshot('snapshot.png', { timeout: 2000 }); }); @@ -513,7 +513,7 @@ test('should fail when given non-png snapshot name', async ({ runInlineTest }) = snapshotPathTemplate: '__screenshots__/{testFilePath}/{arg}{ext}', }), 'a.spec.js': ` - const { test, expect } = require('@playwright/test'); + const { test, expect } = require('@okep/test'); test('is a test', async ({ page }) => { await expect(page).toHaveScreenshot('snapshot.jpeg'); }); @@ -527,7 +527,7 @@ test('should fail when given buffer', async ({ runInlineTest }) => { const result = await runInlineTest({ ...playwrightConfig({}), 'a.spec.js': ` - const { test, expect } = require('@playwright/test'); + const { test, expect } = require('@okep/test'); test('is a test', async ({ page }) => { await expect(Buffer.from([1])).toHaveScreenshot(); }); @@ -544,7 +544,7 @@ test('should fail when screenshot is different pixels', async ({ runInlineTest } }), '__screenshots__/a.spec.js/snapshot.png': paintBlackPixels(whiteImage, 12345), 'a.spec.js': ` - const { test, expect } = require('@playwright/test'); + const { test, expect } = require('@okep/test'); test('is a test', async ({ page }) => { await expect(page).toHaveScreenshot('snapshot.png', { timeout: 2000 }); }); @@ -566,7 +566,7 @@ test('doesn\'t create comparison artifacts in an output folder for passed negate }), '__screenshots__/a.spec.js/snapshot.png': blueImage, 'a.spec.js': ` - const { test, expect } = require('@playwright/test'); + const { test, expect } = require('@okep/test'); test('is a test', async ({ page }) => { await expect(page).not.toHaveScreenshot('snapshot.png'); }); @@ -590,7 +590,7 @@ test('should fail on same snapshots with negate matcher', async ({ runInlineTest }), '__screenshots__/a.spec.js/snapshot.png': whiteImage, 'a.spec.js': ` - const { test, expect } = require('@playwright/test'); + const { test, expect } = require('@okep/test'); test('is a test', async ({ page }) => { await expect(page).not.toHaveScreenshot('snapshot.png', { timeout: 2000 }); }); @@ -609,7 +609,7 @@ test('should not fail if --ignore-snapshots is passed', async ({ runInlineTest } }), '__screenshots__/a.spec.js/snapshot.png': redImage, 'a.spec.js': ` - const { test, expect } = require('@playwright/test'); + const { test, expect } = require('@okep/test'); test('is a test', async ({ page }) => { await expect(page).toHaveScreenshot('snapshot.png', { timeout: 2000 }); }); @@ -625,7 +625,7 @@ test('should write missing expectations locally twice and attach them', async ({ snapshotPathTemplate: '__screenshots__/{testFilePath}/{arg}{ext}', }), 'a.spec.js': ` - const { test, expect } = require('@playwright/test'); + const { test, expect } = require('@okep/test'); test('is a test', async ({ page }) => { await expect(page).toHaveScreenshot('snapshot.png'); await expect(page).toHaveScreenshot('snapshot2.png'); @@ -687,7 +687,7 @@ test('shouldn\'t write missing expectations locally for negated matcher', async snapshotPathTemplate: '__screenshots__/{testFilePath}/{arg}{ext}', }), 'a.spec.js': ` - const { test, expect } = require('@playwright/test'); + const { test, expect } = require('@okep/test'); test('is a test', async ({ page }) => { await expect(page).not.toHaveScreenshot('snapshot.png'); }); @@ -707,7 +707,7 @@ test('should update snapshot with the update-snapshots flag', async ({ runInline }), '__screenshots__/a.spec.js/snapshot.png': blueImage, 'a.spec.js': ` - const { test, expect } = require('@playwright/test'); + const { test, expect } = require('@okep/test'); test('is a test', async ({ page }) => { await expect(page).toHaveScreenshot('snapshot.png'); }); @@ -728,7 +728,7 @@ test('shouldn\'t update snapshot with the update-snapshots flag for negated matc }), '__screenshots__/a.spec.js/snapshot.png': EXPECTED_SNAPSHOT, 'a.spec.js': ` - const { test, expect } = require('@playwright/test'); + const { test, expect } = require('@okep/test'); test('is a test', async ({ page }) => { await expect(page).not.toHaveScreenshot('snapshot.png'); }); @@ -746,7 +746,7 @@ test('should silently write missing expectations locally with the update-snapsho snapshotPathTemplate: '__screenshots__/{testFilePath}/{arg}{ext}', }), 'a.spec.js': ` - const { test, expect } = require('@playwright/test'); + const { test, expect } = require('@okep/test'); test('is a test', async ({ page }) => { await expect(page).toHaveScreenshot('snapshot.png'); }); @@ -766,7 +766,7 @@ test('should not write missing expectations locally with the update-snapshots fl snapshotPathTemplate: '__screenshots__/{testFilePath}/{arg}{ext}', }), 'a.spec.js': ` - const { test, expect } = require('@playwright/test'); + const { test, expect } = require('@okep/test'); test('is a test', async ({ page }) => { await expect(page).not.toHaveScreenshot('snapshot.png'); }); @@ -788,7 +788,7 @@ test('should match multiple snapshots', async ({ runInlineTest }) => { '__screenshots__/a.spec.js/green.png': greenImage, '__screenshots__/a.spec.js/blue.png': blueImage, 'a.spec.js': ` - const { test, expect } = require('@playwright/test'); + const { test, expect } = require('@okep/test'); test('is a test', async ({ page }) => { await Promise.all([ page.evaluate(() => document.documentElement.style.setProperty('background', '#f00')), @@ -815,7 +815,7 @@ test('should use provided name', async ({ runInlineTest }) => { }), '__screenshots__/a.spec.js/provided.png': whiteImage, 'a.spec.js': ` - const { test, expect } = require('@playwright/test'); + const { test, expect } = require('@okep/test'); test('is a test', async ({ page }) => { await expect(page).toHaveScreenshot('provided.png'); }); @@ -831,7 +831,7 @@ test('should use provided name via options', async ({ runInlineTest }) => { }), '__screenshots__/a.spec.js/provided.png': whiteImage, 'a.spec.js': ` - const { test, expect } = require('@playwright/test'); + const { test, expect } = require('@okep/test'); test('is a test', async ({ page }) => { await expect(page).toHaveScreenshot({ name: 'provided.png' }); }); @@ -850,7 +850,7 @@ test('should respect maxDiffPixels option', async ({ runInlineTest }) => { }), '__screenshots__/a.spec.js/snapshot.png': EXPECTED_SNAPSHOT, 'a.spec.js': ` - const { test, expect } = require('@playwright/test'); + const { test, expect } = require('@okep/test'); test('is a test', async ({ page }) => { await expect(page).toHaveScreenshot('snapshot.png', { timeout: 2000 }); }); @@ -863,7 +863,7 @@ test('should respect maxDiffPixels option', async ({ runInlineTest }) => { }), '__screenshots__/a.spec.js/snapshot.png': EXPECTED_SNAPSHOT, 'a.spec.js': ` - const { test, expect } = require('@playwright/test'); + const { test, expect } = require('@okep/test'); test('is a test', async ({ page }) => { await expect(page).toHaveScreenshot('snapshot.png', { maxDiffPixels: ${BAD_PIXELS} @@ -887,7 +887,7 @@ test('should respect maxDiffPixels option', async ({ runInlineTest }) => { }), '__screenshots__/a.spec.js/snapshot.png': EXPECTED_SNAPSHOT, 'a.spec.js': ` - const { test, expect } = require('@playwright/test'); + const { test, expect } = require('@okep/test'); test('is a test', async ({ page }) => { await expect(page).toHaveScreenshot('snapshot.png'); }); @@ -905,7 +905,7 @@ test('should not update screenshot that matches with maxDiffPixels option when - }), '__screenshots__/a.spec.js/snapshot.png': EXPECTED_SNAPSHOT, 'a.spec.js': ` - const { test, expect } = require('@playwright/test'); + const { test, expect } = require('@okep/test'); test('is a test', async ({ page }) => { await expect(page).toHaveScreenshot('snapshot.png', { maxDiffPixels: ${BAD_PIXELS} }); }); @@ -934,7 +934,7 @@ test('should satisfy both maxDiffPixelRatio and maxDiffPixels', async ({ runInli }), '__screenshots__/a.spec.js/snapshot.png': EXPECTED_SNAPSHOT, 'a.spec.js': ` - const { test, expect } = require('@playwright/test'); + const { test, expect } = require('@okep/test'); test('is a test', async ({ page }) => { await expect(page).toHaveScreenshot('snapshot.png', { timeout: 2000 }); }); @@ -947,7 +947,7 @@ test('should satisfy both maxDiffPixelRatio and maxDiffPixels', async ({ runInli }), '__screenshots__/a.spec.js/snapshot.png': EXPECTED_SNAPSHOT, 'a.spec.js': ` - const { test, expect } = require('@playwright/test'); + const { test, expect } = require('@okep/test'); test('is a test', async ({ page }) => { await expect(page).toHaveScreenshot('snapshot.png', { maxDiffPixels: ${Math.floor(BAD_COUNT / 2)}, @@ -964,7 +964,7 @@ test('should satisfy both maxDiffPixelRatio and maxDiffPixels', async ({ runInli }), '__screenshots__/a.spec.js/snapshot.png': EXPECTED_SNAPSHOT, 'a.spec.js': ` - const { test, expect } = require('@playwright/test'); + const { test, expect } = require('@okep/test'); test('is a test', async ({ page }) => { await expect(page).toHaveScreenshot('snapshot.png', { maxDiffPixels: ${BAD_COUNT}, @@ -981,7 +981,7 @@ test('should satisfy both maxDiffPixelRatio and maxDiffPixels', async ({ runInli }), '__screenshots__/a.spec.js/snapshot.png': EXPECTED_SNAPSHOT, 'a.spec.js': ` - const { test, expect } = require('@playwright/test'); + const { test, expect } = require('@okep/test'); test('is a test', async ({ page }) => { await expect(page).toHaveScreenshot('snapshot.png', { maxDiffPixels: ${BAD_COUNT}, @@ -1003,7 +1003,7 @@ test('should respect maxDiffPixelRatio option', async ({ runInlineTest }) => { }), '__screenshots__/a.spec.js/snapshot.png': EXPECTED_SNAPSHOT, 'a.spec.js': ` - const { test, expect } = require('@playwright/test'); + const { test, expect } = require('@okep/test'); test('is a test', async ({ page }) => { await expect(page).toHaveScreenshot('snapshot.png', { timeout: 2000 }); }); @@ -1016,7 +1016,7 @@ test('should respect maxDiffPixelRatio option', async ({ runInlineTest }) => { }), '__screenshots__/a.spec.js/snapshot.png': EXPECTED_SNAPSHOT, 'a.spec.js': ` - const { test, expect } = require('@playwright/test'); + const { test, expect } = require('@okep/test'); test('is a test', async ({ page }) => { await expect(page).toHaveScreenshot('snapshot.png', { maxDiffPixelRatio: ${BAD_RATIO} @@ -1038,7 +1038,7 @@ test('should respect maxDiffPixelRatio option', async ({ runInlineTest }) => { }), '__screenshots__/a.spec.js/snapshot.png': EXPECTED_SNAPSHOT, 'a.spec.js': ` - const { test, expect } = require('@playwright/test'); + const { test, expect } = require('@okep/test'); test('is a test', async ({ page }) => { await expect(page).toHaveScreenshot('snapshot.png'); }); @@ -1050,7 +1050,7 @@ test('should throw for invalid maxDiffPixels values', async ({ runInlineTest }) expect((await runInlineTest({ ...playwrightConfig({}), 'a.spec.js': ` - const { test, expect } = require('@playwright/test'); + const { test, expect } = require('@okep/test'); test('is a test', async ({ page }) => { await expect(page).toHaveScreenshot({ maxDiffPixels: -1, @@ -1064,7 +1064,7 @@ test('should throw for invalid maxDiffPixelRatio values', async ({ runInlineTest expect((await runInlineTest({ ...playwrightConfig({}), 'a.spec.js': ` - const { test, expect } = require('@playwright/test'); + const { test, expect } = require('@okep/test'); test('is a test', async ({ page }) => { await expect(page).toHaveScreenshot({ maxDiffPixelRatio: 12, @@ -1082,7 +1082,7 @@ test('should attach expected/actual/diff when sizes are different', async ({ run }), '__screenshots__/a.spec.js/snapshot.png': createImage(2, 2), 'a.spec.js': ` - const { test, expect } = require('@playwright/test'); + const { test, expect } = require('@okep/test'); test.afterEach(async ({}, testInfo) => { console.log('## ' + JSON.stringify(testInfo.attachments)); }); @@ -1125,7 +1125,7 @@ test('should fail with missing expectations and retries', async ({ runInlineTest snapshotPathTemplate: '__screenshots__/{testFilePath}/{arg}{ext}', }), 'a.spec.js': ` - const { test, expect } = require('@playwright/test'); + const { test, expect } = require('@okep/test'); test('is a test', async ({ page }) => { await expect(page).toHaveScreenshot('snapshot.png'); }); @@ -1147,7 +1147,7 @@ test('should update expectations with retries', async ({ runInlineTest }, testIn snapshotPathTemplate: '__screenshots__/{testFilePath}/{arg}{ext}', }), 'a.spec.js': ` - const { test, expect } = require('@playwright/test'); + const { test, expect } = require('@okep/test'); test('is a test', async ({ page }) => { await expect(page).toHaveScreenshot('snapshot.png'); }); @@ -1171,7 +1171,7 @@ test('should respect comparator name', async ({ runInlineTest }) => { }), '__screenshots__/a.spec.js/snapshot.png': expected, 'a.spec.js': ` - const { test, expect } = require('@playwright/test'); + const { test, expect } = require('@okep/test'); test('should pass', async ({ page }) => { await page.goto('${actualURL}'); await expect(page.locator('img')).toHaveScreenshot('snapshot.png', { @@ -1222,7 +1222,7 @@ test('should respect comparator in config', async ({ runInlineTest }) => { }), '__screenshots__/a.spec.js/snapshot.png': expected, 'a.spec.js': ` - const { test, expect } = require('@playwright/test'); + const { test, expect } = require('@okep/test'); test('test', async ({ page }) => { await page.goto('${actualURL}'); await expect(page.locator('img')).toHaveScreenshot('snapshot.png', { threshold: 0, }); @@ -1244,7 +1244,7 @@ test('should throw pretty error if expected PNG file is not a PNG', async ({ run '__screenshots__/a.spec.js/snapshot.png': 'not a png', '__screenshots__/a.spec.js/snapshot.jpg': 'not a jpg', 'a.spec.js': ` - const { test, expect } = require('@playwright/test'); + const { test, expect } = require('@okep/test'); test('png', async ({ page }) => { await expect(page).toHaveScreenshot('snapshot.png'); }); @@ -1265,7 +1265,7 @@ test('should support maskColor option', async ({ runInlineTest }) => { }), '__screenshots__/a.spec.js/snapshot.png': createImage(IMG_WIDTH, IMG_HEIGHT, 0, 255, 0), 'a.spec.js': ` - const { test, expect } = require('@playwright/test'); + const { test, expect } = require('@okep/test'); test('png', async ({ page }) => { await page.setContent(''); await expect(page).toHaveScreenshot('snapshot.png', { @@ -1287,7 +1287,7 @@ test('should support stylePath option', async ({ runInlineTest }) => { '__screenshots__/tests/a.spec.js/png-1.png': createImage(IMG_WIDTH, IMG_HEIGHT, 0, 255, 0), 'screenshot.css': 'body { background: #00FF00; }', 'tests/a.spec.js': ` - const { test, expect } = require('@playwright/test'); + const { test, expect } = require('@okep/test'); test('png', async ({ page }) => { await page.setContent(''); await expect(page).toHaveScreenshot('snapshot.png', { @@ -1315,7 +1315,7 @@ test('should support stylePath option in config', async ({ runInlineTest }) => { 'screenshot.css': 'body { background: #00FF00; }', '__screenshots__/a.spec.js/snapshot.png': createImage(IMG_WIDTH, IMG_HEIGHT, 0, 255, 0), 'a.spec.js': ` - const { test, expect } = require('@playwright/test'); + const { test, expect } = require('@okep/test'); test('png', async ({ page }) => { await page.setContent(''); await expect(page).toHaveScreenshot('snapshot.png'); @@ -1339,7 +1339,7 @@ test('should trim+sanitize attachment names and paths', async ({ runInlineTest } snapshotPathTemplate: '__screenshots__/{testFilePath}/{arg}{ext}', }), 'a.spec.js': ` - const { test, expect } = require('@playwright/test'); + const { test, expect } = require('@okep/test'); test.afterEach(async ({}, testInfo) => { console.log('## ' + JSON.stringify(testInfo.attachments)); }); diff --git a/tests/playwright-test/types-2.spec.ts b/tests/playwright-test/types-2.spec.ts index e61d4870ed5fa..b9c3fdbf3997c 100644 --- a/tests/playwright-test/types-2.spec.ts +++ b/tests/playwright-test/types-2.spec.ts @@ -19,7 +19,7 @@ import { test, expect } from './playwright-test-fixtures'; test('basics should work', async ({ runTSC }) => { const result = await runTSC({ 'a.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test.describe('suite', () => { test.beforeEach(async () => {}); test.afterEach(async () => {}); @@ -74,7 +74,7 @@ test('basics should work', async ({ runTSC }) => { test('can pass sync functions everywhere', async ({ runTSC }) => { const result = await runTSC({ 'a.spec.ts': ` - import { test as base, expect } from '@playwright/test'; + import { test as base, expect } from '@okep/test'; const test = base.extend<{ foo: string }>({ foo: ({}, use) => use('bar'), }); @@ -91,7 +91,7 @@ test('can pass sync functions everywhere', async ({ runTSC }) => { test('can return anything from hooks', async ({ runTSC }) => { const result = await runTSC({ 'a.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test.beforeEach(() => '123'); test.afterEach(() => 123); test.beforeAll(() => [123]); @@ -104,7 +104,7 @@ test('can return anything from hooks', async ({ runTSC }) => { test('test.extend options should check types', async ({ runTSC }) => { const result = await runTSC({ 'helper.ts': ` - import { test as base, expect, mergeTests } from '@playwright/test'; + import { test as base, expect, mergeTests } from '@okep/test'; export type Params = { foo: string }; export const test = base; export const test1 = test.extend({ foo: [ 'foo', { option: true } ] }); @@ -138,7 +138,7 @@ test('test.extend options should check types', async ({ runTSC }) => { `, 'playwright.config.ts': ` import { Params } from './helper'; - import { Config } from '@playwright/test'; + import { Config } from '@okep/test'; const configs: Config[] = []; configs.push({}); @@ -182,7 +182,7 @@ test('test.extend options should check types', async ({ runTSC }) => { test('step should inherit return type from its callback ', async ({ runTSC }) => { const result = await runTSC({ 'a.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('my test', async ({ }) => { // @ts-expect-error const bad1: string = await test.step('my step', () => { diff --git a/tests/playwright-test/types.spec.ts b/tests/playwright-test/types.spec.ts index c34c586f7a0ad..f41a500851628 100644 --- a/tests/playwright-test/types.spec.ts +++ b/tests/playwright-test/types.spec.ts @@ -19,7 +19,7 @@ import { test, expect } from './playwright-test-fixtures'; test('should check types of fixtures', async ({ runTSC }) => { const result = await runTSC({ 'helper.ts': ` - import { test as base, expect, Page } from '@playwright/test'; + import { test as base, expect, Page } from '@okep/test'; export type MyOptions = { foo: string, bar: number }; export const test = base.extend<{ foo: string }, { bar: number }>({ foo: 'foo', @@ -118,7 +118,7 @@ test('should check types of fixtures', async ({ runTSC }) => { `, 'playwright.config.ts': ` import { MyOptions } from './helper'; - import { Config } from '@playwright/test'; + import { Config } from '@okep/test'; const configs1: Config[] = []; configs1.push({ use: { foo: '42', bar: 42 } }); configs1.push({ use: { foo: '42', bar: 42 }, timeout: 100 }); @@ -182,7 +182,7 @@ test('should check types of fixtures', async ({ runTSC }) => { test.afterAll(() => {}); `, 'playwright-props.config.ts': ` - import { PlaywrightTestConfig } from '@playwright/test'; + import { PlaywrightTestConfig } from '@okep/test'; const config0: PlaywrightTestConfig = { use: { ignoreHTTPSErrors: undefined, @@ -233,7 +233,7 @@ test('should check types of fixtures', async ({ runTSC }) => { `, 'playwright-define.config.ts': ` - import { defineConfig } from '@playwright/test'; + import { defineConfig } from '@okep/test'; const config0 = defineConfig({ use: { ignoreHTTPSErrors: undefined, @@ -283,7 +283,7 @@ test('should check types of fixtures', async ({ runTSC }) => { }); `, 'playwright-define-merge.config.ts': ` - import { defineConfig } from '@playwright/test'; + import { defineConfig } from '@okep/test'; const config0 = defineConfig({ timeout: 1, // @ts-expect-error @@ -293,7 +293,7 @@ test('should check types of fixtures', async ({ runTSC }) => { }); `, 'playwright-define-merge-ct.config.ts': ` - import { defineConfig } from '@playwright/experimental-ct-vue'; + import { defineConfig } from '@okep/experimental-ct-vue'; const config0 = defineConfig({ timeout: 1, // @ts-expect-error @@ -309,7 +309,7 @@ test('should check types of fixtures', async ({ runTSC }) => { test('config should allow void/empty options', async ({ runTSC }) => { const result = await runTSC({ 'playwright.config.ts': ` - import { Config } from '@playwright/test'; + import { Config } from '@okep/test'; const configs: Config[] = []; configs.push({}); configs.push({ timeout: 100 }); @@ -317,7 +317,7 @@ test('config should allow void/empty options', async ({ runTSC }) => { configs.push({ use: { foo: 42 }}); `, 'a.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('my test', async () => { }); ` diff --git a/tests/playwright-test/ui-mode-test-annotations.spec.ts b/tests/playwright-test/ui-mode-test-annotations.spec.ts index 7a0dea8af10c5..1092d8af727c5 100644 --- a/tests/playwright-test/ui-mode-test-annotations.spec.ts +++ b/tests/playwright-test/ui-mode-test-annotations.spec.ts @@ -19,7 +19,7 @@ import { test, expect } from './ui-mode-fixtures'; test('should display annotations', async ({ runUITest }) => { const { page } = await runUITest({ 'a.test.ts': ` - import { test } from '@playwright/test'; + import { test } from '@okep/test'; test.describe('suite', { annotation: { type: 'suite annotation', description: 'Some content' } }, () => { diff --git a/tests/playwright-test/ui-mode-test-attachments.spec.ts b/tests/playwright-test/ui-mode-test-attachments.spec.ts index 7016a36115781..1524f00bcc11b 100644 --- a/tests/playwright-test/ui-mode-test-attachments.spec.ts +++ b/tests/playwright-test/ui-mode-test-attachments.spec.ts @@ -21,7 +21,7 @@ test.describe.configure({ mode: 'parallel', retries }); test('should contain text attachment', async ({ runUITest }) => { const { page } = await runUITest({ 'a.test.ts': ` - import { test } from '@playwright/test'; + import { test } from '@okep/test'; test('attach test', async () => { // Attach two files with the same content and different names, // to make sure each is downloaded with an intended name. @@ -61,7 +61,7 @@ test('should contain text attachment', async ({ runUITest }) => { test('should contain binary attachment', async ({ runUITest }) => { const { page } = await runUITest({ 'a.test.ts': ` - import { test } from '@playwright/test'; + import { test } from '@okep/test'; test('attach test', async () => { await test.info().attach('data', { body: Buffer.from([1, 2, 3]), contentType: 'application/octet-stream' }); }); @@ -81,7 +81,7 @@ test('should contain binary attachment', async ({ runUITest }) => { test('should contain string attachment', async ({ runUITest }) => { const { page } = await runUITest({ 'a.test.ts': ` - import { test } from '@playwright/test'; + import { test } from '@okep/test'; test('attach test', async () => { await test.info().attach('note', { body: 'text42' }); }); @@ -106,7 +106,7 @@ test('should linkify string attachments', async ({ runUITest, server }) => { const { page } = await runUITest({ 'a.test.ts': ` - import { test } from '@playwright/test'; + import { test } from '@okep/test'; test('attach test', async () => { await test.info().attach('Inline url: ${server.PREFIX + '/one.html'}'); await test.info().attach('Second', { body: 'Inline link ${server.PREFIX + '/two.html'} to be highlighted.' }); diff --git a/tests/playwright-test/ui-mode-test-ct.spec.ts b/tests/playwright-test/ui-mode-test-ct.spec.ts index c4cc2492a9520..0162344ec8553 100644 --- a/tests/playwright-test/ui-mode-test-ct.spec.ts +++ b/tests/playwright-test/ui-mode-test-ct.spec.ts @@ -20,11 +20,11 @@ test.describe.configure({ mode: 'parallel', retries }); const basicTestTree = { 'playwright.config.ts': ` - import { defineConfig } from '@playwright/experimental-ct-react'; + import { defineConfig } from '@okep/experimental-ct-react'; export default defineConfig({ use: { ctPort: ${3200 + (+process.env.TEST_PARALLEL_INDEX)} - } + } }); `, 'playwright/index.html': ``, @@ -33,7 +33,7 @@ const basicTestTree = { export const Button = () => ; `, 'src/button.test.tsx': ` - import { test, expect } from '@playwright/experimental-ct-react'; + import { test, expect } from '@okep/experimental-ct-react'; import { Button } from './button'; test('pass', async ({ mount }) => { @@ -70,7 +70,7 @@ test('should run component tests after editing test', async ({ runUITest, writeF await writeFiles({ 'src/button.test.tsx': ` - import { test, expect } from '@playwright/experimental-ct-react'; + import { test, expect } from '@okep/experimental-ct-react'; import { Button } from './button'; test('fail', async ({ mount }) => { @@ -128,7 +128,7 @@ test('should run component tests after editing test and component', async ({ run await writeFiles({ 'src/button.test.tsx': ` - import { test, expect } from '@playwright/experimental-ct-react'; + import { test, expect } from '@okep/experimental-ct-react'; import { Button } from './button'; test('pass 2', async ({ mount }) => { @@ -169,7 +169,7 @@ test('should watch test', async ({ runUITest, writeFiles }) => { await writeFiles({ 'src/button.test.tsx': ` - import { test, expect } from '@playwright/experimental-ct-react'; + import { test, expect } from '@okep/experimental-ct-react'; import { Button } from './button'; test('pass', async ({ mount }) => { diff --git a/tests/playwright-test/ui-mode-test-filters.spec.ts b/tests/playwright-test/ui-mode-test-filters.spec.ts index 5d70048473e5f..a4b512880115b 100644 --- a/tests/playwright-test/ui-mode-test-filters.spec.ts +++ b/tests/playwright-test/ui-mode-test-filters.spec.ts @@ -20,7 +20,7 @@ test.describe.configure({ mode: 'parallel', retries }); const basicTestTree = { 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('passes', () => {}); test('fails', () => { expect(1).toBe(2); }); test.describe('suite', () => { @@ -29,7 +29,7 @@ const basicTestTree = { }); `, 'b.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('passes', () => {}); test('fails', () => { expect(1).toBe(2); }); `, @@ -59,7 +59,7 @@ test('should filter by explicit tags', async ({ runUITest }) => { test('should display native tags and filter by them on click', async ({ runUITest }) => { const { page } = await runUITest({ 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('p', () => {}); test('pwt', { tag: '@smoke' }, () => {}); `, @@ -120,7 +120,7 @@ test('should filter by project', async ({ runUITest }) => { const { page } = await runUITest({ ...basicTestTree, 'playwright.config.ts': ` - import { defineConfig } from '@playwright/test'; + import { defineConfig } from '@okep/test'; export default defineConfig({ projects: [ { name: 'foo' }, @@ -179,7 +179,7 @@ test('should not hide filtered while running', async ({ runUITest, createLatch } const latch = createLatch(); const { page } = await runUITest({ 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('passes', () => {}); test('fails', async () => { ${latch.blockingCode} @@ -208,7 +208,7 @@ test('should not hide filtered while running', async ({ runUITest, createLatch } test('should filter skipped', async ({ runUITest, createLatch }) => { const { page } = await runUITest({ 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('passes', () => {}); test.skip('fails', async () => { expect(1).toBe(2); diff --git a/tests/playwright-test/ui-mode-test-network-tab.spec.ts b/tests/playwright-test/ui-mode-test-network-tab.spec.ts index e1b3bef9ede77..6d3f5c7a41994 100644 --- a/tests/playwright-test/ui-mode-test-network-tab.spec.ts +++ b/tests/playwright-test/ui-mode-test-network-tab.spec.ts @@ -21,7 +21,7 @@ test('should filter network requests by resource type', async ({ runUITest, serv const { page } = await runUITest({ 'network-tab.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('network tab test', async ({ page }) => { await page.goto('${server.PREFIX}/network-tab/network.html'); }); @@ -61,7 +61,7 @@ test('should filter network requests by resource type', async ({ runUITest, serv test('should filter network requests by url', async ({ runUITest, server }) => { const { page } = await runUITest({ 'network-tab.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('network tab test', async ({ page }) => { await page.goto('${server.PREFIX}/network-tab/network.html'); }); @@ -97,7 +97,7 @@ test('should filter network requests by url', async ({ runUITest, server }) => { test('should format JSON request body', async ({ runUITest, server }) => { const { page } = await runUITest({ 'network-tab.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('network tab test', async ({ page }) => { await page.goto('${server.PREFIX}/network-tab/network.html'); }); @@ -139,7 +139,7 @@ test('should format JSON request body', async ({ runUITest, server }) => { test('should display list of query parameters (only if present)', async ({ runUITest, server }) => { const { page } = await runUITest({ 'network-tab.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('network tab test', async ({ page }) => { await page.goto('${server.PREFIX}/network-tab/network.html'); }); diff --git a/tests/playwright-test/ui-mode-test-output.spec.ts b/tests/playwright-test/ui-mode-test-output.spec.ts index b10c02d08a43f..c4ac759170e14 100644 --- a/tests/playwright-test/ui-mode-test-output.spec.ts +++ b/tests/playwright-test/ui-mode-test-output.spec.ts @@ -22,7 +22,7 @@ test.describe.configure({ mode: 'parallel', retries }); test('should print load errors', async ({ runUITest }) => { const { page } = await runUITest({ 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('syntax error', () => { await 1; }); @@ -35,7 +35,7 @@ test('should print load errors', async ({ runUITest }) => { test('should work after theme switch', async ({ runUITest, writeFiles }) => { const { page } = await runUITest({ 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('syntax error', async () => { console.log('Hello world 1'); }); @@ -49,7 +49,7 @@ test('should work after theme switch', async ({ runUITest, writeFiles }) => { await page.getByLabel('Dark mode').click(); await writeFiles({ 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('syntax error', async () => { console.log('Hello world 2'); }); @@ -62,7 +62,7 @@ test('should work after theme switch', async ({ runUITest, writeFiles }) => { test('should print buffers', async ({ runUITest }) => { const { page } = await runUITest({ 'a.test.ts': ` - import { test } from '@playwright/test'; + import { test } from '@okep/test'; import { PassThrough } from 'stream'; test('print', () => { const writable = new PassThrough(); @@ -80,7 +80,7 @@ test('should print buffers', async ({ runUITest }) => { test('should show console messages for test', async ({ runUITest }, testInfo) => { const { page } = await runUITest({ 'a.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('print', async ({ page }) => { await page.evaluate(() => console.log('page message')); console.log('node message'); @@ -117,7 +117,7 @@ test('should show console messages for test', async ({ runUITest }, testInfo) => test('should format console messages in page', async ({ runUITest }, testInfo) => { const { page } = await runUITest({ 'a.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('print', async ({ page }) => { await page.evaluate(async () => { console.log('Object %O', { a: 1 }); @@ -159,7 +159,7 @@ test('should format console messages in page', async ({ runUITest }, testInfo) = test('should stream console messages live', async ({ runUITest }) => { const { page } = await runUITest({ 'a.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('print', async ({ page }) => { await page.setContent(''); const button = page.getByRole('button', { name: 'Click me' }); @@ -186,7 +186,7 @@ test('should stream console messages live', async ({ runUITest }) => { test('should print beforeAll console messages once', async ({ runUITest }, testInfo) => { const { page } = await runUITest({ 'a.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test.beforeAll(() => { console.log('before all log'); }); @@ -210,7 +210,7 @@ test('should print web server output', async ({ runUITest }, { workerIndex }) => const serverPath = path.join(__dirname, 'assets', 'simple-server.js'); const { page } = await runUITest({ 'test.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('connect to the server', async ({baseURL, page}) => { expect(baseURL).toBe('http://localhost:${port}'); }); diff --git a/tests/playwright-test/ui-mode-test-progress.spec.ts b/tests/playwright-test/ui-mode-test-progress.spec.ts index a8471fb46ccab..f0c8ab7036725 100644 --- a/tests/playwright-test/ui-mode-test-progress.spec.ts +++ b/tests/playwright-test/ui-mode-test-progress.spec.ts @@ -35,7 +35,7 @@ test('should update trace live', async ({ runUITest, server }) => { const { page } = await runUITest({ 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('live test', async ({ page }) => { await page.goto('${server.PREFIX}/one.html'); await page.goto('${server.PREFIX}/two.html'); @@ -117,7 +117,7 @@ test('should preserve action list selection upon live trace update', async ({ ru const { page } = await runUITest({ 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('live test', async ({ page }) => { await page.goto('about:blank'); await page.setContent('hello'); @@ -180,7 +180,7 @@ test('should update tracing network live', async ({ runUITest, server }) => { const { page } = await runUITest({ 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('live test', async ({ page }) => { await page.goto('${server.PREFIX}/one.html'); await page.setContent('hello'); @@ -218,7 +218,7 @@ test('should show trace w/ multiple contexts', async ({ runUITest, server, creat const { page } = await runUITest({ 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test.beforeEach(async ({ request }) => { await request.get('${server.EMPTY_PAGE}'); }); @@ -250,7 +250,7 @@ test('should show live trace for serial', async ({ runUITest, server, createLatc const { page } = await runUITest({ 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; let page; test.describe.configure({ mode: 'serial' }); test.beforeAll(async ({ browser }) => { @@ -295,7 +295,7 @@ test('should show live trace from hooks', async ({ runUITest, createLatch }) => const { page } = await runUITest({ 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test.beforeAll(async ({ browser }) => { const page = await browser.newPage(); ${latch1.blockingCode} diff --git a/tests/playwright-test/ui-mode-test-run.spec.ts b/tests/playwright-test/ui-mode-test-run.spec.ts index 5ead1889f0fbd..cac7b0d9fb28c 100644 --- a/tests/playwright-test/ui-mode-test-run.spec.ts +++ b/tests/playwright-test/ui-mode-test-run.spec.ts @@ -20,7 +20,7 @@ test.describe.configure({ mode: 'parallel', retries }); const basicTestTree = { 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('passes', () => {}); test('fails', () => { expect(1).toBe(2); }); test.describe('suite', () => { @@ -29,12 +29,12 @@ const basicTestTree = { }); `, 'b.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('passes', () => {}); test('fails', () => { expect(1).toBe(2); }); `, 'c.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('passes', () => {}); test.skip('skipped', () => {}); `, @@ -67,7 +67,7 @@ test('should run visible', async ({ runUITest }) => { test('should show running progress', async ({ runUITest }) => { const { page } = await runUITest({ 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('test 1', async () => {}); test('test 2', async () => new Promise(() => {})); test('test 3', async () => {}); @@ -86,7 +86,7 @@ test('should show running progress', async ({ runUITest }) => { test('should run on hover', async ({ runUITest }) => { const { page } = await runUITest({ 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('passes', () => {}); test('fails', () => { expect(1).toBe(2); }); `, @@ -105,7 +105,7 @@ test('should run on hover', async ({ runUITest }) => { test('should run on double click', async ({ runUITest }) => { const { page } = await runUITest({ 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('passes', () => {}); test('fails', () => { expect(1).toBe(2); }); `, @@ -123,7 +123,7 @@ test('should run on double click', async ({ runUITest }) => { test('should run on Enter', async ({ runUITest }) => { const { page } = await runUITest({ 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('passes', () => {}); test('fails', () => { expect(1).toBe(2); }); `, @@ -143,7 +143,7 @@ test('should run by project', async ({ runUITest }) => { const { page } = await runUITest({ ...basicTestTree, 'playwright.config.ts': ` - import { defineConfig } from '@playwright/test'; + import { defineConfig } from '@okep/test'; export default defineConfig({ projects: [ { name: 'foo' }, @@ -223,7 +223,7 @@ test('should run by project', async ({ runUITest }) => { test('should stop', async ({ runUITest }) => { const { page } = await runUITest({ 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('test 0', () => { test.skip(); }); test('test 1', () => {}); test('test 2', async () => { await new Promise(() => {}); }); @@ -261,15 +261,15 @@ test('should stop', async ({ runUITest }) => { test('should run folder', async ({ runUITest }) => { const { page } = await runUITest({ 'a/folder-b/folder-c/inC.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('passes', () => {}); `, 'a/folder-b/in-b.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('passes', () => {}); `, 'a/in-a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('passes', () => {}); `, }); @@ -313,7 +313,7 @@ test('should show time', async ({ runUITest }) => { test('should show test.fail as passing', async ({ runUITest }) => { const { page } = await runUITest({ 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('should fail', () => { test.fail(); expect(1).toBe(2); @@ -337,13 +337,13 @@ test('should show test.fail as passing', async ({ runUITest }) => { test('should ignore repeatEach', async ({ runUITest }) => { const { page } = await runUITest({ 'playwright.config.ts': ` - import { defineConfig } from '@playwright/test'; + import { defineConfig } from '@okep/test'; export default defineConfig({ repeatEach: 3, }); `, 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('should pass', () => { expect(1).toBe(1); }); @@ -366,11 +366,11 @@ test('should ignore repeatEach', async ({ runUITest }) => { test('should remove output folder before test run', async ({ runUITest }) => { const { page } = await runUITest({ 'playwright.config.ts': ` - import { defineConfig } from '@playwright/test'; + import { defineConfig } from '@okep/test'; `, 'a.test.ts': ` import fs from 'fs'; - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('should pass', () => { const path = test.info().outputPath('a.txt'); expect(fs.existsSync(path)).toBe(false); @@ -400,7 +400,7 @@ test('should remove output folder before test run', async ({ runUITest }) => { test('should show proper total when using deps', async ({ runUITest }) => { const { page } = await runUITest({ 'playwright.config.ts': ` - import { defineConfig } from "@playwright/test"; + import { defineConfig } from "@okep/test"; export default defineConfig({ projects: [ { name: "setup", grep: /@setup/, }, @@ -409,7 +409,7 @@ test('should show proper total when using deps', async ({ runUITest }) => { }); `, 'a.test.ts': ` - import { expect, test } from "@playwright/test"; + import { expect, test } from "@okep/test"; test("run @setup", async ({ page }) => { console.log("Test setup executed"); }); @@ -484,7 +484,7 @@ test('should respect --tsconfig option', { }`, 'tests42/a.test.ts': ` import { foo } from '~/foo'; - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('test', ({}) => { expect(foo).toBe(42); }); @@ -509,7 +509,7 @@ test('should respect --ignore-snapshots option', { }, async ({ runUITest }) => { const { page } = await runUITest({ 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('snapshot', () => { expect('foo').toMatchSnapshot(); // fails because no snapshot is present }); diff --git a/tests/playwright-test/ui-mode-test-screencast.spec.ts b/tests/playwright-test/ui-mode-test-screencast.spec.ts index 23e4f5872e955..ba40369e5a852 100644 --- a/tests/playwright-test/ui-mode-test-screencast.spec.ts +++ b/tests/playwright-test/ui-mode-test-screencast.spec.ts @@ -21,7 +21,7 @@ test.describe.configure({ mode: 'parallel', retries }); test('should show screenshots', async ({ runUITest }) => { const { page } = await runUITest({ 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('test 1', async ({ page }) => { await page.setContent('
'); await expect(page.locator('body')).toBeVisible(); diff --git a/tests/playwright-test/ui-mode-test-setup.spec.ts b/tests/playwright-test/ui-mode-test-setup.spec.ts index cd5503427d1f4..4683407e6a84b 100644 --- a/tests/playwright-test/ui-mode-test-setup.spec.ts +++ b/tests/playwright-test/ui-mode-test-setup.spec.ts @@ -22,7 +22,7 @@ test.describe.configure({ mode: 'parallel', retries }); test('should run global setup and teardown', async ({ runUITest }, testInfo) => { const { page, testProcess } = await runUITest({ 'playwright.config.ts': ` - import { defineConfig } from '@playwright/test'; + import { defineConfig } from '@okep/test'; export default defineConfig({ globalSetup: './globalSetup', globalTeardown: './globalTeardown.ts', @@ -42,7 +42,7 @@ test('should run global setup and teardown', async ({ runUITest }, testInfo) => }; `, 'a.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('should work', async ({}) => {}); ` }, undefined, { additionalArgs: ['--output=foo'] }); @@ -67,7 +67,7 @@ test('should teardown on sigint', async ({ runUITest, nodeVersion }) => { const { page, testProcess } = await runUITest({ 'playwright.config.ts': ` - import { defineConfig } from '@playwright/test'; + import { defineConfig } from '@okep/test'; export default defineConfig({ globalSetup: './globalSetup', globalTeardown: './globalTeardown.ts', @@ -80,7 +80,7 @@ test('should teardown on sigint', async ({ runUITest, nodeVersion }) => { export default () => console.log('\\n%%from-global-teardown'); `, 'a.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('should work', async ({}) => {}); ` }); @@ -98,7 +98,7 @@ test('should teardown on sigint', async ({ runUITest, nodeVersion }) => { test('should show errors in config', async ({ runUITest }) => { const { page } = await runUITest({ 'playwright.config.ts': ` - import { defineConfig, devices } from '@playwright/test'; + import { defineConfig, devices } from '@okep/test'; throw new Error("URL is empty") `, }); @@ -108,7 +108,7 @@ test('should show errors in config', async ({ runUITest }) => { const testsWithSetup = { 'playwright.config.ts': ` - import { defineConfig } from '@playwright/test'; + import { defineConfig } from '@okep/test'; export default defineConfig({ projects: [ { name: 'setup', teardown: 'teardown', testMatch: 'setup.ts' }, @@ -118,19 +118,19 @@ const testsWithSetup = { }); `, 'setup.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('setup', async ({}) => { console.log('from-setup'); }); `, 'test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('test', async ({}) => { console.log('from-test'); }); `, 'teardown.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('teardown', async ({}) => { console.log('from-teardown'); }); @@ -230,7 +230,7 @@ for (const useWeb of [true, false]) { test.skip(nodeVersion.major < 18); const { page, testProcess } = await runUITest({ 'playwright.config.ts': ` - import { defineConfig } from '@playwright/test'; + import { defineConfig } from '@okep/test'; export default defineConfig({ globalTeardown: './globalTeardown.ts', }); @@ -243,7 +243,7 @@ for (const useWeb of [true, false]) { }; `, 'a.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('should work', async ({}) => {}); ` }, null, { useWeb }); @@ -264,7 +264,7 @@ test('should restart webserver on reload', async ({ runUITest }) => { const { page } = await runUITest({ 'playwright.config.ts': ` - import { defineConfig } from '@playwright/test'; + import { defineConfig } from '@okep/test'; export default defineConfig({ webServer: { command: 'node ${JSON.stringify(SIMPLE_SERVER_PATH)} ${port}', @@ -274,7 +274,7 @@ test('should restart webserver on reload', async ({ runUITest }) => { }); `, 'a.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('should work', async ({ page }) => { await page.goto('http://localhost:${port}'); }); diff --git a/tests/playwright-test/ui-mode-test-shortcut.spec.ts b/tests/playwright-test/ui-mode-test-shortcut.spec.ts index 586751880ef2f..0226c68d4624c 100644 --- a/tests/playwright-test/ui-mode-test-shortcut.spec.ts +++ b/tests/playwright-test/ui-mode-test-shortcut.spec.ts @@ -20,7 +20,7 @@ test.describe.configure({ mode: 'parallel', retries }); const basicTestTree = { 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('test 0', () => { test.skip(); }); test('test 1', () => {}); test('test 2', async () => { await new Promise(() => {}); }); diff --git a/tests/playwright-test/ui-mode-test-source.spec.ts b/tests/playwright-test/ui-mode-test-source.spec.ts index 1dfcd7b87ec40..832d0dc13f0fd 100644 --- a/tests/playwright-test/ui-mode-test-source.spec.ts +++ b/tests/playwright-test/ui-mode-test-source.spec.ts @@ -20,12 +20,12 @@ test.describe.configure({ mode: 'parallel', retries }); const basicTestTree = { 'a.test.ts': ` - import { test } from '@playwright/test'; + import { test } from '@okep/test'; test('first', () => {}); test('second', () => {}); `, 'b.test.ts': ` - import { test } from '@playwright/test'; + import { test } from '@okep/test'; test('third', () => {}); `, }; @@ -68,14 +68,14 @@ test('should show selected test in sources', async ({ runUITest }) => { test('should show top-level errors in file', async ({ runUITest }) => { const { page } = await runUITest({ 'a.test.ts': ` - import { test } from '@playwright/test'; + import { test } from '@okep/test'; const a = 1; a = 2; test('first', () => {}); test('second', () => {}); `, 'b.test.ts': ` - import { test } from '@playwright/test'; + import { test } from '@okep/test'; test('third', () => {}); `, }); @@ -104,7 +104,7 @@ test('should show top-level errors in file', async ({ runUITest }) => { test('should show syntax errors in file', async ({ runUITest }) => { const { page } = await runUITest({ 'a.test.ts': ` - import { test } from '@playwright/test'& + import { test } from '@okep/test'& test('first', () => {}); test('second', () => {}); `, @@ -119,7 +119,7 @@ test('should show syntax errors in file', async ({ runUITest }) => { ).toHaveText('a.test.ts'); await expect( page.locator('.CodeMirror .source-line-running'), - ).toHaveText(`2 import { test } from '@playwright/test'&`); + ).toHaveText(`2 import { test } from '@okep/test'&`); await expect( page.locator('.CodeMirror-linewidget') @@ -132,7 +132,7 @@ test('should show syntax errors in file', async ({ runUITest }) => { test('should load error (dupe tests) indicator on sources', async ({ runUITest }) => { const { page } = await runUITest({ 'a.test.ts': ` - import { test } from '@playwright/test'; + import { test } from '@okep/test'; test('first', () => {}); test('first', () => {}); `, diff --git a/tests/playwright-test/ui-mode-test-tree.spec.ts b/tests/playwright-test/ui-mode-test-tree.spec.ts index 7346c204e4ce2..11765431d6fcf 100644 --- a/tests/playwright-test/ui-mode-test-tree.spec.ts +++ b/tests/playwright-test/ui-mode-test-tree.spec.ts @@ -20,7 +20,7 @@ test.describe.configure({ mode: 'parallel', retries }); const basicTestTree = { 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('passes', () => {}); test('fails', () => {}); test.describe('suite', () => { @@ -29,7 +29,7 @@ const basicTestTree = { }); `, 'b.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('passes', () => {}); test('fails', () => {}); `, @@ -52,7 +52,7 @@ test('should list all tests from projects with clashing names', async ({ runUITe test.info().annotations.push({ type: 'issue', description: 'https://github.com/microsoft/playwright/issues/30396' }); const { page } = await runUITest({ 'playwright.config.ts': ` - import { defineConfig } from '@playwright/test'; + import { defineConfig } from '@okep/test'; export default defineConfig({ projects: [ @@ -76,12 +76,12 @@ test('should list all tests from projects with clashing names', async ({ runUITe }); `, 'foo/a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('one', () => {}); test('two', () => {}); `, 'bar/b.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('three', () => {}); test('four', () => {}); `, @@ -175,15 +175,15 @@ test('should expand / collapse groups', async ({ runUITest }) => { test('should merge folder trees', async ({ runUITest }) => { const { page } = await runUITest({ 'a/b/c/inC.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('passes', () => {}); `, 'a/b/in-b.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('passes', () => {}); `, 'a/in-a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('passes', () => {}); `, }); @@ -200,7 +200,7 @@ test('should merge folder trees', async ({ runUITest }) => { test('should list parametrized tests', async ({ runUITest }) => { const { page } = await runUITest({ 'a.test.ts': ` - import { test } from '@playwright/test'; + import { test } from '@okep/test'; test.describe('cookies', () => { for (const country of ['FR', 'DE', 'LT']) { test.describe(() => { @@ -229,7 +229,7 @@ test('should list parametrized tests', async ({ runUITest }) => { test('should update parametrized tests', async ({ runUITest, writeFiles }) => { const { page } = await runUITest({ 'a.test.ts': ` - import { test } from '@playwright/test'; + import { test } from '@okep/test'; test.describe('cookies', () => { for (const country of ['FR', 'DE', 'LT']) { test.describe(() => { @@ -256,7 +256,7 @@ test('should update parametrized tests', async ({ runUITest, writeFiles }) => { await writeFiles({ 'a.test.ts': ` - import { test } from '@playwright/test'; + import { test } from '@okep/test'; test.describe('cookies', () => { for (const country of ['FR', 'LT']) { test.describe(() => { @@ -300,7 +300,7 @@ test('should collapse all', async ({ runUITest }) => { test('should resolve title conflicts', async ({ runUITest }) => { const { page } = await runUITest({ 'a.test.ts': ` - import { test } from '@playwright/test'; + import { test } from '@okep/test'; test("foo", () => {}); diff --git a/tests/playwright-test/ui-mode-test-update.spec.ts b/tests/playwright-test/ui-mode-test-update.spec.ts index 61e2c89dc7e47..57a0b48da35e8 100644 --- a/tests/playwright-test/ui-mode-test-update.spec.ts +++ b/tests/playwright-test/ui-mode-test-update.spec.ts @@ -20,7 +20,7 @@ test.describe.configure({ mode: 'parallel', retries }); const basicTestTree = { 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('passes', () => {}); test('fails', () => {}); test.describe('suite', () => { @@ -29,7 +29,7 @@ const basicTestTree = { }); `, 'b.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('passes', () => {}); test('fails', () => {}); `, @@ -49,7 +49,7 @@ test('should pick new / deleted files', async ({ runUITest, writeFiles, deleteFi await writeFiles({ 'c.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('passes', () => {}); test('fails', () => {}); ` @@ -94,7 +94,7 @@ test('should pick new / deleted tests', async ({ runUITest, writeFiles, deleteFi await writeFiles({ 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('passes', () => {}); test('new', () => {}); test('fails', () => {}); @@ -115,7 +115,7 @@ test('should pick new / deleted tests', async ({ runUITest, writeFiles, deleteFi await writeFiles({ 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('new', () => {}); ` }); @@ -135,7 +135,7 @@ test('should not loose run information after execution if test wrote into testDi 'a.test.ts': ` import fs from 'fs'; import path from 'path'; - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('passes', () => { fs.writeFileSync(path.join(test.info().project.testDir, 'something.txt'), 'hi'); }); @@ -181,7 +181,7 @@ test('should pick new / deleted nested tests', async ({ runUITest, writeFiles, d await writeFiles({ 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('passes', () => {}); test.describe('suite', () => { test('inner new', () => {}); @@ -202,7 +202,7 @@ test('should pick new / deleted nested tests', async ({ runUITest, writeFiles, d test('should update test locations', async ({ runUITest, writeFiles }) => { const { page } = await runUITest({ 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('passes', () => {}); `, }); @@ -233,7 +233,7 @@ test('should update test locations', async ({ runUITest, writeFiles }) => { await writeFiles({ 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('new-test', () => {}); test('passes', () => {}); diff --git a/tests/playwright-test/ui-mode-test-watch.spec.ts b/tests/playwright-test/ui-mode-test-watch.spec.ts index 81f4f4ae69857..0cdb32c479ddb 100644 --- a/tests/playwright-test/ui-mode-test-watch.spec.ts +++ b/tests/playwright-test/ui-mode-test-watch.spec.ts @@ -21,7 +21,7 @@ test.describe.configure({ mode: 'parallel', retries }); test('should watch files', async ({ runUITest, writeFiles }) => { const { page } = await runUITest({ 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('passes', () => {}); test('fails', () => { expect(1).toBe(2); }); `, @@ -45,7 +45,7 @@ test('should watch files', async ({ runUITest, writeFiles }) => { await writeFiles({ 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('passes', () => {}); test('fails', () => { expect(1).toBe(1); }); ` @@ -61,14 +61,14 @@ test('should watch files', async ({ runUITest, writeFiles }) => { test('should watch e2e deps', async ({ runUITest, writeFiles }) => { const { page } = await runUITest({ 'pw-recorder.config.ts': ` - import { defineConfig } from '@playwright/test'; + import { defineConfig } from '@okep/test'; export default defineConfig({ testDir: 'tests' }); `, 'src/helper.ts': ` export const answer = 41; `, 'tests/a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; import { answer } from '../src/helper'; test('answer', () => { expect(answer).toBe(42); }); `, @@ -95,10 +95,10 @@ test('should watch e2e deps', async ({ runUITest, writeFiles }) => { test('should batch watch updates', async ({ runUITest, writeFiles }) => { const { page } = await runUITest({ - 'a.test.ts': `import { test } from '@playwright/test'; test('test', () => {});`, - 'b.test.ts': `import { test } from '@playwright/test'; test('test', () => {});`, - 'c.test.ts': `import { test } from '@playwright/test'; test('test', () => {});`, - 'd.test.ts': `import { test } from '@playwright/test'; test('test', () => {});`, + 'a.test.ts': `import { test } from '@okep/test'; test('test', () => {});`, + 'b.test.ts': `import { test } from '@okep/test'; test('test', () => {});`, + 'c.test.ts': `import { test } from '@okep/test'; test('test', () => {});`, + 'd.test.ts': `import { test } from '@okep/test'; test('test', () => {});`, }); await page.getByText('a.test.ts').click(); @@ -122,10 +122,10 @@ test('should batch watch updates', async ({ runUITest, writeFiles }) => { `); await writeFiles({ - 'a.test.ts': `import { test } from '@playwright/test'; test('test', () => {});`, - 'b.test.ts': `import { test } from '@playwright/test'; test('test', () => {});`, - 'c.test.ts': `import { test } from '@playwright/test'; test('test', () => {});`, - 'd.test.ts': `import { test } from '@playwright/test'; test('test', () => {});`, + 'a.test.ts': `import { test } from '@okep/test'; test('test', () => {});`, + 'b.test.ts': `import { test } from '@okep/test'; test('test', () => {});`, + 'c.test.ts': `import { test } from '@okep/test'; test('test', () => {});`, + 'd.test.ts': `import { test } from '@okep/test'; test('test', () => {});`, }); await expect(page.getByTestId('status-line')).toHaveText('4/4 passed (100%)'); @@ -144,10 +144,10 @@ test('should batch watch updates', async ({ runUITest, writeFiles }) => { test('should watch all', async ({ runUITest, writeFiles }) => { const { page } = await runUITest({ - 'a.test.ts': `import { test } from '@playwright/test'; test('test', () => {});`, - 'b.test.ts': `import { test } from '@playwright/test'; test('test', () => {});`, - 'c.test.ts': `import { test } from '@playwright/test'; test('test', () => {});`, - 'd.test.ts': `import { test } from '@playwright/test'; test('test', () => {});`, + 'a.test.ts': `import { test } from '@okep/test'; test('test', () => {});`, + 'b.test.ts': `import { test } from '@okep/test'; test('test', () => {});`, + 'c.test.ts': `import { test } from '@okep/test'; test('test', () => {});`, + 'd.test.ts': `import { test } from '@okep/test'; test('test', () => {});`, }); await expect.poll(dumpTestTree(page)).toBe(` @@ -163,8 +163,8 @@ test('should watch all', async ({ runUITest, writeFiles }) => { await page.getByTitle('Watch all').click(); await writeFiles({ - 'a.test.ts': `import { test } from '@playwright/test'; test('test', () => {});`, - 'd.test.ts': `import { test } from '@playwright/test'; test('test', () => {});`, + 'a.test.ts': `import { test } from '@okep/test'; test('test', () => {});`, + 'd.test.ts': `import { test } from '@okep/test'; test('test', () => {});`, }); await expect(page.getByTestId('status-line')).toHaveText('2/2 passed (100%)'); @@ -183,7 +183,7 @@ test('should watch all', async ({ runUITest, writeFiles }) => { test('should watch new file', async ({ runUITest, writeFiles }) => { const { page } = await runUITest({ - 'a.test.ts': `import { test } from '@playwright/test'; test('test', () => {});`, + 'a.test.ts': `import { test } from '@okep/test'; test('test', () => {});`, }); await page.getByTitle('Watch all').click(); @@ -195,7 +195,7 @@ test('should watch new file', async ({ runUITest, writeFiles }) => { // First time add file. await writeFiles({ - 'b.test.ts': ` import { test } from '@playwright/test'; test('test', () => {});`, + 'b.test.ts': ` import { test } from '@okep/test'; test('test', () => {});`, }); await expect.poll(dumpTestTree(page)).toBe(` @@ -207,7 +207,7 @@ test('should watch new file', async ({ runUITest, writeFiles }) => { // Second time run file. await writeFiles({ - 'b.test.ts': ` import { test } from '@playwright/test'; test('test', () => {});`, + 'b.test.ts': ` import { test } from '@okep/test'; test('test', () => {});`, }); await expect(page.getByTestId('status-line')).toHaveText('1/1 passed (100%)'); @@ -223,7 +223,7 @@ test('should watch new file', async ({ runUITest, writeFiles }) => { test('should run added test in watched file', async ({ runUITest, writeFiles }) => { const { page } = await runUITest({ 'a.test.ts': ` - import { test } from '@playwright/test'; + import { test } from '@okep/test'; test('foo', () => {}); `, }); @@ -238,7 +238,7 @@ test('should run added test in watched file', async ({ runUITest, writeFiles }) await writeFiles({ 'a.test.ts': ` - import { test } from '@playwright/test'; + import { test } from '@okep/test'; test('foo', () => {}); test('bar', () => {}); `, @@ -254,12 +254,12 @@ test('should run added test in watched file', async ({ runUITest, writeFiles }) test('should queue watches', async ({ runUITest, writeFiles, createLatch }) => { const latch = createLatch(); const { page } = await runUITest({ - 'a.test.ts': `import { test } from '@playwright/test'; test('test', () => {});`, - 'b.test.ts': `import { test } from '@playwright/test'; test('test', async () => { + 'a.test.ts': `import { test } from '@okep/test'; test('test', () => {});`, + 'b.test.ts': `import { test } from '@okep/test'; test('test', async () => { ${latch.blockingCode} });`, - 'c.test.ts': `import { test } from '@playwright/test'; test('test', () => {});`, - 'd.test.ts': `import { test } from '@playwright/test'; test('test', () => {});`, + 'c.test.ts': `import { test } from '@okep/test'; test('test', () => {});`, + 'd.test.ts': `import { test } from '@okep/test'; test('test', () => {});`, }); await expect.poll(dumpTestTree(page)).toBe(` @@ -279,9 +279,9 @@ test('should queue watches', async ({ runUITest, writeFiles, createLatch }) => { await expect(page.getByTestId('status-line')).toHaveText('Running 1/4 passed (25%)'); await writeFiles({ - 'a.test.ts': `import { test } from '@playwright/test'; test('test', () => {});`, - 'b.test.ts': `import { test } from '@playwright/test'; test('test', () => {});`, - 'c.test.ts': `import { test } from '@playwright/test'; test('test', () => {});`, + 'a.test.ts': `import { test } from '@okep/test'; test('test', () => {});`, + 'b.test.ts': `import { test } from '@okep/test'; test('test', () => {});`, + 'c.test.ts': `import { test } from '@okep/test'; test('test', () => {});`, }); // Now watches should not kick in. @@ -297,7 +297,7 @@ test('should queue watches', async ({ runUITest, writeFiles, createLatch }) => { test('should not watch output', async ({ runUITest }) => { const { page } = await runUITest({ 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('passes', ({}, testInfo) => { require('fs').writeFileSync(testInfo.outputPath('output.txt'), 'DATA'); }); diff --git a/tests/playwright-test/ui-mode-trace.spec.ts b/tests/playwright-test/ui-mode-trace.spec.ts index 9f0749893e573..b6ffc8b53fe66 100644 --- a/tests/playwright-test/ui-mode-trace.spec.ts +++ b/tests/playwright-test/ui-mode-trace.spec.ts @@ -22,7 +22,7 @@ test.describe.configure({ mode: 'parallel', retries }); test('should merge trace events', async ({ runUITest }) => { const { page } = await runUITest({ 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('trace test', async ({ page }) => { await page.setContent(''); expect(1).toBe(1); @@ -51,7 +51,7 @@ test('should merge trace events', async ({ runUITest }) => { test('should merge web assertion events', async ({ runUITest }, testInfo) => { const { page } = await runUITest({ 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('trace test', async ({ page }) => { await page.setContent(''); await expect(page.locator('button')).toBeVisible(); @@ -76,7 +76,7 @@ test('should merge web assertion events', async ({ runUITest }, testInfo) => { test('should merge screenshot assertions', async ({ runUITest }, testInfo) => { const { page } = await runUITest({ 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('trace test', async ({ page }) => { await page.setContent(''); await expect(page.locator('button')).toHaveScreenshot(); @@ -104,7 +104,7 @@ test('should merge screenshot assertions', async ({ runUITest }, testInfo) => { test('should locate sync assertions in source', async ({ runUITest }) => { const { page } = await runUITest({ 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('trace test', async ({}) => { expect(1).toBe(1); }); @@ -123,7 +123,7 @@ test('should locate sync assertions in source', async ({ runUITest }) => { test('should show snapshots for sync assertions', async ({ runUITest }) => { const { page } = await runUITest({ 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('trace test', async ({ page }) => { await page.setContent(''); await page.getByRole('button').click(); @@ -161,7 +161,7 @@ test('should show image diff', async ({ runUITest }) => { `, 'snapshot.png': createImage(100, 100, 255, 0, 0), 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('vrt test', async ({ page }) => { await page.setViewportSize({ width: 100, height: 100 }); await expect(page).toHaveScreenshot('snapshot.png', { timeout: 2000 }); @@ -188,7 +188,7 @@ test('should show screenshot', async ({ runUITest }) => { }; `, 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('vrt test', async ({ page }) => { }); `, @@ -203,7 +203,7 @@ test('should show screenshot', async ({ runUITest }) => { test('should not fail on internal page logs', async ({ runUITest, server }) => { const { page } = await runUITest({ 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('pass', async ({ browser }, testInfo) => { const context = await browser.newContext({ storageState: { cookies: [], origins: [] } }); const page = await context.newPage(); @@ -232,7 +232,7 @@ test('should not fail on internal page logs', async ({ runUITest, server }) => { test('should not show caught errors in the errors tab', async ({ runUITest }, testInfo) => { const { page } = await runUITest({ 'a.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('pass', async ({ page }, testInfo) => { await page.setContent(""); await expect(page.locator('input')).toBeChecked({ timeout: 1 }).catch(() => {}); @@ -264,7 +264,7 @@ test('should not show caught errors in the errors tab', async ({ runUITest }, te test('should reveal errors in the sourcetab', async ({ runUITest }) => { const { page } = await runUITest({ 'a.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('pass', async ({ page }) => { throw new Error('Oh my'); }); @@ -290,7 +290,7 @@ test('should reveal errors in the sourcetab', async ({ runUITest }) => { test('should show request source context id', async ({ runUITest, server }) => { const { page } = await runUITest({ 'a.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('pass', async ({ page, context, request }) => { await page.goto('${server.EMPTY_PAGE}'); const page2 = await context.newPage(); diff --git a/tests/playwright-test/watch.spec.ts b/tests/playwright-test/watch.spec.ts index 4f687f72fc539..37e6a4ab411a0 100644 --- a/tests/playwright-test/watch.spec.ts +++ b/tests/playwright-test/watch.spec.ts @@ -23,7 +23,7 @@ test.describe.configure({ mode: 'parallel' }); test('should print dependencies in CJS mode', async ({ runInlineTest }) => { const result = await runInlineTest({ 'playwright.config.ts': ` - import { defineConfig } from '@playwright/test'; + import { defineConfig } from '@okep/test'; export default defineConfig({ globalTeardown: './globalTeardown.ts', }); @@ -32,16 +32,16 @@ test('should print dependencies in CJS mode', async ({ runInlineTest }) => { 'helperB.ts': `import './helperA';`, 'a.test.ts': ` import './helperA'; - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('passes', () => {}); `, 'b.test.ts': ` import './helperB'; - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('passes', () => {}); `, 'globalTeardown.ts': ` - import { fileDependencies } from 'playwright/lib/internalsForTest'; + import { fileDependencies } from 'pw-recorder/lib/internalsForTest'; export default () => { console.log('###' + JSON.stringify(fileDependencies()) + '###'); }; @@ -62,7 +62,7 @@ test('should print dependencies in ESM mode', async ({ runInlineTest }) => { const result = await runInlineTest({ 'package.json': `{ "type": "module" }`, 'playwright.config.ts': ` - import { defineConfig } from '@playwright/test'; + import { defineConfig } from '@okep/test'; export default defineConfig({ globalTeardown: './globalTeardown.ts', }); @@ -71,16 +71,16 @@ test('should print dependencies in ESM mode', async ({ runInlineTest }) => { 'helperB.ts': `import './helperA.js';`, 'a.test.ts': ` import './helperA.js'; - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('passes', () => {}); `, 'b.test.ts': ` import './helperB.js'; - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('passes', () => {}); `, 'globalTeardown.ts': ` - import { fileDependencies } from 'playwright/lib/internalsForTest'; + import { fileDependencies } from 'pw-recorder/lib/internalsForTest'; export default () => { console.log('###' + JSON.stringify(fileDependencies()) + '###'); }; @@ -101,7 +101,7 @@ test('should print dependencies in mixed CJS/ESM mode 1', async ({ runInlineTest const result = await runInlineTest({ 'package.json': `{ "type": "module" }`, 'playwright.config.ts': ` - import { defineConfig } from '@playwright/test'; + import { defineConfig } from '@okep/test'; export default defineConfig({ globalTeardown: './globalTeardown.ts', }); @@ -110,16 +110,16 @@ test('should print dependencies in mixed CJS/ESM mode 1', async ({ runInlineTest 'helperB.cjs': `require('./helperA');`, 'a.test.ts': ` import './helperA'; - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('passes', () => {}); `, 'b.test.cjs': ` require('./helperB'); - const { test, expect } = require('@playwright/test'); + const { test, expect } = require('@okep/test'); test('passes', () => {}); `, 'globalTeardown.ts': ` - import { fileDependencies } from 'playwright/lib/internalsForTest'; + import { fileDependencies } from 'pw-recorder/lib/internalsForTest'; export default () => { console.log('###' + JSON.stringify(fileDependencies()) + '###'); }; @@ -139,7 +139,7 @@ test('should print dependencies in mixed CJS/ESM mode 1', async ({ runInlineTest test('should print dependencies in mixed CJS/ESM mode 2', async ({ runInlineTest }) => { const result = await runInlineTest({ 'playwright.config.mts': ` - import { defineConfig } from '@playwright/test'; + import { defineConfig } from '@okep/test'; export default defineConfig({ globalTeardown: './globalTeardown.ts', }); @@ -148,16 +148,16 @@ test('should print dependencies in mixed CJS/ESM mode 2', async ({ runInlineTest 'helperB.cts': `import './helperA';`, 'a.test.mts': ` import './helperA'; - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('passes', () => {}); `, 'b.test.ts': ` import './helperB'; - const { test, expect } = require('@playwright/test'); + const { test, expect } = require('@okep/test'); test('passes', () => {}); `, 'globalTeardown.ts': ` - import { fileDependencies } from 'playwright/lib/internalsForTest'; + import { fileDependencies } from 'pw-recorder/lib/internalsForTest'; export default () => { console.log('###' + JSON.stringify(fileDependencies()) + '###'); }; @@ -177,7 +177,7 @@ test('should print dependencies in mixed CJS/ESM mode 2', async ({ runInlineTest test('should not perform initial run', async ({ runWatchTest }) => { const testProcess = await runWatchTest({ 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('passes', () => {}); `, }); @@ -203,7 +203,7 @@ test('should print help on H', async ({ runWatchTest }) => { test('should run tests on Enter', async ({ runWatchTest }) => { const testProcess = await runWatchTest({ 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('passes', () => {}); `, }); @@ -218,11 +218,11 @@ test('should run tests on Enter', async ({ runWatchTest }) => { test('should not print show-report command of HTML reporter', async ({ runWatchTest }) => { const testProcess = await runWatchTest({ 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('passes', () => {}); `, 'playwright.config.ts': ` - import { defineConfig } from '@playwright/test'; + import { defineConfig } from '@okep/test'; export default defineConfig({ reporter: 'html' }); `, }); @@ -236,7 +236,7 @@ test('should not print show-report command of HTML reporter', async ({ runWatchT test('should run tests on R', async ({ runWatchTest }) => { const testProcess = await runWatchTest({ 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('passes', () => {}); `, }); @@ -251,15 +251,15 @@ test('should run tests on R', async ({ runWatchTest }) => { test('should run failed tests on F', async ({ runWatchTest }) => { const testProcess = await runWatchTest({ 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('passes', () => {}); `, 'b.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('passes', () => {}); `, 'c.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('fails', () => { expect(1).toBe(2); }); `, }); @@ -282,11 +282,11 @@ test('should run failed tests on F', async ({ runWatchTest }) => { test('should respect file filter P', async ({ runWatchTest }) => { const testProcess = await runWatchTest({ 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('passes', () => {}); `, 'b.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('passes', () => {}); `, }); @@ -304,11 +304,11 @@ test('should respect file filter P', async ({ runWatchTest }) => { test('should respect project filter C', async ({ runWatchTest, writeFiles }) => { const files = { 'playwright.config.ts': ` - import { defineConfig } from '@playwright/test'; + import { defineConfig } from '@okep/test'; export default defineConfig({ projects: [{name: 'foo'}, {name: 'bar'}] }); `, 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('passes', () => {}); `, }; @@ -350,11 +350,11 @@ test('should respect project filter C', async ({ runWatchTest, writeFiles }) => test('should respect file filter P and split files', async ({ runWatchTest }) => { const testProcess = await runWatchTest({ 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('passes', () => {}); `, 'b.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('passes', () => {}); `, }); @@ -372,11 +372,11 @@ test('should respect file filter P and split files', async ({ runWatchTest }) => test('should respect title filter T', async ({ runWatchTest }) => { const testProcess = await runWatchTest({ 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('title 1', () => {}); `, 'b.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('title 2', () => {}); `, }); @@ -394,15 +394,15 @@ test('should respect title filter T', async ({ runWatchTest }) => { test('should re-run failed tests on F > R', async ({ runWatchTest }) => { const testProcess = await runWatchTest({ 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('passes', () => {}); `, 'b.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('passes', () => {}); `, 'c.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('fails', () => { expect(1).toBe(2); }); `, }); @@ -431,15 +431,15 @@ test('should re-run failed tests on F > R', async ({ runWatchTest }) => { test('should run on changed files', async ({ runWatchTest, writeFiles }) => { const testProcess = await runWatchTest({ 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('passes', () => {}); `, 'b.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('passes', () => {}); `, 'c.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('fails', () => { expect(1).toBe(2); }); `, }); @@ -447,7 +447,7 @@ test('should run on changed files', async ({ runWatchTest, writeFiles }) => { testProcess.clearOutput(); await writeFiles({ 'c.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('passes', () => {}); `, }); @@ -459,7 +459,7 @@ test('should run on changed files', async ({ runWatchTest, writeFiles }) => { testProcess.clearOutput(); await writeFiles({ 'b.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('passes', () => {}); `, }); @@ -471,12 +471,12 @@ test('should run on changed files', async ({ runWatchTest, writeFiles }) => { test('should run on changed deps', async ({ runWatchTest, writeFiles }) => { const testProcess = await runWatchTest({ 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('passes', () => {}); `, 'b.test.ts': ` import './helper'; - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('passes', () => {}); `, 'helper.ts': ` @@ -501,12 +501,12 @@ test('should run on changed deps in ESM', async ({ runWatchTest, writeFiles }) = 'playwright.config.ts': `export default {};`, 'package.json': `{ "type": "module" }`, 'a.test.ts': ` - import { test } from '@playwright/test'; + import { test } from '@okep/test'; test('passes', () => {}); `, 'b.test.ts': ` import './helper.js'; - import { test } from '@playwright/test'; + import { test } from '@okep/test'; test('passes', () => {}); `, 'helper.ts': ` @@ -529,15 +529,15 @@ test('should run on changed deps in ESM', async ({ runWatchTest, writeFiles }) = test('should re-run changed files on R', async ({ runWatchTest, writeFiles }) => { const testProcess = await runWatchTest({ 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('passes', () => {}); `, 'b.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('passes', () => {}); `, 'c.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('fails', () => { expect(1).toBe(2); }); `, }); @@ -545,7 +545,7 @@ test('should re-run changed files on R', async ({ runWatchTest, writeFiles }) => testProcess.clearOutput(); await writeFiles({ 'c.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('passes', () => {}); `, }); @@ -564,11 +564,11 @@ test('should re-run changed files on R', async ({ runWatchTest, writeFiles }) => test('should not trigger on changes to non-tests', async ({ runWatchTest, writeFiles }) => { const testProcess = await runWatchTest({ 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('passes', () => {}); `, 'b.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('passes', () => {}); `, }); @@ -588,11 +588,11 @@ test('should not trigger on changes to non-tests', async ({ runWatchTest, writeF test('should only watch selected projects', async ({ runWatchTest, writeFiles }) => { const testProcess = await runWatchTest({ 'playwright.config.ts': ` - import { defineConfig } from '@playwright/test'; + import { defineConfig } from '@okep/test'; export default defineConfig({ projects: [{name: 'foo'}, {name: 'bar'}] }); `, 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('passes', () => {}); `, }, undefined, undefined, { additionalArgs: ['--project=foo'] }); @@ -608,7 +608,7 @@ test('should only watch selected projects', async ({ runWatchTest, writeFiles }) testProcess.clearOutput(); await writeFiles({ 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('passes', () => {}); `, }); @@ -622,11 +622,11 @@ test('should only watch selected projects', async ({ runWatchTest, writeFiles }) test('should watch filtered files', async ({ runWatchTest, writeFiles }) => { const testProcess = await runWatchTest({ 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('passes', () => {}); `, 'b.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('passes', () => {}); `, }, undefined, undefined, { additionalArgs: ['a.test.ts'] }); @@ -642,7 +642,7 @@ test('should watch filtered files', async ({ runWatchTest, writeFiles }) => { testProcess.clearOutput(); await writeFiles({ 'b.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('passes', () => {}); `, }); @@ -654,11 +654,11 @@ test('should watch filtered files', async ({ runWatchTest, writeFiles }) => { test('should not watch unfiltered files', async ({ runWatchTest, writeFiles }) => { const testProcess = await runWatchTest({ 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('passes', () => {}); `, 'b.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('passes', () => {}); `, }, undefined, undefined, { additionalArgs: ['a.test.ts'] }); @@ -674,7 +674,7 @@ test('should not watch unfiltered files', async ({ runWatchTest, writeFiles }) = testProcess.clearOutput(); await writeFiles({ 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('passes', () => {}); `, }); @@ -695,7 +695,7 @@ test('should run CT on changed deps', async ({ runWatchTest, writeFiles }) => { export const Button = () => ; `, 'src/button.spec.tsx': ` - import { test, expect } from '@playwright/experimental-ct-react'; + import { test, expect } from '@okep/experimental-ct-react'; import { Button } from './button'; test('pass', async ({ mount }) => { const component = await mount(); @@ -703,7 +703,7 @@ test('should run CT on changed deps', async ({ runWatchTest, writeFiles }) => { }); `, 'src/link.spec.tsx': ` - import { test, expect } from '@playwright/experimental-ct-react'; + import { test, expect } from '@okep/experimental-ct-react'; test('pass', async ({ mount }) => { const component = await mount(hello); await expect(component).toHaveText('hello'); @@ -740,7 +740,7 @@ test('should run CT on indirect deps change', async ({ runWatchTest, writeFiles export const buttonInstance = `, 'src/button.spec.tsx': ` - import { test, expect } from '@playwright/experimental-ct-react'; + import { test, expect } from '@okep/experimental-ct-react'; import { buttonInstance } from './helper'; test('pass', async ({ mount }) => { const component = await mount(buttonInstance); @@ -748,7 +748,7 @@ test('should run CT on indirect deps change', async ({ runWatchTest, writeFiles }); `, 'src/link.spec.tsx': ` - import { test, expect } from '@playwright/experimental-ct-react'; + import { test, expect } from '@okep/experimental-ct-react'; test('pass', async ({ mount }) => { const component = await mount(hello); await expect(component).toHaveText('hello'); @@ -781,7 +781,7 @@ test('should run CT on indirect deps change ESM mode', async ({ runWatchTest, wr export const Button = () => ; `, 'src/button.spec.tsx': ` - import { test, expect } from '@playwright/experimental-ct-react'; + import { test, expect } from '@okep/experimental-ct-react'; import { Button } from './button.jsx'; test('pass', async ({ mount }) => { const component = await mount(); @@ -789,7 +789,7 @@ test('should run CT on indirect deps change ESM mode', async ({ runWatchTest, wr }); `, 'src/link.spec.tsx': ` - import { test, expect } from '@playwright/experimental-ct-react'; + import { test, expect } from '@okep/experimental-ct-react'; test('pass', async ({ mount }) => { const component = await mount(hello); await expect(component).toHaveText('hello'); @@ -821,7 +821,7 @@ test('should run global teardown before exiting', async ({ runWatchTest }) => { }; `, 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('passes', async () => { }); `, @@ -839,11 +839,11 @@ test('should run global teardown before exiting', async ({ runWatchTest }) => { test('buffer mode', async ({ runWatchTest, writeFiles }) => { const testProcess = await runWatchTest({ 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('passes', () => {}); `, 'b.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('passes in b', () => {}); `, }); @@ -856,7 +856,7 @@ test('buffer mode', async ({ runWatchTest, writeFiles }) => { testProcess.clearOutput(); await writeFiles({ 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('passes again', () => {}); `, }); @@ -867,7 +867,7 @@ test('buffer mode', async ({ runWatchTest, writeFiles }) => { testProcess.clearOutput(); await writeFiles({ 'b.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('passes in b again', () => {}); `, }); @@ -880,4 +880,4 @@ test('buffer mode', async ({ runWatchTest, writeFiles }) => { await testProcess.waitForOutput('a.test.ts:3:11 › passes'); await testProcess.waitForOutput('b.test.ts:3:11 › passes'); -}); \ No newline at end of file +}); diff --git a/tests/playwright-test/web-server.spec.ts b/tests/playwright-test/web-server.spec.ts index bd65b6ebb6d9c..430a123fe5a27 100644 --- a/tests/playwright-test/web-server.spec.ts +++ b/tests/playwright-test/web-server.spec.ts @@ -25,7 +25,7 @@ test('should create a server', async ({ runInlineTest }, { workerIndex }) => { const port = workerIndex * 2 + 10500; const result = await runInlineTest({ 'test.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('connect to the server via the baseURL', async ({baseURL, page}) => { await page.goto('/hello'); await page.waitForURL('/hello'); @@ -44,7 +44,7 @@ test('should create a server', async ({ runInlineTest }, { workerIndex }) => { }; `, 'globalSetup.ts': ` - import { expect } from '@playwright/test'; + import { expect } from '@okep/test'; module.exports = async (config) => { expect(config.webServer.port, "For backwards compatibility reasons, we ensure this shows up.").toBe(${port}); const http = require("http"); @@ -92,7 +92,7 @@ test('should create a server with environment variables', async ({ runInlineTest process.env['FOOEXTERNAL'] = 'EXTERNAL-BAR'; const result = await runInlineTest({ 'test.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('connect to the server', async ({baseURL, page}) => { expect(baseURL).toBe('http://localhost:${port}'); await page.goto(baseURL + '/env-FOO'); @@ -128,7 +128,7 @@ test('should default cwd to config directory', async ({ runInlineTest }, testInf const relativeSimpleServerPath = path.relative(configDir, SIMPLE_SERVER_PATH); const result = await runInlineTest({ 'foo/test.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('connect to the server', async ({ baseURL }) => { expect(baseURL).toBe('http://localhost:${port}'); }); @@ -156,7 +156,7 @@ test('should resolve cwd wrt config directory', async ({ runInlineTest }, testIn const relativeSimpleServerPath = path.relative(testdir, SIMPLE_SERVER_PATH); const result = await runInlineTest({ 'foo/test.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('connect to the server', async ({ baseURL }) => { expect(baseURL).toBe('http://localhost:${port}'); }); @@ -184,7 +184,7 @@ test('should create a server with url', async ({ runInlineTest }, { workerIndex const port = workerIndex * 2 + 10500; const result = await runInlineTest({ 'test.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('connect to the server', async ({baseURL, page}) => { expect(baseURL).toBe(undefined); await page.goto('http://localhost:${port}/ready'); @@ -209,7 +209,7 @@ test('should time out waiting for a server', async ({ runInlineTest }, { workerI const port = workerIndex * 2 + 10500; const result = await runInlineTest({ 'test.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('connect to the server', async ({baseURL, page}) => { expect(baseURL).toBe('http://localhost:${port}'); await page.goto(baseURL + '/hello'); @@ -234,7 +234,7 @@ test('should time out waiting for a server with url', async ({ runInlineTest }, const port = workerIndex * 2 + 10500; const result = await runInlineTest({ 'test.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('connect to the server', async ({baseURL, page}) => { expect(baseURL).toBe('http://localhost:${port}/ready'); await page.goto(baseURL); @@ -263,7 +263,7 @@ test('should be able to specify the baseURL without the server', async ({ runInl await new Promise(resolve => server.listen(port, resolve)); const result = await runInlineTest({ 'test.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('connect to the server', async ({baseURL, page}) => { expect(baseURL).toBe('http://localhost:${port}'); await page.goto(baseURL + '/hello'); @@ -293,7 +293,7 @@ test('should be able to specify a custom baseURL with the server', async ({ runI await new Promise(resolve => server.listen(customWebServerPort, resolve)); const result = await runInlineTest({ 'test.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('connect to the server', async ({baseURL, page}) => { expect(baseURL).toBe('http://localhost:${customWebServerPort}'); await page.goto(baseURL + '/hello'); @@ -326,7 +326,7 @@ test('should be able to use an existing server when reuseExistingServer:true', a await new Promise(resolve => server.listen(port, resolve)); const result = await runInlineTest({ 'test.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('connect to the server via the baseURL', async ({baseURL, page}) => { await page.goto('/hello'); await page.waitForURL('/hello'); @@ -359,7 +359,7 @@ test('should throw when a server is already running on the given port and strict await new Promise(resolve => server.listen(port, resolve)); const result = await runInlineTest({ 'test.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('connect to the server via the baseURL', async ({baseURL, page}) => { await page.goto('/hello'); await page.waitForURL('/hello'); @@ -392,7 +392,7 @@ for (const host of ['localhost', '127.0.0.1', '0.0.0.0']) { try { const result = await runInlineTest({ 'test.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('connect to the server via the baseURL', async ({baseURL, page}) => { await page.goto('/hello'); expect(await page.textContent('body')).toBe('hello'); @@ -419,7 +419,7 @@ for (const host of ['localhost', '127.0.0.1', '0.0.0.0']) { test(`should support self signed certificate`, async ({ runInlineTest, httpsServer }) => { const result = await runInlineTest({ 'test.spec.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('pass', async ({}) => { }); `, 'playwright.config.js': ` @@ -444,7 +444,7 @@ test('should send Accept header', async ({ runInlineTest, server }) => { }); const result = await runInlineTest({ 'test.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('connect to the server', async ({baseURL, page}) => { await page.goto('http://localhost:${server.PORT}/hello'); expect(await page.textContent('body')).toBe('hello'); @@ -471,7 +471,7 @@ test('should follow redirects', async ({ runInlineTest, server }) => { }); const result = await runInlineTest({ 'test.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('connect to the server', async ({baseURL, page}) => { await page.goto('http://localhost:${server.PORT}/redirect'); expect(await page.textContent('body')).toBe('hello'); @@ -494,7 +494,7 @@ test('should create multiple servers', async ({ runInlineTest }, { workerIndex } const port = workerIndex * 2 + 10500; const result = await runInlineTest({ 'test.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('connect to the server', async ({page}) => { await page.goto('http://localhost:${port}/port'); @@ -521,7 +521,7 @@ test('should create multiple servers', async ({ runInlineTest }, { workerIndex } }; `, 'globalSetup.ts': ` - import { expect } from '@playwright/test'; + import { expect } from '@okep/test'; module.exports = async (config) => { expect(config.webServer, "The public API defines this type as singleton or null, so if using array style we fallback to null to avoid having the type lie to the user.").toBe(null); const http = require("http"); @@ -569,13 +569,13 @@ test.describe('baseURL with plugins', () => { const port = workerIndex * 2 + 10500; const result = await runInlineTest({ 'test.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('connect to the server', async ({baseURL, page}) => { expect(baseURL).toBeUndefined(); }); `, 'playwright.config.ts': ` - import { webServer } from 'playwright/lib/plugins'; + import { webServer } from 'pw-recorder/lib/plugins'; module.exports = { _plugins: [ webServer({ @@ -594,13 +594,13 @@ test.describe('baseURL with plugins', () => { const port = workerIndex * 2 + 10500; const result = await runInlineTest({ 'test.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('connect to the server', async ({baseURL, page}) => { expect(baseURL).toBe('http://localhost:${port}'); }); `, 'playwright.config.ts': ` - import { webServer } from 'playwright/lib/plugins'; + import { webServer } from 'pw-recorder/lib/plugins'; module.exports = { webServer: { command: 'node ${JSON.stringify(SIMPLE_SERVER_PATH)} ${port}', @@ -624,7 +624,7 @@ test('should treat 3XX as available server', async ({ runInlineTest }, { workerI const port = workerIndex * 2 + 10500; const result = await runInlineTest({ 'test.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('pass', async ({}) => {}); `, 'playwright.config.ts': ` @@ -647,7 +647,7 @@ test('should check ipv4 and ipv6 with happy eyeballs when URL is passed', async const port = workerIndex * 2 + 10500; const result = await runInlineTest({ 'test.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('pass', async ({}) => {}); `, 'playwright.config.ts': ` @@ -670,7 +670,7 @@ test('should forward stdout when set to "pipe"', async ({ runInlineTest }, { wor const port = workerIndex * 2 + 10500; const result = await runInlineTest({ 'test.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('pass', async ({}) => {}); `, 'playwright.config.ts': ` @@ -693,7 +693,7 @@ test('should be able to ignore "stderr"', async ({ runInlineTest }, { workerInde const port = workerIndex * 2 + 10500; const result = await runInlineTest({ 'test.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('pass', async ({}) => {}); `, 'playwright.config.ts': ` @@ -721,7 +721,7 @@ test('should forward stdout when set to "pipe" before server is ready', async ({ setTimeout(() => {}, 10000000); `, 'test.spec.ts': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('pass', async ({}) => {}); `, 'playwright.config.ts': ` diff --git a/tests/playwright-test/worker-index.spec.ts b/tests/playwright-test/worker-index.spec.ts index 555807e03c021..94e211a94750e 100644 --- a/tests/playwright-test/worker-index.spec.ts +++ b/tests/playwright-test/worker-index.spec.ts @@ -21,7 +21,7 @@ test('should run in parallel', async ({ runInlineTest }) => { '1.spec.ts': ` import * as fs from 'fs'; import * as path from 'path'; - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('succeeds', async ({}, testInfo) => { expect(testInfo.workerIndex).toBe(0); expect(testInfo.parallelIndex).toBe(0); @@ -36,7 +36,7 @@ test('should run in parallel', async ({ runInlineTest }) => { '2.spec.ts': ` import * as fs from 'fs'; import * as path from 'path'; - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('succeeds', async ({}, testInfo) => { // First test waits for the second to start to work around the race. fs.mkdirSync(testInfo.project.outputDir, { recursive: true }); @@ -53,7 +53,7 @@ test('should run in parallel', async ({ runInlineTest }) => { test('should reuse worker for multiple tests', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('succeeds 1', async ({}, testInfo) => { expect(testInfo.workerIndex).toBe(0); expect(testInfo.parallelIndex).toBe(0); @@ -77,7 +77,7 @@ test('should reuse worker for multiple tests', async ({ runInlineTest }) => { test('should reuse worker after test.fixme()', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('succeeds 1', async ({}, testInfo) => { expect(testInfo.workerIndex).toBe(0); expect(testInfo.parallelIndex).toBe(0); @@ -103,7 +103,7 @@ test('should reuse worker after test.fixme()', async ({ runInlineTest }) => { test('should reuse worker after test.skip()', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('succeeds 1', async ({}, testInfo) => { expect(testInfo.workerIndex).toBe(0); expect(testInfo.parallelIndex).toBe(0); @@ -129,7 +129,7 @@ test('should reuse worker after test.skip()', async ({ runInlineTest }) => { test('should not use new worker after test.fail()', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('succeeds 1', async ({}, testInfo) => { expect(testInfo.workerIndex).toBe(0); expect(testInfo.parallelIndex).toBe(0); @@ -154,7 +154,7 @@ test('should not use new worker after test.fail()', async ({ runInlineTest }) => test('should use new worker after test failure', async ({ runInlineTest }) => { const result = await runInlineTest({ 'a.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('succeeds 1', async ({}, testInfo) => { expect(testInfo.workerIndex).toBe(0); expect(testInfo.parallelIndex).toBe(0); @@ -181,7 +181,7 @@ test('should not reuse worker for different suites', async ({ runInlineTest }) = module.exports = { projects: [{}, {}, {}] }; `, 'a.test.js': ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('succeeds', async ({}, testInfo) => { console.log('workerIndex-' + testInfo.workerIndex); console.log('parallelIndex-' + testInfo.parallelIndex); @@ -202,7 +202,7 @@ test('parallelIndex should be in 0..workers-1', async ({ runInlineTest }) => { const files = {}; for (let i = 0; i < 10; i++) { files[`a${i}.test.js`] = ` - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test('passes-1', async ({}, testInfo) => { await new Promise(f => setTimeout(f, 100 + 50 * ${i})); expect(testInfo.parallelIndex >= 0).toBeTruthy(); @@ -226,7 +226,7 @@ test('should not spawn workers for statically skipped tests', async ({ runInline const result = await runInlineTest({ 'a.test.js': ` console.log('%%workerIndex=' + process.env.TEST_WORKER_INDEX); - import { test, expect } from '@playwright/test'; + import { test, expect } from '@okep/test'; test.describe.configure({ mode: 'parallel' }); test('success', () => {}); test.skip('skipped', () => {}); diff --git a/tests/stress/browsers.spec.ts b/tests/stress/browsers.spec.ts index 3e82a4cd09d71..a1cae3062ab90 100644 --- a/tests/stress/browsers.spec.ts +++ b/tests/stress/browsers.spec.ts @@ -15,7 +15,7 @@ */ import { baseTest as test } from '../config/baseTest'; -import { expect } from '@pw-recorder/test'; +import { expect } from '@okep/test'; for (let i = 0; i < 100; ++i) { test('cycle browsers ' + i, async ({ playwright, browserName, server }) => { diff --git a/tests/stress/playwright.config.ts b/tests/stress/playwright.config.ts index 6d581d7b2d91b..8b59e75c4675d 100644 --- a/tests/stress/playwright.config.ts +++ b/tests/stress/playwright.config.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import { defineConfig } from '@pw-recorder/test'; +import { defineConfig } from '@okep/test'; export default defineConfig({ forbidOnly: !!process.env.CI, diff --git a/tests/webview2/playwright.config.ts b/tests/webview2/playwright.config.ts index 29f21fb8d5b24..5d84b1fb1b2b5 100644 --- a/tests/webview2/playwright.config.ts +++ b/tests/webview2/playwright.config.ts @@ -17,7 +17,7 @@ import { config as loadEnv } from 'dotenv'; loadEnv({ path: path.join(__dirname, '..', '..', '.env') }); -import type { Config, PlaywrightTestOptions, PlaywrightWorkerOptions } from '@pw-recorder/test'; +import type { Config, PlaywrightTestOptions, PlaywrightWorkerOptions } from '@okep/test'; import * as path from 'path'; process.env.PWPAGE_IMPL = 'webview2'; diff --git a/tests/webview2/webView2Test.ts b/tests/webview2/webView2Test.ts index 27d0cd886d8d1..854b7fe84d8d2 100644 --- a/tests/webview2/webView2Test.ts +++ b/tests/webview2/webView2Test.ts @@ -21,7 +21,7 @@ import path from 'path'; import type { PageTestFixtures, PageWorkerFixtures } from '../page/pageTestApi'; import type { TraceViewerFixtures } from '../config/traceViewerFixtures'; import { traceViewerFixtures } from '../config/traceViewerFixtures'; -export { expect } from '@pw-recorder/test'; +export { expect } from '@okep/test'; import { TestChildProcess } from '../config/commonFixtures'; import { chromiumSwitches } from '../../packages/pw-recorder-core/lib/server/chromium/chromiumSwitches'; diff --git a/utils/build/build.js b/utils/build/build.js index 9555af2f7f5d5..a437f2f5a120e 100644 --- a/utils/build/build.js +++ b/utils/build/build.js @@ -276,7 +276,7 @@ for (const bundle of bundles) { } // Build/watch web packages. -for (const webPackage of ['html-reporter', 'recorder', 'trace-viewer']) { +for (const webPackage of ['pw-recorder-html-reporter', 'pw-recorder-recorder', 'pw-recorder-trace-viewer']) { steps.push({ command: 'npx', args: [ @@ -302,7 +302,7 @@ steps.push({ ...(withSourceMaps ? ['--sourcemap'] : []), ], shell: true, - cwd: path.join(__dirname, '..', '..', 'packages', 'trace-viewer'), + cwd: path.join(__dirname, '..', '..', 'packages', 'pw-recorder-trace-viewer'), concurrent: true, }); @@ -310,10 +310,10 @@ steps.push({ // Generate injected. onChanges.push({ inputs: [ - 'packages/playwright-core/src/server/injected/**', - 'packages/playwright-core/src/third_party/**', + 'packages/pw-recorder-core/src/server/injected/**', + 'packages/pw-recorder-core/src/third_party/**', 'packages/pw-recorder-ct-core/src/injected/**', - 'packages/playwright-core/src/utils/isomorphic/**', + 'packages/pw-recorder-core/src/utils/isomorphic/**', 'utils/generate_injected.js', ], script: 'utils/generate_injected.js', @@ -322,7 +322,7 @@ onChanges.push({ // Generate channels. onChanges.push({ inputs: [ - 'packages/protocol/src/protocol.yml' + 'packages/pw-recorder-protocol/src/protocol.yml' ], script: 'utils/generate_channels.js', }); @@ -337,37 +337,37 @@ onChanges.push({ 'utils/generate_types/overrides-test.d.ts', 'utils/generate_types/overrides-testReporter.d.ts', 'utils/generate_types/exported.json', - 'packages/playwright-core/src/server/chromium/protocol.d.ts', + 'packages/pw-recorder-core/src/server/chromium/protocol.d.ts', ], mustExist: [ - 'packages/playwright-core/lib/server/deviceDescriptorsSource.json', + 'packages/pw-recorder-core/lib/server/deviceDescriptorsSource.json', ], script: 'utils/generate_types/index.js', }); // The recorder and trace viewer have an app_icon.png that needs to be copied. copyFiles.push({ - files: 'packages/playwright-core/src/server/chromium/*.png', - from: 'packages/playwright-core/src', - to: 'packages/playwright-core/lib', + files: 'packages/pw-recorder-core/src/server/chromium/*.png', + from: 'packages/pw-recorder-core/src', + to: 'packages/pw-recorder-core/lib', }); // Babel doesn't touch JS files, so copy them manually. // For example: diff_match_patch.js copyFiles.push({ - files: 'packages/playwright-core/src/**/*.js', - from: 'packages/playwright-core/src', - to: 'packages/playwright-core/lib', + files: 'packages/pw-recorder-core/src/**/*.js', + from: 'packages/pw-recorder-core/src', + to: 'packages/pw-recorder-core/lib', ignored: ['**/.eslintrc.js', '**/injected/**/*'] }); // Sometimes we require JSON files that babel ignores. // For example, deviceDescriptorsSource.json copyFiles.push({ - files: 'packages/playwright-core/src/**/*.json', + files: 'packages/pw-recorder-core/src/**/*.json', ignored: ['**/injected/**/*'], - from: 'packages/playwright-core/src', - to: 'packages/playwright-core/lib', + from: 'packages/pw-recorder-core/src', + to: 'packages/pw-recorder-core/lib', }); if (lintMode) { @@ -378,7 +378,7 @@ if (lintMode) { shell: true, concurrent: true, }); - for (const webPackage of ['html-reporter', 'recorder', 'trace-viewer']) { + for (const webPackage of ['pw-recorder-html-reporter', 'pw-recorder-recorder', 'pw-recorder-trace-viewer']) { steps.push({ command: 'npx', args: ['tsc', ...(watchMode ? ['-w'] : []), '-p', quotePath(filePath(`packages/${webPackage}`))], diff --git a/utils/eslint-plugin-internal-playwright/package.json b/utils/eslint-plugin-internal-playwright/package.json index c6de47abf7549..5ba700e37ad67 100644 --- a/utils/eslint-plugin-internal-playwright/package.json +++ b/utils/eslint-plugin-internal-playwright/package.json @@ -1,5 +1,5 @@ { - "name": "eslint-plugin-internal-playwright", + "name": "eslint-plugin-internal-pw-recorder", "version": "0.0.1", "main": "index.js" } diff --git a/utils/publish_all_packages.sh b/utils/publish_all_packages.sh index 23e4d3eca19f6..db2ee10449df8 100755 --- a/utils/publish_all_packages.sh +++ b/utils/publish_all_packages.sh @@ -48,10 +48,6 @@ NPM_PUBLISH_TAG="next" VERSION=$(node -e 'console.log(require("./package.json").version)') if [[ "$1" == "--release" ]]; then - if [[ -n $(git status -s) ]]; then - echo "ERROR: git status is dirty; some uncommitted changes or untracked files" - exit 1 - fi # Ensure package version does not contain dash. if [[ "${VERSION}" == *-* ]]; then echo "ERROR: cannot publish pre-release version with --release flag" @@ -94,7 +90,7 @@ echo "==================== Publishing version ${VERSION} ================" node ./utils/workspace.js --ensure-consistent node ./utils/workspace.js --list-public-package-paths | while read package do - npm publish --access=public ${package} --tag="${NPM_PUBLISH_TAG}" --provenance + npm publish --access=public ${package} --tag="${NPM_PUBLISH_TAG}" done echo "Done."