Skip to content

Commit a6a018d

Browse files
committed
fix type references
1 parent 2c06f31 commit a6a018d

6 files changed

Lines changed: 17 additions & 10 deletions

File tree

.changeset/spotty-points-press.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
'@web/test-runner-chrome': patch
3+
'@web/test-runner-commands': patch
4+
'@web/test-runner-playwright': patch
5+
---
6+
7+
fix type references

.husky/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
_

packages/test-runner-chrome/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export interface ChromeLauncherArgs {
1010
concurrency?: number;
1111
}
1212

13-
export { ChromeLauncher, devices };
13+
export { ChromeLauncher, devices, puppeteerCore };
1414

1515
export function chromeLauncher(args: ChromeLauncherArgs = {}) {
1616
const {

packages/test-runner-commands/src/a11ySnapshotPlugin.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import { TestRunnerPlugin } from '@web/test-runner-core';
2-
import type { ChromeLauncher } from '@web/test-runner-chrome';
3-
import type { PlaywrightLauncher } from '@web/test-runner-playwright';
4-
import type { ElementHandle as PlaywrightElementHandle } from 'playwright';
5-
import type { ElementHandle as PuppeteerElementHandle } from 'puppeteer';
2+
import type { ChromeLauncher, puppeteerCore } from '@web/test-runner-chrome';
3+
import type { PlaywrightLauncher, playwright } from '@web/test-runner-playwright';
64

75
export type A11ySnapshotPayload = { selector?: string };
86

@@ -15,7 +13,7 @@ export function a11ySnapshotPlugin(): TestRunnerPlugin<A11ySnapshotPayload> {
1513
if (session.browser.type === 'playwright') {
1614
const page = (session.browser as PlaywrightLauncher).getPage(session.id);
1715
const options: {
18-
root?: PlaywrightElementHandle;
16+
root?: playwright.ElementHandle;
1917
} = {};
2018
if (payload && payload.selector) {
2119
const root = await page.$(payload.selector);
@@ -31,7 +29,7 @@ export function a11ySnapshotPlugin(): TestRunnerPlugin<A11ySnapshotPayload> {
3129
if (session.browser.type === 'puppeteer') {
3230
const page = (session.browser as ChromeLauncher).getPage(session.id);
3331
const options: {
34-
root?: PuppeteerElementHandle;
32+
root?: puppeteerCore.ElementHandle;
3533
} = {};
3634
if (payload && payload.selector) {
3735
const root = await page.$(payload.selector);

packages/test-runner-commands/src/sendKeysPlugin.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { TestRunnerPlugin } from '@web/test-runner-core';
2-
import type { ChromeLauncher } from '@web/test-runner-chrome';
2+
import type { ChromeLauncher, puppeteerCore } from '@web/test-runner-chrome';
33
import type { PlaywrightLauncher } from '@web/test-runner-playwright';
44

55
export type SendKeysPayload =
@@ -54,7 +54,7 @@ export function sendKeysPlugin(): TestRunnerPlugin<SendKeysPayload> {
5454
await page.keyboard.type(payload.type);
5555
return true;
5656
} else if (payload.press) {
57-
await page.keyboard.press(payload.press);
57+
await page.keyboard.press(payload.press as puppeteerCore.KeyInput);
5858
return true;
5959
}
6060
}

packages/test-runner-playwright/src/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { LaunchOptions, devices } from 'playwright';
2+
import * as playwright from 'playwright';
23
import {
34
PlaywrightLauncher,
45
ProductType,
@@ -8,7 +9,7 @@ import {
89

910
const validProductTypes: ProductType[] = ['chromium', 'firefox', 'webkit'];
1011

11-
export { ProductType };
12+
export { ProductType, playwright };
1213

1314
export interface PlaywrightLauncherArgs {
1415
product?: ProductType;

0 commit comments

Comments
 (0)