Change browserType back to sync

This commit is contained in:
Daniel Imms
2020-02-15 05:51:39 -08:00
parent cb1353c898
commit 477b161ba2
13 changed files with 14 additions and 16 deletions
@@ -16,7 +16,7 @@ const height = 600;
describe('AttachAddon', () => {
before(async function(): Promise<any> {
const browserType = await getBrowserType();
const browserType = getBrowserType();
browser = await browserType.launch({
headless: process.argv.indexOf('--headless') !== -1,
args: [`--window-size=${width},${height}`, `--no-sandbox`]
+1 -1
View File
@@ -18,7 +18,7 @@ let isFirefox = false;
describe('FitAddon', () => {
before(async function(): Promise<any> {
const browserType = await getBrowserType();
const browserType = getBrowserType();
browser = await browserType.launch({
headless: process.argv.indexOf('--headless') !== -1,
args: [`--window-size=${width},${height}`, `--no-sandbox`]
@@ -18,7 +18,7 @@ const height = 600;
describe('Search Tests', function(): void {
before(async function(): Promise<any> {
const browserType = await getBrowserType();
const browserType = getBrowserType();
browser = await browserType.launch({
headless: process.argv.indexOf('--headless') !== -1,
args: [`--window-size=${width},${height}`, `--no-sandbox`]
@@ -16,7 +16,7 @@ const height = 600;
describe('SerializeAddon', () => {
before(async function(): Promise<any> {
const browserType = await getBrowserType();
const browserType = getBrowserType();
browser = await browserType.launch({
headless: process.argv.indexOf('--headless') !== -1,
args: [`--window-size=${width},${height}`]
@@ -16,7 +16,7 @@ const height = 600;
describe('Unicode11Addon', () => {
before(async function(): Promise<any> {
const browserType = await getBrowserType();
const browserType = getBrowserType();
browser = await browserType.launch({
headless: process.argv.indexOf('--headless') !== -1,
args: [`--window-size=${width},${height}`, `--no-sandbox`]
@@ -16,7 +16,7 @@ const height = 600;
describe('WebLinksAddon', () => {
before(async function(): Promise<any> {
const browserType = await getBrowserType();
const browserType = getBrowserType();
browser = await browserType.launch({
headless: process.argv.indexOf('--headless') !== -1,
args: [`--window-size=${width},${height}`, `--no-sandbox`]
@@ -19,7 +19,7 @@ const height = 600;
let itWebgl: (expectation: string, callback?: (this: Mocha.ITestCallbackContext, done: MochaDone) => any) => Mocha.ITest | void;
describe('WebGL Renderer Integration Tests', async () => {
const browserType = await getBrowserType();
const browserType = getBrowserType();
const isHeadless = process.argv.indexOf('--headless') !== -1;
// Firefox works only in non-headless mode https://github.com/microsoft/playwright/issues/1032
const areTestsEnabled = browserType.name() === 'chromium' || (browserType.name() === 'firefox' && !isHeadless);
@@ -898,7 +898,7 @@ async function getCellColor(col: number, row: number): Promise<number[]> {
}
async function setupBrowser(options: ITerminalOptions = { rendererType: 'dom' }): Promise<void> {
const browserType = await getBrowserType();
const browserType = getBrowserType();
browser = await browserType.launch({
headless: process.argv.indexOf('--headless') !== -1,
args: [`--window-size=${width},${height}`, `--no-sandbox`]
+1 -1
View File
@@ -15,7 +15,7 @@ const height = 600;
describe('CharWidth Integration Tests', function(): void {
before(async function(): Promise<any> {
const browserType = await getBrowserType();
const browserType = getBrowserType();
browser = await browserType.launch({
headless: process.argv.indexOf('--headless') !== -1,
args: [`--window-size=${width},${height}`, `--no-sandbox`]
+1 -1
View File
@@ -19,7 +19,7 @@ let isChromium = false;
describe('InputHandler Integration Tests', function(): void {
before(async function(): Promise<any> {
const browserType = await getBrowserType();
const browserType = getBrowserType();
isChromium = browserType.name() === 'chromium';
browser = await browserType.launch({
headless: process.argv.indexOf('--headless') !== -1,
+1 -1
View File
@@ -208,7 +208,7 @@ function parseReport(encoding: string, msg: number[]): { state: any; row: number
* Mouse tracking tests.
*/
describe('Mouse Tracking Tests', async () => {
const browserType = await getBrowserType();
const browserType = getBrowserType();
browserType.name() === 'chromium';
const itMouse = isChromium ? it : it.skip;
+1 -1
View File
@@ -16,7 +16,7 @@ const height = 600;
describe('Parser Integration Tests', function(): void {
before(async function(): Promise<any> {
const browserType = await getBrowserType();
const browserType = getBrowserType();
browser = await browserType.launch({
headless: process.argv.indexOf('--headless') !== -1,
args: [`--window-size=${width},${height}`, `--no-sandbox`]
+1 -1
View File
@@ -16,7 +16,7 @@ const height = 600;
describe('API Integration Tests', function(): void {
before(async () => {
const browserType = await getBrowserType();
const browserType = getBrowserType();
browser = await browserType.launch({
headless: process.argv.indexOf('--headless') !== -1,
args: [`--window-size=${width},${height}`, `--no-sandbox`]
+1 -3
View File
@@ -41,7 +41,7 @@ export async function openTerminal(page: playwright.Page, options: ITerminalOpti
}
}
export async function getBrowserType(): Promise<playwright.BrowserType> {
export function getBrowserType(): playwright.BrowserType {
// Default to chromium
let browserType: playwright.BrowserType = playwright['chromium'];
@@ -53,7 +53,5 @@ export async function getBrowserType(): Promise<playwright.BrowserType> {
}
}
await browserType.downloadBrowserIfNeeded();
return browserType;
}