Skip to content

Commit

Permalink
remove type casting to work with playwright-core
Browse files Browse the repository at this point in the history
  • Loading branch information
flaurida committed Aug 11, 2020
1 parent ef4bb48 commit 6f5e5fd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
5 changes: 1 addition & 4 deletions src/utils/context/register.ts
Expand Up @@ -49,10 +49,7 @@ export const getArtifactPath = (): string | null => {
return artifactPath;
};

// playwright-core types are out of date
export const register = async (
context: BrowserContext | any,
): Promise<void> => {
export const register = async (context: BrowserContext): Promise<void> => {
Registry.instance().setContext(context);

if (isRegistered(context)) return;
Expand Down
4 changes: 2 additions & 2 deletions test/browser.ts
Expand Up @@ -11,8 +11,8 @@ export const connect = async (): Promise<ChromiumBrowser> => {
if (!wsEndpoint) {
throw new Error('Must provide QAW_WS_ENDPOINT env variable');
}
// cast as ChromiumBrowser from playwright-core to make the types work
const browser = (await chromium.connect({ wsEndpoint })) as ChromiumBrowser;

const browser = await chromium.connect({ wsEndpoint });
Registry.instance().setBrowser(browser);

debug('connected to browser');
Expand Down

0 comments on commit 6f5e5fd

Please sign in to comment.