Move to playwright-core, download browser if needed

This commit is contained in:
Daniel Imms
2020-02-15 05:28:21 -08:00
parent 4ebb61b580
commit ffc5e2f446
15 changed files with 50 additions and 40 deletions
+4 -2
View File
@@ -3,7 +3,7 @@
* @license MIT
*/
import * as playwright from 'playwright';
import * as playwright from 'playwright-core';
import deepEqual = require('deep-equal');
import { ITerminalOptions } from 'xterm';
@@ -41,7 +41,7 @@ export async function openTerminal(page: playwright.Page, options: ITerminalOpti
}
}
export function getBrowserType(): playwright.BrowserType {
export async function getBrowserType(): Promise<playwright.BrowserType> {
// Default to chromium
let browserType: playwright.BrowserType = playwright['chromium'];
@@ -53,5 +53,7 @@ export function getBrowserType(): playwright.BrowserType {
}
}
await browserType.downloadBrowserIfNeeded();
return browserType;
}