diff --git a/.github/workflows/pr_check_client_side_changes.yml b/.github/workflows/pr_check_client_side_changes.yml index 57c96a60ad6e5..6f10c9563358f 100644 --- a/.github/workflows/pr_check_client_side_changes.yml +++ b/.github/workflows/pr_check_client_side_changes.yml @@ -5,7 +5,7 @@ on: - main paths: - 'packages/playwright-core/src/client/**/*' - - 'packages/playwright-test/src/matchers/matchers.ts' + - 'packages/playwright/src/matchers/matchers.ts' jobs: check: name: Check diff --git a/.gitignore b/.gitignore index 1866dfff9c029..0978f13e88548 100644 --- a/.gitignore +++ b/.gitignore @@ -25,6 +25,7 @@ test-results /packages/*/LICENSE /packages/*/NOTICE /packages/playwright/README.md +/packages/playwright-test/README.md /packages/playwright-core/api.json .env /tests/installation/output/ diff --git a/docs/src/release-notes-js.md b/docs/src/release-notes-js.md index dc9f5a6cd2a25..b434f08b6b265 100644 --- a/docs/src/release-notes-js.md +++ b/docs/src/release-notes-js.md @@ -15,7 +15,7 @@ import LiteYouTube from '@site/src/components/LiteYouTube'; ### New `npx playwright merge-reports` tool -If you run tests on multiple shards, you can now merge all reports in a single HTML report (or any other report) +If you run tests on multiple shards, you can now merge all reports in a single HTML report (or any other report) using the new `merge-reports` CLI tool. Using `merge-reports` tool requires the following steps: @@ -48,7 +48,7 @@ Let us know if you encounter any issues! Linux support looks like this: | | Ubuntu 20.04 | Ubuntu 22.04 | Debian 11 | Debian 12 | -| :--- | :---: | :---: | :---: | :---: | +| :--- | :---: | :---: | :---: | :---: | | Chromium | ✅ | ✅ | ✅ | ✅ | | WebKit | ✅ | ✅ | ✅ | ✅ | | Firefox | ✅ | ✅ | ✅ | ✅ | diff --git a/package-lock.json b/package-lock.json index d35024dc6aadb..ada75a67dee2b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6300,6 +6300,9 @@ }, "engines": { "node": ">=16" + }, + "optionalDependencies": { + "fsevents": "2.3.2" } }, "packages/playwright-browser-chromium": { @@ -6367,7 +6370,7 @@ "version": "1.38.0-next", "license": "Apache-2.0", "dependencies": { - "@playwright/test": "1.38.0-next", + "playwright": "1.38.0-next", "playwright-core": "1.38.0-next", "vite": "^4.3.9" }, @@ -6589,16 +6592,13 @@ "version": "1.38.0-next", "license": "Apache-2.0", "dependencies": { - "playwright-core": "1.38.0-next" + "playwright": "1.38.0-next" }, "bin": { "playwright": "cli.js" }, "engines": { "node": ">=16" - }, - "optionalDependencies": { - "fsevents": "2.3.2" } }, "packages/playwright-webkit": { @@ -7469,7 +7469,7 @@ "@playwright/experimental-ct-core": { "version": "file:packages/playwright-ct-core", "requires": { - "@playwright/test": "1.38.0-next", + "playwright": "1.38.0-next", "playwright-core": "1.38.0-next", "vite": "^4.3.9" } @@ -7575,8 +7575,7 @@ "@playwright/test": { "version": "file:packages/playwright-test", "requires": { - "fsevents": "2.3.2", - "playwright-core": "1.38.0-next" + "playwright": "1.38.0-next" } }, "@sindresorhus/is": { @@ -9885,6 +9884,7 @@ "playwright": { "version": "file:packages/playwright", "requires": { + "fsevents": "2.3.2", "playwright-core": "1.38.0-next" } }, diff --git a/packages/html-reporter/tsconfig.json b/packages/html-reporter/tsconfig.json index 71abcce23672c..93a8b7cbd090e 100644 --- a/packages/html-reporter/tsconfig.json +++ b/packages/html-reporter/tsconfig.json @@ -19,9 +19,9 @@ "paths": { "@protocol/*": ["../protocol/src/*"], "@web/*": ["../web/src/*"], - "@playwright-test/*": ["../playwright-test/src/*"], + "@playwright/*": ["../playwright/src/*"], "playwright-core/lib/*": ["../playwright-core/src/*"], - "playwright-test/lib/*": ["../playwright-test/src/*"], + "playwright/lib/*": ["../playwright/src/*"], } }, "include": ["src"], diff --git a/packages/playwright-ct-core/cli.js b/packages/playwright-ct-core/cli.js index bff00995d9a77..2d0ff422819d8 100755 --- a/packages/playwright-ct-core/cli.js +++ b/packages/playwright-ct-core/cli.js @@ -14,4 +14,4 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -module.exports = require('@playwright/test/lib/cli'); +module.exports = require('playwright/lib/cli'); diff --git a/packages/playwright-ct-core/index.d.ts b/packages/playwright-ct-core/index.d.ts index 90789c02a799a..397a4cdb7fc7c 100644 --- a/packages/playwright-ct-core/index.d.ts +++ b/packages/playwright-ct-core/index.d.ts @@ -22,7 +22,7 @@ import type { PlaywrightWorkerArgs, PlaywrightWorkerOptions, Locator, -} from '@playwright/test'; +} from 'playwright/test'; import type { JsonObject } from './types/component'; import type { InlineConfig } from 'vite'; @@ -63,4 +63,4 @@ export function defineConfig(config: PlaywrightTestConfig): PlaywrightTestConfig export function defineConfig(config: PlaywrightTestConfig): PlaywrightTestConfig; export function defineConfig(config: PlaywrightTestConfig): PlaywrightTestConfig; -export { expect, devices } from '@playwright/test'; +export { expect, devices } from 'playwright/test'; diff --git a/packages/playwright-ct-core/index.js b/packages/playwright-ct-core/index.js index 3cccb3d65a1d5..c323f1c6ecd4d 100644 --- a/packages/playwright-ct-core/index.js +++ b/packages/playwright-ct-core/index.js @@ -14,7 +14,7 @@ * limitations under the License. */ -const { test: baseTest, expect, devices, defineConfig: originalDefineConfig } = require('@playwright/test'); +const { test: baseTest, expect, devices, defineConfig: originalDefineConfig } = require('playwright/test'); const { fixtures } = require('./lib/mount'); const defineConfig = config => originalDefineConfig({ diff --git a/packages/playwright-ct-core/package.json b/packages/playwright-ct-core/package.json index f4291f79471af..582297df91fa1 100644 --- a/packages/playwright-ct-core/package.json +++ b/packages/playwright-ct-core/package.json @@ -26,7 +26,7 @@ "dependencies": { "playwright-core": "1.38.0-next", "vite": "^4.3.9", - "@playwright/test": "1.38.0-next" + "playwright": "1.38.0-next" }, "bin": { "playwright": "./cli.js" diff --git a/packages/playwright-ct-core/src/mount.ts b/packages/playwright-ct-core/src/mount.ts index a671368104f4e..fc01ab72837a4 100644 --- a/packages/playwright-ct-core/src/mount.ts +++ b/packages/playwright-ct-core/src/mount.ts @@ -14,9 +14,9 @@ * limitations under the License. */ -import type { Fixtures, Locator, Page, BrowserContextOptions, PlaywrightTestArgs, PlaywrightTestOptions, PlaywrightWorkerArgs, PlaywrightWorkerOptions, BrowserContext } from '@playwright/test'; +import type { Fixtures, Locator, Page, BrowserContextOptions, PlaywrightTestArgs, PlaywrightTestOptions, PlaywrightWorkerArgs, PlaywrightWorkerOptions, BrowserContext } from 'playwright/test'; import type { Component, JsxComponent, MountOptions } from '../types/component'; -import type { ContextReuseMode, FullConfigInternal } from '../../playwright-test/src/common/config'; +import type { ContextReuseMode, FullConfigInternal } from '../../playwright/src/common/config'; let boundCallbacksForMount: Function[] = []; diff --git a/packages/playwright-ct-core/src/tsxTransform.ts b/packages/playwright-ct-core/src/tsxTransform.ts index 4d1d95bd67773..f06df3c04d7e0 100644 --- a/packages/playwright-ct-core/src/tsxTransform.ts +++ b/packages/playwright-ct-core/src/tsxTransform.ts @@ -15,9 +15,9 @@ */ import path from 'path'; -import type { T, BabelAPI } from '@playwright/test/src/transform/babelBundle'; -import { types, declare, traverse } from '@playwright/test/lib/transform/babelBundle'; -import { resolveImportSpecifierExtension } from '@playwright/test/lib/util'; +import type { T, BabelAPI } from 'playwright/src/transform/babelBundle'; +import { types, declare, traverse } from 'playwright/lib/transform/babelBundle'; +import { resolveImportSpecifierExtension } from 'playwright/lib/util'; const t: typeof T = types; const fullNames = new Map(); diff --git a/packages/playwright-ct-core/src/vitePlugin.ts b/packages/playwright-ct-core/src/vitePlugin.ts index f714564bd98e2..9705f4bbf5453 100644 --- a/packages/playwright-ct-core/src/vitePlugin.ts +++ b/packages/playwright-ct-core/src/vitePlugin.ts @@ -14,11 +14,11 @@ * limitations under the License. */ -import type { Suite } from '@playwright/test/reporter'; -import type { PlaywrightTestConfig as BasePlaywrightTestConfig, FullConfig } from '@playwright/test'; +import type { Suite } from 'playwright/types/testReporter'; +import type { PlaywrightTestConfig as BasePlaywrightTestConfig, FullConfig } from 'playwright/test'; import type { InlineConfig, Plugin, ResolveFn, ResolvedConfig, UserConfig } from 'vite'; -import type { TestRunnerPlugin } from '../../playwright-test/src/plugins'; +import type { TestRunnerPlugin } from '../../playwright/src/plugins'; import type { ComponentInfo } from './tsxTransform'; import type { AddressInfo } from 'net'; import type { PluginContext } from 'rollup'; @@ -26,11 +26,11 @@ import { debug } from 'playwright-core/lib/utilsBundle'; import fs from 'fs'; import path from 'path'; -import { parse, traverse, types as t } from '@playwright/test/lib/transform/babelBundle'; -import { stoppable } from '@playwright/test/lib/utilsBundle'; +import { parse, traverse, types as t } from 'playwright/lib/transform/babelBundle'; +import { stoppable } from 'playwright/lib/utilsBundle'; import { assert, calculateSha1 } from 'playwright-core/lib/utils'; import { getPlaywrightVersion } from 'playwright-core/lib/utils'; -import { setExternalDependencies } from '@playwright/test/lib/transform/compilationCache'; +import { setExternalDependencies } from 'playwright/lib/transform/compilationCache'; import { collectComponentUsages, componentInfo } from './tsxTransform'; import { version as viteVersion, build, preview, mergeConfig } from 'vite'; diff --git a/packages/playwright-ct-react/index.d.ts b/packages/playwright-ct-react/index.d.ts index e7717c9b68f46..9c8d0a914de6b 100644 --- a/packages/playwright-ct-react/index.d.ts +++ b/packages/playwright-ct-react/index.d.ts @@ -22,7 +22,7 @@ import type { PlaywrightWorkerArgs, PlaywrightWorkerOptions, Locator, -} from '@playwright/test'; +} from 'playwright/test'; import type { JsonObject } from '@playwright/experimental-ct-core/types/component'; import type { InlineConfig } from 'vite'; @@ -63,4 +63,4 @@ export function defineConfig(config: PlaywrightTestConfig): PlaywrightTestConfig export function defineConfig(config: PlaywrightTestConfig): PlaywrightTestConfig; export function defineConfig(config: PlaywrightTestConfig): PlaywrightTestConfig; -export { expect, devices } from '@playwright/test'; +export { expect, devices } from 'playwright/test'; diff --git a/packages/playwright-ct-react17/index.d.ts b/packages/playwright-ct-react17/index.d.ts index e7717c9b68f46..9c8d0a914de6b 100644 --- a/packages/playwright-ct-react17/index.d.ts +++ b/packages/playwright-ct-react17/index.d.ts @@ -22,7 +22,7 @@ import type { PlaywrightWorkerArgs, PlaywrightWorkerOptions, Locator, -} from '@playwright/test'; +} from 'playwright/test'; import type { JsonObject } from '@playwright/experimental-ct-core/types/component'; import type { InlineConfig } from 'vite'; @@ -63,4 +63,4 @@ export function defineConfig(config: PlaywrightTestConfig): PlaywrightTestConfig export function defineConfig(config: PlaywrightTestConfig): PlaywrightTestConfig; export function defineConfig(config: PlaywrightTestConfig): PlaywrightTestConfig; -export { expect, devices } from '@playwright/test'; +export { expect, devices } from 'playwright/test'; diff --git a/packages/playwright-ct-solid/index.d.ts b/packages/playwright-ct-solid/index.d.ts index e7717c9b68f46..9c8d0a914de6b 100644 --- a/packages/playwright-ct-solid/index.d.ts +++ b/packages/playwright-ct-solid/index.d.ts @@ -22,7 +22,7 @@ import type { PlaywrightWorkerArgs, PlaywrightWorkerOptions, Locator, -} from '@playwright/test'; +} from 'playwright/test'; import type { JsonObject } from '@playwright/experimental-ct-core/types/component'; import type { InlineConfig } from 'vite'; @@ -63,4 +63,4 @@ export function defineConfig(config: PlaywrightTestConfig): PlaywrightTestConfig export function defineConfig(config: PlaywrightTestConfig): PlaywrightTestConfig; export function defineConfig(config: PlaywrightTestConfig): PlaywrightTestConfig; -export { expect, devices } from '@playwright/test'; +export { expect, devices } from 'playwright/test'; diff --git a/packages/playwright-ct-svelte/index.d.ts b/packages/playwright-ct-svelte/index.d.ts index 19c5a9d1b24c7..0fd476f7ed146 100644 --- a/packages/playwright-ct-svelte/index.d.ts +++ b/packages/playwright-ct-svelte/index.d.ts @@ -22,7 +22,7 @@ import type { PlaywrightWorkerArgs, PlaywrightWorkerOptions, Locator, -} from '@playwright/test'; +} from 'playwright/test'; import type { JsonObject } from '@playwright/experimental-ct-core/types/component'; import type { InlineConfig } from 'vite'; import type { SvelteComponent, ComponentProps } from 'svelte/types/runtime'; @@ -71,4 +71,4 @@ export function defineConfig(config: PlaywrightTestConfig): PlaywrightTestConfig export function defineConfig(config: PlaywrightTestConfig): PlaywrightTestConfig; export function defineConfig(config: PlaywrightTestConfig): PlaywrightTestConfig; -export { expect, devices } from '@playwright/test'; +export { expect, devices } from 'playwright/test'; diff --git a/packages/playwright-ct-vue/index.d.ts b/packages/playwright-ct-vue/index.d.ts index ebbdd55a283b2..249fe643d7444 100644 --- a/packages/playwright-ct-vue/index.d.ts +++ b/packages/playwright-ct-vue/index.d.ts @@ -22,7 +22,7 @@ import type { PlaywrightWorkerArgs, PlaywrightWorkerOptions, Locator, -} from '@playwright/test'; +} from 'playwright/test'; import type { JsonObject } from '@playwright/experimental-ct-core/types/component'; import type { InlineConfig } from 'vite'; @@ -91,4 +91,4 @@ export function defineConfig(config: PlaywrightTestConfig): PlaywrightTestConfig export function defineConfig(config: PlaywrightTestConfig): PlaywrightTestConfig; export function defineConfig(config: PlaywrightTestConfig): PlaywrightTestConfig; -export { expect, devices } from '@playwright/test'; +export { expect, devices } from 'playwright/test'; diff --git a/packages/playwright-ct-vue2/index.d.ts b/packages/playwright-ct-vue2/index.d.ts index 927fb1aa91cce..9e0a08a02c407 100644 --- a/packages/playwright-ct-vue2/index.d.ts +++ b/packages/playwright-ct-vue2/index.d.ts @@ -22,7 +22,7 @@ import type { PlaywrightWorkerArgs, PlaywrightWorkerOptions, Locator, -} from '@playwright/test'; +} from 'playwright/test'; import type { JsonObject } from '@playwright/experimental-ct-core/types/component'; import type { InlineConfig } from 'vite'; @@ -91,4 +91,4 @@ export function defineConfig(config: PlaywrightTestConfig): PlaywrightTestConfig export function defineConfig(config: PlaywrightTestConfig): PlaywrightTestConfig; export function defineConfig(config: PlaywrightTestConfig): PlaywrightTestConfig; -export { expect, devices } from '@playwright/test'; +export { expect, devices } from 'playwright/test'; diff --git a/packages/playwright-test/README.md b/packages/playwright-test/README.md deleted file mode 100644 index 38e544a679921..0000000000000 --- a/packages/playwright-test/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# @playwright/test - -This package contains [Playwright Test](https://playwright.dev/docs/test-intro). A test-runner for writing idiomatic and reliable end-to-end tests with [Playwright](http://playwright.dev/). diff --git a/packages/playwright-test/cli.js b/packages/playwright-test/cli.js index bff00995d9a77..9d6dee9693417 100755 --- a/packages/playwright-test/cli.js +++ b/packages/playwright-test/cli.js @@ -14,4 +14,4 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -module.exports = require('@playwright/test/lib/cli'); +module.exports = require('playwright/cli'); diff --git a/packages/playwright-test/index.d.ts b/packages/playwright-test/index.d.ts index 4369d23a3c933..8d99c91500c65 100644 --- a/packages/playwright-test/index.d.ts +++ b/packages/playwright-test/index.d.ts @@ -14,5 +14,5 @@ * limitations under the License. */ -export * from './types/test'; -export { default } from './types/test'; +export * from 'playwright/test'; +export { default } from 'playwright/test'; diff --git a/packages/playwright-test/index.js b/packages/playwright-test/index.js index 8ff9824af1a6e..8536f063904ff 100644 --- a/packages/playwright-test/index.js +++ b/packages/playwright-test/index.js @@ -14,15 +14,4 @@ * limitations under the License. */ -const pwt = require('./lib/index'); -const { defineConfig } = require('./lib/common/configLoader'); -const playwright = require('playwright-core'); -const combinedExports = { - ...playwright, - ...pwt, - defineConfig, -}; - -Object.defineProperty(combinedExports, '__esModule', { value: true }); - -module.exports = combinedExports; +module.exports = require('playwright/test'); diff --git a/packages/playwright-test/index.mjs b/packages/playwright-test/index.mjs index 59299a0cb3aa4..8d99c91500c65 100644 --- a/packages/playwright-test/index.mjs +++ b/packages/playwright-test/index.mjs @@ -13,18 +13,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import playwright from './index.js'; -export const chromium = playwright.chromium; -export const firefox = playwright.firefox; -export const webkit = playwright.webkit; -export const selectors = playwright.selectors; -export const devices = playwright.devices; -export const errors = playwright.errors; -export const request = playwright.request; -export const _electron = playwright._electron; -export const _android = playwright._android; -export const test = playwright.test; -export const expect = playwright.expect; -export const defineConfig = playwright.defineConfig; -export default playwright.test; +export * from 'playwright/test'; +export { default } from 'playwright/test'; diff --git a/packages/playwright-test/package.json b/packages/playwright-test/package.json index 1b5dbc7e65e25..f71d2704730de 100644 --- a/packages/playwright-test/package.json +++ b/packages/playwright-test/package.json @@ -7,7 +7,10 @@ "engines": { "node": ">=16" }, - "main": "index.js", + "author": { + "name": "Microsoft Corporation" + }, + "license": "Apache-2.0", "exports": { ".": { "types": "./index.d.ts", @@ -17,32 +20,14 @@ }, "./cli": "./cli.js", "./package.json": "./package.json", - "./lib/cli": "./lib/cli.js", - "./lib/transform/babelBundle": "./lib/transform/babelBundle.js", - "./lib/transform/compilationCache": "./lib/transform/compilationCache.js", - "./lib/transform/esmLoader": "./lib/transform/esmLoader.js", - "./lib/internalsForTest": "./lib/internalsForTest.js", - "./lib/plugins": "./lib/plugins/index.js", - "./jsx-runtime": { - "import": "./jsx-runtime.mjs", - "require": "./jsx-runtime.js", - "default": "./jsx-runtime.js" - }, - "./lib/util": "./lib/util.js", - "./lib/utilsBundle": "./lib/utilsBundle.js", "./reporter": "./reporter.js" }, "bin": { "playwright": "./cli.js" }, - "author": { - "name": "Microsoft Corporation" + "scripts": { }, - "license": "Apache-2.0", "dependencies": { - "playwright-core": "1.38.0-next" - }, - "optionalDependencies": { - "fsevents": "2.3.2" + "playwright": "1.38.0-next" } } diff --git a/packages/playwright-test/reporter.d.ts b/packages/playwright-test/reporter.d.ts index 29a927d48ed1a..806d13fb09e73 100644 --- a/packages/playwright-test/reporter.d.ts +++ b/packages/playwright-test/reporter.d.ts @@ -14,4 +14,4 @@ * limitations under the License. */ -export * from './types/testReporter'; +export * from 'playwright/types/testReporter'; diff --git a/packages/playwright-test/.eslintrc.js b/packages/playwright/.eslintrc.js similarity index 100% rename from packages/playwright-test/.eslintrc.js rename to packages/playwright/.eslintrc.js diff --git a/packages/playwright-test/.npmignore b/packages/playwright/.npmignore similarity index 100% rename from packages/playwright-test/.npmignore rename to packages/playwright/.npmignore diff --git a/packages/playwright-test/ThirdPartyNotices.txt b/packages/playwright/ThirdPartyNotices.txt similarity index 99% rename from packages/playwright-test/ThirdPartyNotices.txt rename to packages/playwright/ThirdPartyNotices.txt index dadc614821b5d..35b04cc3863c7 100644 --- a/packages/playwright-test/ThirdPartyNotices.txt +++ b/packages/playwright/ThirdPartyNotices.txt @@ -1,4 +1,4 @@ -microsoft/playwright-test +microsoft/playwright THIRD-PARTY SOFTWARE NOTICES AND INFORMATION diff --git a/packages/playwright-test/bundles/babel/package-lock.json b/packages/playwright/bundles/babel/package-lock.json similarity index 100% rename from packages/playwright-test/bundles/babel/package-lock.json rename to packages/playwright/bundles/babel/package-lock.json diff --git a/packages/playwright-test/bundles/babel/package.json b/packages/playwright/bundles/babel/package.json similarity index 100% rename from packages/playwright-test/bundles/babel/package.json rename to packages/playwright/bundles/babel/package.json diff --git a/packages/playwright-test/bundles/babel/src/babelBundleImpl.ts b/packages/playwright/bundles/babel/src/babelBundleImpl.ts similarity index 99% rename from packages/playwright-test/bundles/babel/src/babelBundleImpl.ts rename to packages/playwright/bundles/babel/src/babelBundleImpl.ts index 30cf96976523f..e0cc0eaf7d260 100644 --- a/packages/playwright-test/bundles/babel/src/babelBundleImpl.ts +++ b/packages/playwright/bundles/babel/src/babelBundleImpl.ts @@ -65,7 +65,7 @@ function babelTransformOptions(isTypeScript: boolean, isModule: boolean, plugins // Support JSX/TSX at all times, regardless of the file extension. plugins.push([require('@babel/plugin-transform-react-jsx'), { runtime: 'automatic', - importSource: '@playwright/test' + importSource: 'playwright' }]); if (!isModule) { diff --git a/packages/playwright-test/bundles/expect/package-lock.json b/packages/playwright/bundles/expect/package-lock.json similarity index 100% rename from packages/playwright-test/bundles/expect/package-lock.json rename to packages/playwright/bundles/expect/package-lock.json diff --git a/packages/playwright-test/bundles/expect/package.json b/packages/playwright/bundles/expect/package.json similarity index 100% rename from packages/playwright-test/bundles/expect/package.json rename to packages/playwright/bundles/expect/package.json diff --git a/packages/playwright-test/bundles/expect/src/expectBundleImpl.ts b/packages/playwright/bundles/expect/src/expectBundleImpl.ts similarity index 100% rename from packages/playwright-test/bundles/expect/src/expectBundleImpl.ts rename to packages/playwright/bundles/expect/src/expectBundleImpl.ts diff --git a/packages/playwright-test/bundles/utils/build.js b/packages/playwright/bundles/utils/build.js similarity index 100% rename from packages/playwright-test/bundles/utils/build.js rename to packages/playwright/bundles/utils/build.js diff --git a/packages/playwright-test/bundles/utils/package-lock.json b/packages/playwright/bundles/utils/package-lock.json similarity index 100% rename from packages/playwright-test/bundles/utils/package-lock.json rename to packages/playwright/bundles/utils/package-lock.json diff --git a/packages/playwright-test/bundles/utils/package.json b/packages/playwright/bundles/utils/package.json similarity index 100% rename from packages/playwright-test/bundles/utils/package.json rename to packages/playwright/bundles/utils/package.json diff --git a/packages/playwright-test/bundles/utils/src/utilsBundleImpl.ts b/packages/playwright/bundles/utils/src/utilsBundleImpl.ts similarity index 100% rename from packages/playwright-test/bundles/utils/src/utilsBundleImpl.ts rename to packages/playwright/bundles/utils/src/utilsBundleImpl.ts diff --git a/packages/playwright/cli.js b/packages/playwright/cli.js index bd995de11422c..d4eb087af8879 100755 --- a/packages/playwright/cli.js +++ b/packages/playwright/cli.js @@ -14,4 +14,4 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -module.exports = require('playwright-core/lib/cli/cli'); +module.exports = require('./lib/cli'); diff --git a/packages/playwright-test/jsx-runtime.js b/packages/playwright/jsx-runtime.js similarity index 100% rename from packages/playwright-test/jsx-runtime.js rename to packages/playwright/jsx-runtime.js diff --git a/packages/playwright-test/jsx-runtime.mjs b/packages/playwright/jsx-runtime.mjs similarity index 100% rename from packages/playwright-test/jsx-runtime.mjs rename to packages/playwright/jsx-runtime.mjs diff --git a/packages/playwright/package.json b/packages/playwright/package.json index 2b9123043ff69..07468b094dd16 100644 --- a/packages/playwright/package.json +++ b/packages/playwright/package.json @@ -7,10 +7,7 @@ "engines": { "node": ">=16" }, - "author": { - "name": "Microsoft Corporation" - }, - "license": "Apache-2.0", + "main": "index.js", "exports": { ".": { "types": "./index.d.ts", @@ -19,14 +16,44 @@ "default": "./index.js" }, "./cli": "./cli.js", - "./package.json": "./package.json" + "./package.json": "./package.json", + "./lib/cli": "./lib/cli.js", + "./lib/transform/babelBundle": "./lib/transform/babelBundle.js", + "./lib/transform/compilationCache": "./lib/transform/compilationCache.js", + "./lib/transform/esmLoader": "./lib/transform/esmLoader.js", + "./lib/internalsForTest": "./lib/internalsForTest.js", + "./lib/plugins": "./lib/plugins/index.js", + "./jsx-runtime": { + "import": "./jsx-runtime.mjs", + "require": "./jsx-runtime.js", + "default": "./jsx-runtime.js" + }, + "./lib/util": "./lib/util.js", + "./lib/utilsBundle": "./lib/utilsBundle.js", + "./types/test": { + "types": "./types/test.d.ts" + }, + "./types/testReporter": { + "types": "./types/testReporter.d.ts" + }, + "./test": { + "types": "./test.d.ts", + "import": "./test.mjs", + "require": "./test.js", + "default": "./test.js" + } }, "bin": { "playwright": "./cli.js" }, - "scripts": { + "author": { + "name": "Microsoft Corporation" }, + "license": "Apache-2.0", "dependencies": { "playwright-core": "1.38.0-next" + }, + "optionalDependencies": { + "fsevents": "2.3.2" } } diff --git a/packages/playwright-test/src/DEPS.list b/packages/playwright/src/DEPS.list similarity index 100% rename from packages/playwright-test/src/DEPS.list rename to packages/playwright/src/DEPS.list diff --git a/packages/playwright-test/src/cli.ts b/packages/playwright/src/cli.ts similarity index 99% rename from packages/playwright-test/src/cli.ts rename to packages/playwright/src/cli.ts index 62fb72acfa2d1..5f9182cf6ff34 100644 --- a/packages/playwright-test/src/cli.ts +++ b/packages/playwright/src/cli.ts @@ -26,12 +26,12 @@ import { showHTMLReport } from './reporters/html'; import { createMergedReport } from './reporters/merge'; import { ConfigLoader, resolveConfigFile } from './common/configLoader'; import type { ConfigCLIOverrides } from './common/ipc'; -import type { FullResult, TestError } from '../reporter'; +import type { FullResult, TestError } from '../types/testReporter'; import type { TraceMode } from '../types/test'; import { builtInReporters, defaultReporter, defaultTimeout } from './common/config'; import type { FullConfigInternal } from './common/config'; import program from 'playwright-core/lib/cli/program'; -import type { ReporterDescription } from '..'; +import type { ReporterDescription } from '../types/test'; import { prepareErrorStack } from './reporters/base'; function addTestCommand(program: Command) { diff --git a/packages/playwright-test/src/common/DEPS.list b/packages/playwright/src/common/DEPS.list similarity index 100% rename from packages/playwright-test/src/common/DEPS.list rename to packages/playwright/src/common/DEPS.list diff --git a/packages/playwright-test/src/common/config.ts b/packages/playwright/src/common/config.ts similarity index 100% rename from packages/playwright-test/src/common/config.ts rename to packages/playwright/src/common/config.ts diff --git a/packages/playwright-test/src/common/configLoader.ts b/packages/playwright/src/common/configLoader.ts similarity index 100% rename from packages/playwright-test/src/common/configLoader.ts rename to packages/playwright/src/common/configLoader.ts diff --git a/packages/playwright-test/src/common/esmLoaderHost.ts b/packages/playwright/src/common/esmLoaderHost.ts similarity index 100% rename from packages/playwright-test/src/common/esmLoaderHost.ts rename to packages/playwright/src/common/esmLoaderHost.ts diff --git a/packages/playwright-test/src/common/expectBundle.ts b/packages/playwright/src/common/expectBundle.ts similarity index 100% rename from packages/playwright-test/src/common/expectBundle.ts rename to packages/playwright/src/common/expectBundle.ts diff --git a/packages/playwright-test/src/common/fixtures.ts b/packages/playwright/src/common/fixtures.ts similarity index 100% rename from packages/playwright-test/src/common/fixtures.ts rename to packages/playwright/src/common/fixtures.ts diff --git a/packages/playwright-test/src/common/globals.ts b/packages/playwright/src/common/globals.ts similarity index 100% rename from packages/playwright-test/src/common/globals.ts rename to packages/playwright/src/common/globals.ts diff --git a/packages/playwright-test/src/common/ipc.ts b/packages/playwright/src/common/ipc.ts similarity index 100% rename from packages/playwright-test/src/common/ipc.ts rename to packages/playwright/src/common/ipc.ts diff --git a/packages/playwright-test/src/common/poolBuilder.ts b/packages/playwright/src/common/poolBuilder.ts similarity index 98% rename from packages/playwright-test/src/common/poolBuilder.ts rename to packages/playwright/src/common/poolBuilder.ts index 326f24843bde7..cc1bc095c99a5 100644 --- a/packages/playwright-test/src/common/poolBuilder.ts +++ b/packages/playwright/src/common/poolBuilder.ts @@ -20,7 +20,7 @@ import type { Suite, TestCase } from './test'; import type { TestTypeImpl } from './testType'; import type { FullProjectInternal } from './config'; import { formatLocation } from '../util'; -import type { TestError } from '../../reporter'; +import type { TestError } from '../../types/testReporter'; export class PoolBuilder { private _project: FullProjectInternal | undefined; diff --git a/packages/playwright-test/src/common/process.ts b/packages/playwright/src/common/process.ts similarity index 100% rename from packages/playwright-test/src/common/process.ts rename to packages/playwright/src/common/process.ts diff --git a/packages/playwright-test/src/common/suiteUtils.ts b/packages/playwright/src/common/suiteUtils.ts similarity index 100% rename from packages/playwright-test/src/common/suiteUtils.ts rename to packages/playwright/src/common/suiteUtils.ts diff --git a/packages/playwright-test/src/common/test.ts b/packages/playwright/src/common/test.ts similarity index 100% rename from packages/playwright-test/src/common/test.ts rename to packages/playwright/src/common/test.ts diff --git a/packages/playwright-test/src/common/testLoader.ts b/packages/playwright/src/common/testLoader.ts similarity index 98% rename from packages/playwright-test/src/common/testLoader.ts rename to packages/playwright/src/common/testLoader.ts index c0e781e552f57..a85d93545dab8 100644 --- a/packages/playwright-test/src/common/testLoader.ts +++ b/packages/playwright/src/common/testLoader.ts @@ -16,7 +16,7 @@ import path from 'path'; import util from 'util'; -import type { TestError } from '../../reporter'; +import type { TestError } from '../../types/testReporter'; import { isWorkerProcess, setCurrentlyLoadingFileSuite } from './globals'; import { Suite } from './test'; import { requireOrImport } from '../transform/transform'; diff --git a/packages/playwright-test/src/common/testType.ts b/packages/playwright/src/common/testType.ts similarity index 100% rename from packages/playwright-test/src/common/testType.ts rename to packages/playwright/src/common/testType.ts diff --git a/packages/playwright-test/src/index.ts b/packages/playwright/src/index.ts similarity index 100% rename from packages/playwright-test/src/index.ts rename to packages/playwright/src/index.ts diff --git a/packages/playwright-test/src/internalsForTest.ts b/packages/playwright/src/internalsForTest.ts similarity index 100% rename from packages/playwright-test/src/internalsForTest.ts rename to packages/playwright/src/internalsForTest.ts diff --git a/packages/playwright-test/src/isomorphic/DEPS.list b/packages/playwright/src/isomorphic/DEPS.list similarity index 100% rename from packages/playwright-test/src/isomorphic/DEPS.list rename to packages/playwright/src/isomorphic/DEPS.list diff --git a/packages/playwright-test/src/isomorphic/folders.ts b/packages/playwright/src/isomorphic/folders.ts similarity index 100% rename from packages/playwright-test/src/isomorphic/folders.ts rename to packages/playwright/src/isomorphic/folders.ts diff --git a/packages/playwright-test/src/isomorphic/stringInternPool.ts b/packages/playwright/src/isomorphic/stringInternPool.ts similarity index 100% rename from packages/playwright-test/src/isomorphic/stringInternPool.ts rename to packages/playwright/src/isomorphic/stringInternPool.ts diff --git a/packages/playwright-test/src/isomorphic/teleReceiver.ts b/packages/playwright/src/isomorphic/teleReceiver.ts similarity index 100% rename from packages/playwright-test/src/isomorphic/teleReceiver.ts rename to packages/playwright/src/isomorphic/teleReceiver.ts diff --git a/packages/playwright-test/src/loader/DEPS.list b/packages/playwright/src/loader/DEPS.list similarity index 100% rename from packages/playwright-test/src/loader/DEPS.list rename to packages/playwright/src/loader/DEPS.list diff --git a/packages/playwright-test/src/loader/loaderMain.ts b/packages/playwright/src/loader/loaderMain.ts similarity index 97% rename from packages/playwright-test/src/loader/loaderMain.ts rename to packages/playwright/src/loader/loaderMain.ts index 23444ca21f671..7e865c7e4b28a 100644 --- a/packages/playwright-test/src/loader/loaderMain.ts +++ b/packages/playwright/src/loader/loaderMain.ts @@ -19,7 +19,7 @@ import { ConfigLoader } from '../common/configLoader'; import { ProcessRunner } from '../common/process'; import type { FullConfigInternal } from '../common/config'; import { loadTestFile } from '../common/testLoader'; -import type { TestError } from '../../reporter'; +import type { TestError } from '../../types/testReporter'; import { serializeCompilationCache } from '../transform/compilationCache'; import { PoolBuilder } from '../common/poolBuilder'; import { incorporateCompilationCache } from '../common/esmLoaderHost'; diff --git a/packages/playwright-test/src/matchers/DEPS.list b/packages/playwright/src/matchers/DEPS.list similarity index 100% rename from packages/playwright-test/src/matchers/DEPS.list rename to packages/playwright/src/matchers/DEPS.list diff --git a/packages/playwright-test/src/matchers/expect.ts b/packages/playwright/src/matchers/expect.ts similarity index 100% rename from packages/playwright-test/src/matchers/expect.ts rename to packages/playwright/src/matchers/expect.ts diff --git a/packages/playwright-test/src/matchers/matcherHint.ts b/packages/playwright/src/matchers/matcherHint.ts similarity index 100% rename from packages/playwright-test/src/matchers/matcherHint.ts rename to packages/playwright/src/matchers/matcherHint.ts diff --git a/packages/playwright-test/src/matchers/matchers.ts b/packages/playwright/src/matchers/matchers.ts similarity index 100% rename from packages/playwright-test/src/matchers/matchers.ts rename to packages/playwright/src/matchers/matchers.ts diff --git a/packages/playwright-test/src/matchers/toBeTruthy.ts b/packages/playwright/src/matchers/toBeTruthy.ts similarity index 100% rename from packages/playwright-test/src/matchers/toBeTruthy.ts rename to packages/playwright/src/matchers/toBeTruthy.ts diff --git a/packages/playwright-test/src/matchers/toEqual.ts b/packages/playwright/src/matchers/toEqual.ts similarity index 100% rename from packages/playwright-test/src/matchers/toEqual.ts rename to packages/playwright/src/matchers/toEqual.ts diff --git a/packages/playwright-test/src/matchers/toMatchSnapshot.ts b/packages/playwright/src/matchers/toMatchSnapshot.ts similarity index 100% rename from packages/playwright-test/src/matchers/toMatchSnapshot.ts rename to packages/playwright/src/matchers/toMatchSnapshot.ts diff --git a/packages/playwright-test/src/matchers/toMatchText.ts b/packages/playwright/src/matchers/toMatchText.ts similarity index 100% rename from packages/playwright-test/src/matchers/toMatchText.ts rename to packages/playwright/src/matchers/toMatchText.ts diff --git a/packages/playwright-test/src/plugins/DEPS.list b/packages/playwright/src/plugins/DEPS.list similarity index 100% rename from packages/playwright-test/src/plugins/DEPS.list rename to packages/playwright/src/plugins/DEPS.list diff --git a/packages/playwright-test/src/plugins/gitCommitInfoPlugin.ts b/packages/playwright/src/plugins/gitCommitInfoPlugin.ts similarity index 100% rename from packages/playwright-test/src/plugins/gitCommitInfoPlugin.ts rename to packages/playwright/src/plugins/gitCommitInfoPlugin.ts diff --git a/packages/playwright-test/src/plugins/index.ts b/packages/playwright/src/plugins/index.ts similarity index 100% rename from packages/playwright-test/src/plugins/index.ts rename to packages/playwright/src/plugins/index.ts diff --git a/packages/playwright-test/src/plugins/webServerPlugin.ts b/packages/playwright/src/plugins/webServerPlugin.ts similarity index 100% rename from packages/playwright-test/src/plugins/webServerPlugin.ts rename to packages/playwright/src/plugins/webServerPlugin.ts diff --git a/packages/playwright-test/src/reporters/.eslintrc.json b/packages/playwright/src/reporters/.eslintrc.json similarity index 100% rename from packages/playwright-test/src/reporters/.eslintrc.json rename to packages/playwright/src/reporters/.eslintrc.json diff --git a/packages/playwright-test/src/reporters/DEPS.list b/packages/playwright/src/reporters/DEPS.list similarity index 100% rename from packages/playwright-test/src/reporters/DEPS.list rename to packages/playwright/src/reporters/DEPS.list diff --git a/packages/playwright-test/src/reporters/base.ts b/packages/playwright/src/reporters/base.ts similarity index 100% rename from packages/playwright-test/src/reporters/base.ts rename to packages/playwright/src/reporters/base.ts diff --git a/packages/playwright-test/src/reporters/blob.ts b/packages/playwright/src/reporters/blob.ts similarity index 100% rename from packages/playwright-test/src/reporters/blob.ts rename to packages/playwright/src/reporters/blob.ts diff --git a/packages/playwright-test/src/reporters/dot.ts b/packages/playwright/src/reporters/dot.ts similarity index 100% rename from packages/playwright-test/src/reporters/dot.ts rename to packages/playwright/src/reporters/dot.ts diff --git a/packages/playwright-test/src/reporters/empty.ts b/packages/playwright/src/reporters/empty.ts similarity index 100% rename from packages/playwright-test/src/reporters/empty.ts rename to packages/playwright/src/reporters/empty.ts diff --git a/packages/playwright-test/src/reporters/github.ts b/packages/playwright/src/reporters/github.ts similarity index 100% rename from packages/playwright-test/src/reporters/github.ts rename to packages/playwright/src/reporters/github.ts diff --git a/packages/playwright-test/src/reporters/html.ts b/packages/playwright/src/reporters/html.ts similarity index 100% rename from packages/playwright-test/src/reporters/html.ts rename to packages/playwright/src/reporters/html.ts diff --git a/packages/playwright-test/src/reporters/internalReporter.ts b/packages/playwright/src/reporters/internalReporter.ts similarity index 100% rename from packages/playwright-test/src/reporters/internalReporter.ts rename to packages/playwright/src/reporters/internalReporter.ts diff --git a/packages/playwright-test/src/reporters/json.ts b/packages/playwright/src/reporters/json.ts similarity index 100% rename from packages/playwright-test/src/reporters/json.ts rename to packages/playwright/src/reporters/json.ts diff --git a/packages/playwright-test/src/reporters/junit.ts b/packages/playwright/src/reporters/junit.ts similarity index 100% rename from packages/playwright-test/src/reporters/junit.ts rename to packages/playwright/src/reporters/junit.ts diff --git a/packages/playwright-test/src/reporters/line.ts b/packages/playwright/src/reporters/line.ts similarity index 100% rename from packages/playwright-test/src/reporters/line.ts rename to packages/playwright/src/reporters/line.ts diff --git a/packages/playwright-test/src/reporters/list.ts b/packages/playwright/src/reporters/list.ts similarity index 100% rename from packages/playwright-test/src/reporters/list.ts rename to packages/playwright/src/reporters/list.ts diff --git a/packages/playwright-test/src/reporters/markdown.ts b/packages/playwright/src/reporters/markdown.ts similarity index 100% rename from packages/playwright-test/src/reporters/markdown.ts rename to packages/playwright/src/reporters/markdown.ts diff --git a/packages/playwright-test/src/reporters/merge.ts b/packages/playwright/src/reporters/merge.ts similarity index 100% rename from packages/playwright-test/src/reporters/merge.ts rename to packages/playwright/src/reporters/merge.ts diff --git a/packages/playwright-test/src/reporters/multiplexer.ts b/packages/playwright/src/reporters/multiplexer.ts similarity index 100% rename from packages/playwright-test/src/reporters/multiplexer.ts rename to packages/playwright/src/reporters/multiplexer.ts diff --git a/packages/playwright-test/src/reporters/reporterV2.ts b/packages/playwright/src/reporters/reporterV2.ts similarity index 100% rename from packages/playwright-test/src/reporters/reporterV2.ts rename to packages/playwright/src/reporters/reporterV2.ts diff --git a/packages/playwright-test/src/reporters/teleEmitter.ts b/packages/playwright/src/reporters/teleEmitter.ts similarity index 100% rename from packages/playwright-test/src/reporters/teleEmitter.ts rename to packages/playwright/src/reporters/teleEmitter.ts diff --git a/packages/playwright-test/src/runner/DEPS.list b/packages/playwright/src/runner/DEPS.list similarity index 100% rename from packages/playwright-test/src/runner/DEPS.list rename to packages/playwright/src/runner/DEPS.list diff --git a/packages/playwright-test/src/runner/dispatcher.ts b/packages/playwright/src/runner/dispatcher.ts similarity index 100% rename from packages/playwright-test/src/runner/dispatcher.ts rename to packages/playwright/src/runner/dispatcher.ts diff --git a/packages/playwright-test/src/runner/failureTracker.ts b/packages/playwright/src/runner/failureTracker.ts similarity index 100% rename from packages/playwright-test/src/runner/failureTracker.ts rename to packages/playwright/src/runner/failureTracker.ts diff --git a/packages/playwright-test/src/runner/loadUtils.ts b/packages/playwright/src/runner/loadUtils.ts similarity index 100% rename from packages/playwright-test/src/runner/loadUtils.ts rename to packages/playwright/src/runner/loadUtils.ts diff --git a/packages/playwright-test/src/runner/loaderHost.ts b/packages/playwright/src/runner/loaderHost.ts similarity index 97% rename from packages/playwright-test/src/runner/loaderHost.ts rename to packages/playwright/src/runner/loaderHost.ts index 70ccf8f0be7d9..8afaa2916a722 100644 --- a/packages/playwright-test/src/runner/loaderHost.ts +++ b/packages/playwright/src/runner/loaderHost.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import type { TestError } from '../../reporter'; +import type { TestError } from '../../types/testReporter'; import { serializeConfig } from '../common/ipc'; import { ProcessHost } from './processHost'; import { Suite } from '../common/test'; diff --git a/packages/playwright-test/src/runner/processHost.ts b/packages/playwright/src/runner/processHost.ts similarity index 100% rename from packages/playwright-test/src/runner/processHost.ts rename to packages/playwright/src/runner/processHost.ts diff --git a/packages/playwright-test/src/runner/projectUtils.ts b/packages/playwright/src/runner/projectUtils.ts similarity index 100% rename from packages/playwright-test/src/runner/projectUtils.ts rename to packages/playwright/src/runner/projectUtils.ts diff --git a/packages/playwright-test/src/runner/reporters.ts b/packages/playwright/src/runner/reporters.ts similarity index 100% rename from packages/playwright-test/src/runner/reporters.ts rename to packages/playwright/src/runner/reporters.ts diff --git a/packages/playwright-test/src/runner/runner.ts b/packages/playwright/src/runner/runner.ts similarity index 100% rename from packages/playwright-test/src/runner/runner.ts rename to packages/playwright/src/runner/runner.ts diff --git a/packages/playwright-test/src/runner/sigIntWatcher.ts b/packages/playwright/src/runner/sigIntWatcher.ts similarity index 100% rename from packages/playwright-test/src/runner/sigIntWatcher.ts rename to packages/playwright/src/runner/sigIntWatcher.ts diff --git a/packages/playwright-test/src/runner/taskRunner.ts b/packages/playwright/src/runner/taskRunner.ts similarity index 98% rename from packages/playwright-test/src/runner/taskRunner.ts rename to packages/playwright/src/runner/taskRunner.ts index 7e990391d64fd..badc5933627ba 100644 --- a/packages/playwright-test/src/runner/taskRunner.ts +++ b/packages/playwright/src/runner/taskRunner.ts @@ -16,7 +16,7 @@ import { debug } from 'playwright-core/lib/utilsBundle'; import { ManualPromise, monotonicTime } from 'playwright-core/lib/utils'; -import type { FullResult, TestError } from '../../reporter'; +import type { FullResult, TestError } from '../../types/testReporter'; import { SigIntWatcher } from './sigIntWatcher'; import { serializeError } from '../util'; import type { ReporterV2 } from '../reporters/reporterV2'; diff --git a/packages/playwright-test/src/runner/tasks.ts b/packages/playwright/src/runner/tasks.ts similarity index 100% rename from packages/playwright-test/src/runner/tasks.ts rename to packages/playwright/src/runner/tasks.ts diff --git a/packages/playwright-test/src/runner/testGroups.ts b/packages/playwright/src/runner/testGroups.ts similarity index 100% rename from packages/playwright-test/src/runner/testGroups.ts rename to packages/playwright/src/runner/testGroups.ts diff --git a/packages/playwright-test/src/runner/uiMode.ts b/packages/playwright/src/runner/uiMode.ts similarity index 99% rename from packages/playwright-test/src/runner/uiMode.ts rename to packages/playwright/src/runner/uiMode.ts index 62ec66873ce20..aff2baaddbec3 100644 --- a/packages/playwright-test/src/runner/uiMode.ts +++ b/packages/playwright/src/runner/uiMode.ts @@ -16,7 +16,7 @@ import { openTraceViewerApp, openTraceInBrowser, registry } from 'playwright-core/lib/server'; import { isUnderTest, ManualPromise } from 'playwright-core/lib/utils'; -import type { FullResult } from '../../reporter'; +import type { FullResult } from '../../types/testReporter'; import { clearCompilationCache, collectAffectedTestFiles, dependenciesForTestFile } from '../transform/compilationCache'; import type { FullConfigInternal } from '../common/config'; import { InternalReporter } from '../reporters/internalReporter'; diff --git a/packages/playwright-test/src/runner/watchMode.ts b/packages/playwright/src/runner/watchMode.ts similarity index 99% rename from packages/playwright-test/src/runner/watchMode.ts rename to packages/playwright/src/runner/watchMode.ts index 2f860e0f1b9b3..575653d3e23ab 100644 --- a/packages/playwright-test/src/runner/watchMode.ts +++ b/packages/playwright/src/runner/watchMode.ts @@ -23,7 +23,7 @@ import type { Matcher } from '../util'; import { TestRun, createTaskRunnerForWatch, createTaskRunnerForWatchSetup } from './tasks'; import { buildProjectsClosure, filterProjects } from './projectUtils'; import { clearCompilationCache, collectAffectedTestFiles } from '../transform/compilationCache'; -import type { FullResult } from 'packages/playwright-test/reporter'; +import type { FullResult } from '../../types/testReporter'; import { chokidar } from '../utilsBundle'; import type { FSWatcher as CFSWatcher } from 'chokidar'; import { colors } from 'playwright-core/lib/utilsBundle'; diff --git a/packages/playwright-test/src/runner/workerHost.ts b/packages/playwright/src/runner/workerHost.ts similarity index 100% rename from packages/playwright-test/src/runner/workerHost.ts rename to packages/playwright/src/runner/workerHost.ts diff --git a/packages/playwright-test/src/store.ts b/packages/playwright/src/store.ts similarity index 100% rename from packages/playwright-test/src/store.ts rename to packages/playwright/src/store.ts diff --git a/packages/playwright-test/src/third_party/tsconfig-loader.ts b/packages/playwright/src/third_party/tsconfig-loader.ts similarity index 100% rename from packages/playwright-test/src/third_party/tsconfig-loader.ts rename to packages/playwright/src/third_party/tsconfig-loader.ts diff --git a/packages/playwright-test/src/transform/DEPS.list b/packages/playwright/src/transform/DEPS.list similarity index 100% rename from packages/playwright-test/src/transform/DEPS.list rename to packages/playwright/src/transform/DEPS.list diff --git a/packages/playwright-test/src/transform/babelBundle.ts b/packages/playwright/src/transform/babelBundle.ts similarity index 100% rename from packages/playwright-test/src/transform/babelBundle.ts rename to packages/playwright/src/transform/babelBundle.ts diff --git a/packages/playwright-test/src/transform/compilationCache.ts b/packages/playwright/src/transform/compilationCache.ts similarity index 100% rename from packages/playwright-test/src/transform/compilationCache.ts rename to packages/playwright/src/transform/compilationCache.ts diff --git a/packages/playwright-test/src/transform/esmLoader.ts b/packages/playwright/src/transform/esmLoader.ts similarity index 100% rename from packages/playwright-test/src/transform/esmLoader.ts rename to packages/playwright/src/transform/esmLoader.ts diff --git a/packages/playwright-test/src/transform/portTransport.ts b/packages/playwright/src/transform/portTransport.ts similarity index 100% rename from packages/playwright-test/src/transform/portTransport.ts rename to packages/playwright/src/transform/portTransport.ts diff --git a/packages/playwright-test/src/transform/transform.ts b/packages/playwright/src/transform/transform.ts similarity index 100% rename from packages/playwright-test/src/transform/transform.ts rename to packages/playwright/src/transform/transform.ts diff --git a/packages/playwright-test/src/util.ts b/packages/playwright/src/util.ts similarity index 99% rename from packages/playwright-test/src/util.ts rename to packages/playwright/src/util.ts index f825c145c7a9a..b7e98c0626c9e 100644 --- a/packages/playwright-test/src/util.ts +++ b/packages/playwright/src/util.ts @@ -305,7 +305,7 @@ function folderIsModule(folder: string): boolean { const kExperimentalLoaderOptions = [ '--no-warnings', - `--experimental-loader=${url.pathToFileURL(require.resolve('@playwright/test/lib/transform/esmLoader')).toString()}`, + `--experimental-loader=${url.pathToFileURL(require.resolve('playwright/lib/transform/esmLoader')).toString()}`, ]; export function execArgvWithExperimentalLoaderOptions() { diff --git a/packages/playwright-test/src/utilsBundle.ts b/packages/playwright/src/utilsBundle.ts similarity index 100% rename from packages/playwright-test/src/utilsBundle.ts rename to packages/playwright/src/utilsBundle.ts diff --git a/packages/playwright-test/src/worker/DEPS.list b/packages/playwright/src/worker/DEPS.list similarity index 100% rename from packages/playwright-test/src/worker/DEPS.list rename to packages/playwright/src/worker/DEPS.list diff --git a/packages/playwright-test/src/worker/fixtureRunner.ts b/packages/playwright/src/worker/fixtureRunner.ts similarity index 100% rename from packages/playwright-test/src/worker/fixtureRunner.ts rename to packages/playwright/src/worker/fixtureRunner.ts diff --git a/packages/playwright-test/src/worker/testInfo.ts b/packages/playwright/src/worker/testInfo.ts similarity index 100% rename from packages/playwright-test/src/worker/testInfo.ts rename to packages/playwright/src/worker/testInfo.ts diff --git a/packages/playwright-test/src/worker/testTracing.ts b/packages/playwright/src/worker/testTracing.ts similarity index 100% rename from packages/playwright-test/src/worker/testTracing.ts rename to packages/playwright/src/worker/testTracing.ts diff --git a/packages/playwright-test/src/worker/timeoutManager.ts b/packages/playwright/src/worker/timeoutManager.ts similarity index 100% rename from packages/playwright-test/src/worker/timeoutManager.ts rename to packages/playwright/src/worker/timeoutManager.ts diff --git a/packages/playwright-test/src/worker/workerMain.ts b/packages/playwright/src/worker/workerMain.ts similarity index 100% rename from packages/playwright-test/src/worker/workerMain.ts rename to packages/playwright/src/worker/workerMain.ts diff --git a/packages/playwright/test.d.ts b/packages/playwright/test.d.ts new file mode 100644 index 0000000000000..4369d23a3c933 --- /dev/null +++ b/packages/playwright/test.d.ts @@ -0,0 +1,18 @@ +/** + * Copyright (c) Microsoft Corporation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export * from './types/test'; +export { default } from './types/test'; diff --git a/packages/playwright/test.js b/packages/playwright/test.js new file mode 100644 index 0000000000000..c066192a747aa --- /dev/null +++ b/packages/playwright/test.js @@ -0,0 +1,28 @@ +/** + * Copyright (c) Microsoft Corporation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +const pwt = require('./lib/index'); +const { defineConfig } = require('./lib/common/configLoader'); +const playwright = require('./index'); +const combinedExports = { + ...playwright, + ...pwt, + defineConfig, +}; + +Object.defineProperty(combinedExports, '__esModule', { value: true }); + +module.exports = combinedExports; diff --git a/packages/playwright/test.mjs b/packages/playwright/test.mjs new file mode 100644 index 0000000000000..affa8048dd06f --- /dev/null +++ b/packages/playwright/test.mjs @@ -0,0 +1,31 @@ +/** + * Copyright (c) Microsoft Corporation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import playwright from './test.js'; + +export const chromium = playwright.chromium; +export const firefox = playwright.firefox; +export const webkit = playwright.webkit; +export const selectors = playwright.selectors; +export const devices = playwright.devices; +export const errors = playwright.errors; +export const request = playwright.request; +export const _electron = playwright._electron; +export const _android = playwright._android; +export const test = playwright.test; +export const expect = playwright.expect; +export const defineConfig = playwright.defineConfig; +export default playwright.test; diff --git a/packages/playwright-test/types/reporterPrivate.ts b/packages/playwright/types/reporterPrivate.ts similarity index 100% rename from packages/playwright-test/types/reporterPrivate.ts rename to packages/playwright/types/reporterPrivate.ts diff --git a/packages/playwright-test/types/test.d.ts b/packages/playwright/types/test.d.ts similarity index 100% rename from packages/playwright-test/types/test.d.ts rename to packages/playwright/types/test.d.ts diff --git a/packages/playwright-test/types/testReporter.d.ts b/packages/playwright/types/testReporter.d.ts similarity index 100% rename from packages/playwright-test/types/testReporter.d.ts rename to packages/playwright/types/testReporter.d.ts diff --git a/packages/trace-viewer/src/ui/DEPS.list b/packages/trace-viewer/src/ui/DEPS.list index 515497fd39c51..3fab0da95b08b 100644 --- a/packages/trace-viewer/src/ui/DEPS.list +++ b/packages/trace-viewer/src/ui/DEPS.list @@ -5,4 +5,4 @@ @web/** ../entries.ts ../geometry.ts -../../../playwright-test/src/isomorphic/** +../../../playwright/src/isomorphic/** diff --git a/packages/trace-viewer/src/ui/uiModeView.tsx b/packages/trace-viewer/src/ui/uiModeView.tsx index a5c7cabb54b47..42a62c6cc62fe 100644 --- a/packages/trace-viewer/src/ui/uiModeView.tsx +++ b/packages/trace-viewer/src/ui/uiModeView.tsx @@ -22,7 +22,7 @@ import { TreeView } from '@web/components/treeView'; import type { TreeState } from '@web/components/treeView'; import { baseFullConfig, TeleReporterReceiver, TeleSuite } from '@testIsomorphic/teleReceiver'; import type { TeleTestCase } from '@testIsomorphic/teleReceiver'; -import type { FullConfig, Suite, TestCase, Location, TestError } from '@playwright/test/types/testReporter'; +import type { FullConfig, Suite, TestCase, Location, TestError } from 'playwright/types/testReporter'; import { SplitView } from '@web/components/splitView'; import { idForAction, MultiTraceModel } from './modelUtil'; import type { SourceLocation } from './modelUtil'; diff --git a/packages/trace-viewer/tsconfig.json b/packages/trace-viewer/tsconfig.json index 350af62edd5a5..41b2ed39480db 100644 --- a/packages/trace-viewer/tsconfig.json +++ b/packages/trace-viewer/tsconfig.json @@ -20,7 +20,7 @@ "@isomorphic/*": ["../playwright-core/src/utils/isomorphic/*"], "@protocol/*": ["../protocol/src/*"], "@recorder/*": ["../recorder/src/*"], - "@testIsomorphic/*": ["../playwright-test/src/isomorphic/*"], + "@testIsomorphic/*": ["../playwright/src/isomorphic/*"], "@trace/*": ["../trace/src/*"], "@web/*": ["../web/src/*"], // Resolving type dependencies will start processing types in @playwright/test diff --git a/packages/trace-viewer/vite.config.ts b/packages/trace-viewer/vite.config.ts index e075ce1d85430..2e5178132d445 100644 --- a/packages/trace-viewer/vite.config.ts +++ b/packages/trace-viewer/vite.config.ts @@ -32,7 +32,7 @@ export default defineConfig({ '@injected': path.resolve(__dirname, '../playwright-core/src/server/injected'), '@isomorphic': path.resolve(__dirname, '../playwright-core/src/utils/isomorphic'), '@protocol': path.resolve(__dirname, '../protocol/src'), - '@testIsomorphic': path.resolve(__dirname, '../playwright-test/src/isomorphic'), + '@testIsomorphic': path.resolve(__dirname, '../playwright/src/isomorphic'), '@trace': path.resolve(__dirname, '../trace/src'), '@web': path.resolve(__dirname, '../web/src'), }, diff --git a/tests/components/ct-react-vite/tsconfig.json b/tests/components/ct-react-vite/tsconfig.json index 7f890931cc77c..e706497adb7fe 100644 --- a/tests/components/ct-react-vite/tsconfig.json +++ b/tests/components/ct-react-vite/tsconfig.json @@ -17,7 +17,8 @@ "jsx": "react-jsx", "baseUrl": ".", "paths": { - "@/*": ["./src/*"] + "@/*": ["./src/*"], + "*": ["_"], } }, "include": ["src", "tests"], diff --git a/tests/components/ct-react17/tsconfig.json b/tests/components/ct-react17/tsconfig.json index e41f60c87d57c..fef2ed01eef0c 100644 --- a/tests/components/ct-react17/tsconfig.json +++ b/tests/components/ct-react17/tsconfig.json @@ -21,7 +21,8 @@ "jsx": "react-jsx", "baseUrl": ".", "paths": { - "@/*": ["./src/*"] + "@/*": ["./src/*"], + "*": ["_"], } }, "include": [ diff --git a/tests/components/ct-solid/package.json b/tests/components/ct-solid/package.json index a298b78099ce1..ecbcb6ae468a4 100644 --- a/tests/components/ct-solid/package.json +++ b/tests/components/ct-solid/package.json @@ -12,7 +12,7 @@ "license": "MIT", "dependencies": { "@solidjs/router": "^0.8.2", - "solid-js": "^1.4.7" + "solid-js": "^1.7.3" }, "devDependencies": { "typescript": "^4.7.4", diff --git a/tests/components/ct-solid/tsconfig.json b/tests/components/ct-solid/tsconfig.json index 6dec35bc3ca64..c353ff128ae91 100644 --- a/tests/components/ct-solid/tsconfig.json +++ b/tests/components/ct-solid/tsconfig.json @@ -14,7 +14,8 @@ "skipLibCheck": true, "baseUrl": ".", "paths": { - "@/*": ["./src/*"] + "@/*": ["./src/*"], + "*": ["_"], } } } diff --git a/tests/components/ct-svelte-vite/tests/render.spec.ts b/tests/components/ct-svelte-vite/tests/render.spec.ts index 78755c8aa3dbe..bf830dd7152a8 100644 --- a/tests/components/ct-svelte-vite/tests/render.spec.ts +++ b/tests/components/ct-svelte-vite/tests/render.spec.ts @@ -1,5 +1,5 @@ import { test, expect } from '@playwright/experimental-ct-svelte'; -import type { HooksConfig } from 'playwright'; +import type { HooksConfig } from '../playwright'; import Button from '@/components/Button.svelte'; import Empty from '@/components/Empty.svelte'; import Context from '@/components/Context.svelte'; diff --git a/tests/components/ct-svelte-vite/tsconfig.json b/tests/components/ct-svelte-vite/tsconfig.json index 635d5559eac7e..4dc15b75b04c0 100644 --- a/tests/components/ct-svelte-vite/tsconfig.json +++ b/tests/components/ct-svelte-vite/tsconfig.json @@ -5,7 +5,6 @@ "useDefineForClassFields": true, "module": "esnext", "resolveJsonModule": true, - "baseUrl": ".", /** * Typecheck JS in `.svelte` and `.js` files by default. * Disable checkJs if you'd like to use dynamic types in JS. @@ -16,8 +15,10 @@ "checkJs": true, "skipLibCheck": true, "strict": true, + "baseUrl": ".", "paths": { - "@/*": ["./src/*"] + "@/*": ["./src/*"], + "*": ["_"], } }, "include": ["src/**/*.d.ts", "src/**/*.ts", "src/**/*.js", "src/**/*.svelte", "src/**/*.spec.*/*", "tests/**/*.ts"], diff --git a/tests/components/ct-svelte/tsconfig.json b/tests/components/ct-svelte/tsconfig.json index 47248ae0a0097..4ce7ec19bfd6f 100644 --- a/tests/components/ct-svelte/tsconfig.json +++ b/tests/components/ct-svelte/tsconfig.json @@ -9,7 +9,8 @@ "moduleResolution": "node", "baseUrl": ".", "paths": { - "@/*": ["./src/*"] + "@/*": ["./src/*"], + "*": ["_"], } } } diff --git a/tests/components/ct-vue-cli/package.json b/tests/components/ct-vue-cli/package.json index e28d1136ecca3..1a38a7c66e4c1 100644 --- a/tests/components/ct-vue-cli/package.json +++ b/tests/components/ct-vue-cli/package.json @@ -10,7 +10,7 @@ }, "dependencies": { "core-js": "^3.8.3", - "vue": "^3.2.13", + "vue": "3.2.36", "vue-router": "^4.1.5" }, "devDependencies": { diff --git a/tests/components/ct-vue-cli/tsconfig.app.json b/tests/components/ct-vue-cli/tsconfig.app.json index 326d9a3552d8d..5e1fc21721d9f 100644 --- a/tests/components/ct-vue-cli/tsconfig.app.json +++ b/tests/components/ct-vue-cli/tsconfig.app.json @@ -6,7 +6,8 @@ "composite": true, "baseUrl": ".", "paths": { - "@/*": ["./src/*"] + "@/*": ["./src/*"], + "*": ["_"], } } } diff --git a/tests/components/ct-vue-vite/tsconfig.json b/tests/components/ct-vue-vite/tsconfig.json index a1d96a55c5e56..cda3ce98bed5a 100644 --- a/tests/components/ct-vue-vite/tsconfig.json +++ b/tests/components/ct-vue-vite/tsconfig.json @@ -4,7 +4,8 @@ "compilerOptions": { "baseUrl": ".", "paths": { - "@/*": ["./src/*"] + "@/*": ["./src/*"], + "*": ["_"], }, "ignoreDeprecations": "5.0" }, diff --git a/tests/components/ct-vue2-cli/tsconfig.app.json b/tests/components/ct-vue2-cli/tsconfig.app.json index 40ad6e32b2550..2222a73314935 100644 --- a/tests/components/ct-vue2-cli/tsconfig.app.json +++ b/tests/components/ct-vue2-cli/tsconfig.app.json @@ -5,7 +5,8 @@ "composite": true, "baseUrl": ".", "paths": { - "@/*": ["./src/*"] + "@/*": ["./src/*"], + "*": ["_"], } } } diff --git a/tests/installation/playwright-cdn-failover-should-work.spec.ts b/tests/installation/playwright-cdn-failover-should-work.spec.ts index 9df7433607007..382cff8c27db0 100644 --- a/tests/installation/playwright-cdn-failover-should-work.spec.ts +++ b/tests/installation/playwright-cdn-failover-should-work.spec.ts @@ -45,7 +45,5 @@ for (const cdn of CDNS) { await exec('node sanity.js playwright chromium firefox webkit'); if (nodeMajorVersion >= 14) await exec('node esm-playwright.mjs'); - const stdio = await exec('npx playwright', 'test', '-c', '.', { expectToExitWithError: true }); - expect(stdio).toContain(`Please install @playwright/test package`); }); } diff --git a/tests/installation/playwright-core-should-work.spec.ts b/tests/installation/playwright-core-should-work.spec.ts new file mode 100755 index 0000000000000..5fbad8cd9ed4e --- /dev/null +++ b/tests/installation/playwright-core-should-work.spec.ts @@ -0,0 +1,24 @@ +/** + * Copyright (c) Microsoft Corporation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { test, expect } from './npmTest'; + +test(`playwright-core should work`, async ({ exec, installedSoftwareOnDisk }) => { + const result1 = await exec('npm i --foreground-scripts playwright-core'); + expect(result1).toHaveLoggedSoftwareDownload([]); + expect(await installedSoftwareOnDisk()).toEqual([]); + const stdio = await exec('npx playwright-core', 'test', '-c', '.', { expectToExitWithError: true }); + expect(stdio).toContain(`Please install @playwright/test package`); +}); diff --git a/tests/installation/playwright-should-work.spec.ts b/tests/installation/playwright-should-work.spec.ts index 79d76b82845b4..84eb9c026f101 100755 --- a/tests/installation/playwright-should-work.spec.ts +++ b/tests/installation/playwright-should-work.spec.ts @@ -27,6 +27,4 @@ test(`playwright should work`, async ({ exec, nodeMajorVersion, installedSoftwar await exec('node sanity.js playwright chromium firefox webkit'); if (nodeMajorVersion >= 14) await exec('node esm-playwright.mjs'); - const stdio = await exec('npx playwright', 'test', '-c', '.', { expectToExitWithError: true }); - expect(stdio).toContain(`Please install @playwright/test package`); }); diff --git a/tests/library/tracing.spec.ts b/tests/library/tracing.spec.ts index d01173f36c5cd..8f92a7d596c57 100644 --- a/tests/library/tracing.spec.ts +++ b/tests/library/tracing.spec.ts @@ -21,7 +21,7 @@ import { browserTest, contextTest as test, expect } from '../config/browserTest' import { parseTraceRaw } from '../config/utils'; import type { StackFrame } from '@protocol/channels'; import type { ActionTraceEvent } from '../../packages/trace/src/trace'; -import { artifactsFolderName } from '../../packages/playwright-test/src/isomorphic/folders'; +import { artifactsFolderName } from '../../packages/playwright/src/isomorphic/folders'; test.skip(({ trace }) => trace === 'on'); diff --git a/tests/playwright-test/playwright-test-fixtures.ts b/tests/playwright-test/playwright-test-fixtures.ts index 08c55532c7037..e5d88f9b2b5e6 100644 --- a/tests/playwright-test/playwright-test-fixtures.ts +++ b/tests/playwright-test/playwright-test-fixtures.ts @@ -129,7 +129,7 @@ async function runPlaywrightTest(childProcess: CommonFixtures['childProcess'], b } const reportFile = path.join(baseDir, 'report.json'); const testProcess = startPlaywrightTest(childProcess, baseDir, params, { - PW_TEST_REPORTER: path.join(__dirname, '../../packages/playwright-test/lib/reporters/json.js'), + PW_TEST_REPORTER: path.join(__dirname, '../../packages/playwright/lib/reporters/json.js'), PLAYWRIGHT_JSON_OUTPUT_NAME: reportFile, ...env, }, options); diff --git a/tests/playwright-test/reporter-blob.spec.ts b/tests/playwright-test/reporter-blob.spec.ts index f74626f2942c3..ef633c883888c 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 'packages/playwright-test'; +import type { PlaywrightTestConfig } from '@playwright/test'; import path from 'path'; import url from 'url'; import type { HttpServer } from '../../packages/playwright-core/src/utils'; -import { startHtmlReportServer } from '../../packages/playwright-test/lib/reporters/html'; +import { startHtmlReportServer } from '../../packages/playwright/lib/reporters/html'; import { expect as baseExpect, test as baseTest, stripAnsi } from './playwright-test-fixtures'; import extractZip from '../../packages/playwright-core/bundles/zip/node_modules/extract-zip'; import * as yazl from '../../packages/playwright-core/bundles/zip/node_modules/yazl'; diff --git a/tests/playwright-test/reporter-html.spec.ts b/tests/playwright-test/reporter-html.spec.ts index a2c1bec167c8c..1de61a423d827 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/playwright-core/src/utils'; -import { startHtmlReportServer } from '../../packages/playwright-test/lib/reporters/html'; +import { startHtmlReportServer } from '../../packages/playwright/lib/reporters/html'; const { spawnAsync } = require('../../packages/playwright-core/lib/utils'); const test = baseTest.extend<{ showReport: (reportFolder?: string) => Promise }>({ @@ -873,7 +873,7 @@ for (const useIntermediateMergeReport of [false] as const) { const files = { 'uncommitted.txt': `uncommitted file`, 'playwright.config.ts': ` - import { gitCommitInfo } from '@playwright/test/lib/plugins'; + import { gitCommitInfo } from 'playwright/lib/plugins'; import { test, expect } from '@playwright/test'; export default { _plugins: [gitCommitInfo()] }; `, @@ -926,7 +926,7 @@ for (const useIntermediateMergeReport of [false] as const) { const result = await runInlineTest({ 'uncommitted.txt': `uncommitted file`, 'playwright.config.ts': ` - import { gitCommitInfo } from '@playwright/test/lib/plugins'; + import { gitCommitInfo } from 'playwright/lib/plugins'; import { test, expect } from '@playwright/test'; const plugin = gitCommitInfo({ info: { @@ -940,7 +940,7 @@ for (const useIntermediateMergeReport of [false] as const) { export default { _plugins: [plugin] }; `, 'example.spec.ts': ` - import { gitCommitInfo } from '@playwright/test/lib/plugins'; + import { gitCommitInfo } from 'playwright/lib/plugins'; import { test, expect } from '@playwright/test'; test('sample', async ({}) => { expect(2).toBe(2); }); `, diff --git a/tests/playwright-test/reporter.spec.ts b/tests/playwright-test/reporter.spec.ts index 870f7cb4939e9..485d029d5ce82 100644 --- a/tests/playwright-test/reporter.spec.ts +++ b/tests/playwright-test/reporter.spec.ts @@ -150,7 +150,7 @@ for (const useIntermediateMergeReport of [false, true] as const) { expect(result.exitCode).toBe(0); expect(result.outputLines).toEqual([ 'reporter-begin-begin%%', - 'version-' + require('../../packages/playwright-test/package.json').version, + 'version-' + require('../../packages/playwright/package.json').version, 'reporter-testbegin-is run-foo%%', 'reporter-stdout%%', 'reporter-stderr%%', diff --git a/tests/playwright-test/runner.spec.ts b/tests/playwright-test/runner.spec.ts index 0ce0f4c8be85a..0a576f97f8287 100644 --- a/tests/playwright-test/runner.spec.ts +++ b/tests/playwright-test/runner.spec.ts @@ -120,7 +120,7 @@ test('sigint should stop workers', async ({ interactWithTestRunner }) => { }); `, }, { 'workers': 2, 'reporter': 'line,json' }, { - PW_TEST_REPORTER: path.join(__dirname, '../../packages/playwright-test/lib/reporters/json.js'), + PW_TEST_REPORTER: path.join(__dirname, '../../packages/playwright/lib/reporters/json.js'), PLAYWRIGHT_JSON_OUTPUT_NAME: 'report.json', }); await testProcess.waitForOutput('%%SEND-SIGINT%%', 2); diff --git a/tests/playwright-test/watch.spec.ts b/tests/playwright-test/watch.spec.ts index 0db5abe4e7624..9e83f36a64b6f 100644 --- a/tests/playwright-test/watch.spec.ts +++ b/tests/playwright-test/watch.spec.ts @@ -40,7 +40,7 @@ test('should print dependencies in CJS mode', async ({ runInlineTest }) => { test('passes', () => {}); `, 'globalTeardown.ts': ` - import { fileDependencies } from '@playwright/test/lib/internalsForTest'; + import { fileDependencies } from 'playwright/lib/internalsForTest'; export default () => { console.log('###' + JSON.stringify(fileDependencies()) + '###'); }; @@ -79,7 +79,7 @@ test('should print dependencies in ESM mode', async ({ runInlineTest }) => { test('passes', () => {}); `, 'globalTeardown.ts': ` - import { fileDependencies } from '@playwright/test/lib/internalsForTest'; + import { fileDependencies } from 'playwright/lib/internalsForTest'; export default () => { console.log('###' + JSON.stringify(fileDependencies()) + '###'); }; diff --git a/tests/playwright-test/web-server.spec.ts b/tests/playwright-test/web-server.spec.ts index 4dee864767901..bb8d49c274984 100644 --- a/tests/playwright-test/web-server.spec.ts +++ b/tests/playwright-test/web-server.spec.ts @@ -574,7 +574,7 @@ test.describe('baseURL with plugins', () => { }); `, 'playwright.config.ts': ` - import { webServer } from '@playwright/test/lib/plugins'; + import { webServer } from 'playwright/lib/plugins'; module.exports = { _plugins: [ webServer({ @@ -599,7 +599,7 @@ test.describe('baseURL with plugins', () => { }); `, 'playwright.config.ts': ` - import { webServer } from '@playwright/test/lib/plugins'; + import { webServer } from 'playwright/lib/plugins'; module.exports = { webServer: { command: 'node ${JSON.stringify(SIMPLE_SERVER_PATH)} ${port}', diff --git a/tsconfig.json b/tsconfig.json index 669bc6d20de67..913e039570d60 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -15,11 +15,11 @@ "@isomorphic/*": ["./packages/playwright-core/src/utils/isomorphic/*"], "@protocol/*": ["./packages/protocol/src/*"], "@recorder/*": ["./packages/recorder/src/*"], - "@testIsomorphic/*": ["./packages/playwright-test/src/isomorphic/*"], + "@testIsomorphic/*": ["./packages/playwright/src/isomorphic/*"], "@trace/*": ["./packages/trace/src/*"], "@web/*": ["./packages/web/src/*"], "playwright-core/lib/*": ["./packages/playwright-core/src/*"], - "@playwright/test/lib/*": ["./packages/playwright-test/src/*"], + "playwright/lib/*": ["./packages/playwright/src/*"], }, "esModuleInterop": true, "strict": true, diff --git a/utils/check_deps.js b/utils/check_deps.js index fbcf5554c3e6c..ab1ed12072e8d 100644 --- a/utils/check_deps.js +++ b/utils/check_deps.js @@ -29,7 +29,7 @@ const packages = new Map(); packages.set('web', packagesDir + '/web/src/'); packages.set('injected', packagesDir + '/playwright-core/src/server/injected/'); packages.set('isomorphic', packagesDir + '/playwright-core/src/utils/isomorphic/'); -packages.set('testIsomorphic', packagesDir + '/playwright-test/src/isomorphic/'); +packages.set('testIsomorphic', packagesDir + '/playwright/src/isomorphic/'); const peerDependencies = ['electron', 'react', 'react-dom', '@zip.js/zip.js']; @@ -45,11 +45,11 @@ async function checkDeps() { await innerCheckDeps(path.join(packagesDir, 'web')); const corePackageJson = await innerCheckDeps(path.join(packagesDir, 'playwright-core')); - const testPackageJson = await innerCheckDeps(path.join(packagesDir, 'playwright-test')); + const playwrightPackageJson = await innerCheckDeps(path.join(packagesDir, 'playwright')); let hasVersionMismatch = false; for (const [key, value] of Object.entries(corePackageJson.dependencies || {})) { - const value2 = testPackageJson.dependencies[key]; + const value2 = playwrightPackageJson.dependencies[key]; if (value2 && value2 !== value) { hasVersionMismatch = true; console.log(`Dependency version mismatch ${key}: ${value} != ${value2}`); @@ -135,7 +135,7 @@ async function innerCheckDeps(root) { const mergedDeps = calculateDeps(fileName); if (mergedDeps.includes('***')) - return; + return; if (importPath) { if (!fs.existsSync(importPath)) { if (fs.existsSync(importPath + '.ts')) diff --git a/utils/generate_third_party_notice.js b/utils/generate_third_party_notice.js index 6ba2f451b9b39..8028b4b98f1f0 100644 --- a/utils/generate_third_party_notice.js +++ b/utils/generate_third_party_notice.js @@ -37,7 +37,7 @@ async function checkDir(dir) { } (async () => { - for (const project of ['playwright-core', 'playwright-test']) { + for (const project of ['playwright-core', 'playwright']) { const lines = []; lines.push(`microsoft/${project} diff --git a/utils/generate_types/index.js b/utils/generate_types/index.js index 811242d71ca11..f775dd2176940 100644 --- a/utils/generate_types/index.js +++ b/utils/generate_types/index.js @@ -657,13 +657,13 @@ class TypesGenerator { const coreTypesDir = path.join(PROJECT_DIR, 'packages', 'playwright-core', 'types'); if (!fs.existsSync(coreTypesDir)) fs.mkdirSync(coreTypesDir) - const testTypesDir = path.join(PROJECT_DIR, 'packages', 'playwright-test', 'types'); - if (!fs.existsSync(testTypesDir)) - fs.mkdirSync(testTypesDir) + const playwrightTypesDir = path.join(PROJECT_DIR, 'packages', 'playwright', 'types'); + if (!fs.existsSync(playwrightTypesDir)) + fs.mkdirSync(playwrightTypesDir) writeFile(path.join(coreTypesDir, 'protocol.d.ts'), fs.readFileSync(path.join(PROJECT_DIR, 'packages', 'playwright-core', 'src', 'server', 'chromium', 'protocol.d.ts'), 'utf8'), false); writeFile(path.join(coreTypesDir, 'types.d.ts'), await generateCoreTypes(false), true); - writeFile(path.join(testTypesDir, 'test.d.ts'), await generateTestTypes(false), true); - writeFile(path.join(testTypesDir, 'testReporter.d.ts'), await generateReporterTypes(false), true); + writeFile(path.join(playwrightTypesDir, 'test.d.ts'), await generateTestTypes(false), true); + writeFile(path.join(playwrightTypesDir, 'testReporter.d.ts'), await generateReporterTypes(false), true); process.exit(hadChanges && process.argv.includes('--check-clean') ? 1 : 0); })().catch(e => { console.error(e); diff --git a/utils/workspace.js b/utils/workspace.js index a45252308522e..a63fb79ce1c23 100755 --- a/utils/workspace.js +++ b/utils/workspace.js @@ -150,7 +150,7 @@ const workspace = new Workspace(ROOT_PATH, [ new PWPackage({ name: 'playwright', path: path.join(ROOT_PATH, 'packages', 'playwright'), - // We copy README.md additionally for Playwright so that it looks nice on NPM. + // We copy README.md additionally for playwright so that it looks nice on NPM. files: [...LICENCE_FILES, 'README.md'], }), new PWPackage({ @@ -161,7 +161,8 @@ const workspace = new Workspace(ROOT_PATH, [ new PWPackage({ name: '@playwright/test', path: path.join(ROOT_PATH, 'packages', 'playwright-test'), - files: LICENCE_FILES, + // We copy README.md additionally for @playwright/test so that it looks nice on NPM. + files: [...LICENCE_FILES, 'README.md'], }), new PWPackage({ name: 'playwright-webkit',