Skip to content

Commit a6a018d

Browse files
committedApr 20, 2021
fix type references

File tree

6 files changed

+17
-10
lines changed

6 files changed

+17
-10
lines changed
 

Diff for: ‎.changeset/spotty-points-press.md

+7
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

Diff for: ‎.husky/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
_

Diff for: ‎packages/test-runner-chrome/src/index.ts

+1-1
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 {

Diff for: ‎packages/test-runner-commands/src/a11ySnapshotPlugin.ts

+4-6
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);

Diff for: ‎packages/test-runner-commands/src/sendKeysPlugin.ts

+2-2
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
}

Diff for: ‎packages/test-runner-playwright/src/index.ts

+2-1
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)
Please sign in to comment.