mirror of
https://github.com/Microsoft/vscode
synced 2024-08-26 12:29:37 +00:00
smoke - headless option is troublesome
This commit is contained in:
parent
06b06ca10a
commit
35379aba75
2
.vscode/settings.json
vendored
2
.vscode/settings.json
vendored
|
@ -22,6 +22,8 @@
|
||||||
"i18n/**": true,
|
"i18n/**": true,
|
||||||
"extensions/**/out/**": true,
|
"extensions/**/out/**": true,
|
||||||
"test/smoke/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
|
"src/vs/base/test/node/uri.test.data.txt": true
|
||||||
},
|
},
|
||||||
"lcov.path": [
|
"lcov.path": [
|
||||||
|
|
|
@ -126,8 +126,7 @@ export class Application {
|
||||||
extraArgs,
|
extraArgs,
|
||||||
remote: this.options.remote,
|
remote: this.options.remote,
|
||||||
web: this.options.web,
|
web: this.options.web,
|
||||||
browser: this.options.browser,
|
browser: this.options.browser
|
||||||
headless: this.options.headless
|
|
||||||
});
|
});
|
||||||
|
|
||||||
this._workbench = new Workbench(this._code, this.userDataPath);
|
this._workbench = new Workbench(this._code, this.userDataPath);
|
||||||
|
|
|
@ -103,8 +103,6 @@ export interface SpawnOptions {
|
||||||
web?: boolean;
|
web?: boolean;
|
||||||
/** A specific browser to use (requires web: true) */
|
/** A specific browser to use (requires web: true) */
|
||||||
browser?: 'chromium' | 'webkit' | 'firefox';
|
browser?: 'chromium' | 'webkit' | 'firefox';
|
||||||
/** Run in headless mode (only applies when web is true) */
|
|
||||||
headless?: boolean;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async function createDriverHandle(): Promise<string> {
|
async function createDriverHandle(): Promise<string> {
|
||||||
|
@ -127,7 +125,7 @@ export async function spawn(options: SpawnOptions): Promise<Code> {
|
||||||
|
|
||||||
if (options.web) {
|
if (options.web) {
|
||||||
await launch(options.userDataDir, options.workspacePath, options.codePath);
|
await launch(options.userDataDir, options.workspacePath, options.codePath);
|
||||||
connectDriver = connectPlaywrightDriver.bind(connectPlaywrightDriver, !!options.headless, options.browser);
|
connectDriver = connectPlaywrightDriver.bind(connectPlaywrightDriver, options.browser);
|
||||||
} else {
|
} else {
|
||||||
const env = process.env;
|
const env = process.env;
|
||||||
|
|
||||||
|
|
|
@ -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) => {
|
return new Promise(async (c) => {
|
||||||
const browser = await playwright[engine].launch({
|
const browser = await playwright[engine].launch({
|
||||||
// Run in Edge dev on macOS
|
// Run in Edge dev on macOS
|
||||||
// executablePath: '/Applications/Microsoft\ Edge\ Dev.app/Contents/MacOS/Microsoft\ Edge\ Dev',
|
// executablePath: '/Applications/Microsoft\ Edge\ Dev.app/Contents/MacOS/Microsoft\ Edge\ Dev'
|
||||||
headless
|
|
||||||
});
|
});
|
||||||
const page = (await browser.defaultContext().pages())[0];
|
const page = (await browser.defaultContext().pages())[0];
|
||||||
await page.setViewport({ width, height });
|
await page.setViewport({ width, height });
|
||||||
|
|
|
@ -58,7 +58,6 @@ const opts = minimist(args, {
|
||||||
'verbose',
|
'verbose',
|
||||||
'remote',
|
'remote',
|
||||||
'web',
|
'web',
|
||||||
'headless',
|
|
||||||
'ci'
|
'ci'
|
||||||
],
|
],
|
||||||
default: {
|
default: {
|
||||||
|
@ -246,8 +245,7 @@ function createOptions(): ApplicationOptions {
|
||||||
screenshotsPath,
|
screenshotsPath,
|
||||||
remote: opts.remote,
|
remote: opts.remote,
|
||||||
web: opts.web,
|
web: opts.web,
|
||||||
browser: opts.browser,
|
browser: opts.browser
|
||||||
headless: opts.headless
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue