smoke - headless option is troublesome

This commit is contained in:
Benjamin Pasero 2020-02-11 17:35:53 +01:00
parent 06b06ca10a
commit 35379aba75
5 changed files with 7 additions and 11 deletions

View file

@ -22,6 +22,8 @@
"i18n/**": true,
"extensions/**/out/**": true,
"test/smoke/out/**": true,
"test/automation/out/**": true,
"test/integration/browser/out/**": true,
"src/vs/base/test/node/uri.test.data.txt": true
},
"lcov.path": [

View file

@ -126,8 +126,7 @@ export class Application {
extraArgs,
remote: this.options.remote,
web: this.options.web,
browser: this.options.browser,
headless: this.options.headless
browser: this.options.browser
});
this._workbench = new Workbench(this._code, this.userDataPath);

View file

@ -103,8 +103,6 @@ export interface SpawnOptions {
web?: boolean;
/** A specific browser to use (requires web: true) */
browser?: 'chromium' | 'webkit' | 'firefox';
/** Run in headless mode (only applies when web is true) */
headless?: boolean;
}
async function createDriverHandle(): Promise<string> {
@ -127,7 +125,7 @@ export async function spawn(options: SpawnOptions): Promise<Code> {
if (options.web) {
await launch(options.userDataDir, options.workspacePath, options.codePath);
connectDriver = connectPlaywrightDriver.bind(connectPlaywrightDriver, !!options.headless, options.browser);
connectDriver = connectPlaywrightDriver.bind(connectPlaywrightDriver, options.browser);
} else {
const env = process.env;

View file

@ -137,12 +137,11 @@ function waitForEndpoint(): Promise<string> {
});
}
export function connect(headless: boolean, engine: 'chromium' | 'webkit' | 'firefox' = 'chromium'): Promise<{ client: IDisposable, driver: IDriver }> {
export function connect(engine: 'chromium' | 'webkit' | 'firefox' = 'chromium'): Promise<{ client: IDisposable, driver: IDriver }> {
return new Promise(async (c) => {
const browser = await playwright[engine].launch({
// Run in Edge dev on macOS
// executablePath: '/Applications/Microsoft\ Edge\ Dev.app/Contents/MacOS/Microsoft\ Edge\ Dev',
headless
// executablePath: '/Applications/Microsoft\ Edge\ Dev.app/Contents/MacOS/Microsoft\ Edge\ Dev'
});
const page = (await browser.defaultContext().pages())[0];
await page.setViewport({ width, height });

View file

@ -58,7 +58,6 @@ const opts = minimist(args, {
'verbose',
'remote',
'web',
'headless',
'ci'
],
default: {
@ -246,8 +245,7 @@ function createOptions(): ApplicationOptions {
screenshotsPath,
remote: opts.remote,
web: opts.web,
browser: opts.browser,
headless: opts.headless
browser: opts.browser
};
}