Skip to content

Commit

Permalink
chore: make @playwright/test depend on playwright (#26946)
Browse files Browse the repository at this point in the history
  • Loading branch information
dgozman committed Sep 8, 2023
1 parent 7c0766a commit 186f869
Show file tree
Hide file tree
Showing 165 changed files with 255 additions and 162 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pr_check_client_side_changes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Expand Down
4 changes: 2 additions & 2 deletions docs/src/release-notes-js.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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 |||||
Expand Down
16 changes: 8 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions packages/html-reporter/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
Expand Down
2 changes: 1 addition & 1 deletion packages/playwright-ct-core/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
4 changes: 2 additions & 2 deletions packages/playwright-ct-core/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down Expand Up @@ -63,4 +63,4 @@ export function defineConfig(config: PlaywrightTestConfig): PlaywrightTestConfig
export function defineConfig<T>(config: PlaywrightTestConfig<T>): PlaywrightTestConfig<T>;
export function defineConfig<T, W>(config: PlaywrightTestConfig<T, W>): PlaywrightTestConfig<T, W>;

export { expect, devices } from '@playwright/test';
export { expect, devices } from 'playwright/test';
2 changes: 1 addition & 1 deletion packages/playwright-ct-core/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down
2 changes: 1 addition & 1 deletion packages/playwright-ct-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions packages/playwright-ct-core/src/mount.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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[] = [];

Expand Down
6 changes: 3 additions & 3 deletions packages/playwright-ct-core/src/tsxTransform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<string, string | undefined>();
Expand Down
12 changes: 6 additions & 6 deletions packages/playwright-ct-core/src/vitePlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,23 @@
* 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';
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';

Expand Down
4 changes: 2 additions & 2 deletions packages/playwright-ct-react/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down Expand Up @@ -63,4 +63,4 @@ export function defineConfig(config: PlaywrightTestConfig): PlaywrightTestConfig
export function defineConfig<T>(config: PlaywrightTestConfig<T>): PlaywrightTestConfig<T>;
export function defineConfig<T, W>(config: PlaywrightTestConfig<T, W>): PlaywrightTestConfig<T, W>;

export { expect, devices } from '@playwright/test';
export { expect, devices } from 'playwright/test';
4 changes: 2 additions & 2 deletions packages/playwright-ct-react17/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down Expand Up @@ -63,4 +63,4 @@ export function defineConfig(config: PlaywrightTestConfig): PlaywrightTestConfig
export function defineConfig<T>(config: PlaywrightTestConfig<T>): PlaywrightTestConfig<T>;
export function defineConfig<T, W>(config: PlaywrightTestConfig<T, W>): PlaywrightTestConfig<T, W>;

export { expect, devices } from '@playwright/test';
export { expect, devices } from 'playwright/test';
4 changes: 2 additions & 2 deletions packages/playwright-ct-solid/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down Expand Up @@ -63,4 +63,4 @@ export function defineConfig(config: PlaywrightTestConfig): PlaywrightTestConfig
export function defineConfig<T>(config: PlaywrightTestConfig<T>): PlaywrightTestConfig<T>;
export function defineConfig<T, W>(config: PlaywrightTestConfig<T, W>): PlaywrightTestConfig<T, W>;

export { expect, devices } from '@playwright/test';
export { expect, devices } from 'playwright/test';
4 changes: 2 additions & 2 deletions packages/playwright-ct-svelte/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -71,4 +71,4 @@ export function defineConfig(config: PlaywrightTestConfig): PlaywrightTestConfig
export function defineConfig<T>(config: PlaywrightTestConfig<T>): PlaywrightTestConfig<T>;
export function defineConfig<T, W>(config: PlaywrightTestConfig<T, W>): PlaywrightTestConfig<T, W>;

export { expect, devices } from '@playwright/test';
export { expect, devices } from 'playwright/test';
4 changes: 2 additions & 2 deletions packages/playwright-ct-vue/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down Expand Up @@ -91,4 +91,4 @@ export function defineConfig(config: PlaywrightTestConfig): PlaywrightTestConfig
export function defineConfig<T>(config: PlaywrightTestConfig<T>): PlaywrightTestConfig<T>;
export function defineConfig<T, W>(config: PlaywrightTestConfig<T, W>): PlaywrightTestConfig<T, W>;

export { expect, devices } from '@playwright/test';
export { expect, devices } from 'playwright/test';
4 changes: 2 additions & 2 deletions packages/playwright-ct-vue2/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down Expand Up @@ -91,4 +91,4 @@ export function defineConfig(config: PlaywrightTestConfig): PlaywrightTestConfig
export function defineConfig<T>(config: PlaywrightTestConfig<T>): PlaywrightTestConfig<T>;
export function defineConfig<T, W>(config: PlaywrightTestConfig<T, W>): PlaywrightTestConfig<T, W>;

export { expect, devices } from '@playwright/test';
export { expect, devices } from 'playwright/test';
3 changes: 0 additions & 3 deletions packages/playwright-test/README.md

This file was deleted.

2 changes: 1 addition & 1 deletion packages/playwright-test/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
4 changes: 2 additions & 2 deletions packages/playwright-test/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
13 changes: 1 addition & 12 deletions packages/playwright-test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
16 changes: 2 additions & 14 deletions packages/playwright-test/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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';
27 changes: 6 additions & 21 deletions packages/playwright-test/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@
"engines": {
"node": ">=16"
},
"main": "index.js",
"author": {
"name": "Microsoft Corporation"
},
"license": "Apache-2.0",
"exports": {
".": {
"types": "./index.d.ts",
Expand All @@ -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"
}
}
Loading

0 comments on commit 186f869

Please sign in to comment.