Get notebook smoketest working in web

Fix #98364
This commit is contained in:
Rob Lourens 2020-06-07 17:27:47 -05:00
parent a1de2a783a
commit 4d6da3154c
3 changed files with 9 additions and 6 deletions

View file

@ -120,8 +120,10 @@ export async function spawn(options: SpawnOptions): Promise<Code> {
let child: cp.ChildProcess | undefined;
let connectDriver: typeof connectElectronDriver;
copyExtension(options, 'vscode-notebook-tests');
if (options.web) {
await launch(options.userDataDir, options.workspacePath, options.codePath);
await launch(options.userDataDir, options.workspacePath, options.codePath, options.extensionsPath);
connectDriver = connectPlaywrightDriver.bind(connectPlaywrightDriver, options.browser);
return connect(connectDriver, child, '', handle, options.logger);
}
@ -156,7 +158,7 @@ export async function spawn(options: SpawnOptions): Promise<Code> {
env['TESTRESOLVER_DATA_FOLDER'] = remoteDataDir;
}
copyExtension(options, 'vscode-notebook-tests');
args.push('--enable-proposed-api=vscode.vscode-notebook-tests');
if (!codePath) {

View file

@ -91,7 +91,7 @@ let server: ChildProcess | undefined;
let endpoint: string | undefined;
let workspacePath: string | undefined;
export async function launch(userDataDir: string, _workspacePath: string, codeServerPath = process.env.VSCODE_REMOTE_SERVER_PATH): Promise<void> {
export async function launch(userDataDir: string, _workspacePath: string, codeServerPath = process.env.VSCODE_REMOTE_SERVER_PATH, extPath: string): Promise<void> {
workspacePath = _workspacePath;
const agentFolder = userDataDir;
@ -111,7 +111,7 @@ export async function launch(userDataDir: string, _workspacePath: string, codeSe
}
server = spawn(
serverLocation,
['--browser', 'none', '--driver', 'web'],
['--browser', 'none', '--driver', 'web', '--extensions-dir', extPath],
{ env }
);
server.stderr?.on('data', error => console.log(`Server stderr: ${error}`));
@ -146,7 +146,8 @@ export function connect(browserType: 'chromium' | 'webkit' | 'firefox' = 'chromi
const context = await browser.newContext();
const page = await context.newPage();
await page.setViewportSize({ width, height });
await page.goto(`${endpoint}&folder=vscode-remote://localhost:9888${URI.file(workspacePath!).path}`);
const payloadParam = `[["enableProposedApi",""]]`;
await page.goto(`${endpoint}&folder=vscode-remote://localhost:9888${URI.file(workspacePath!).path}&payload=${payloadParam}`);
const result = {
client: { dispose: () => browser.close() && teardown() },
driver: buildDriver(browser, page)

View file

@ -316,7 +316,7 @@ describe(`VSCode Smoke Tests (${opts.web ? 'Web' : 'Electron'})`, () => {
if (!opts.web) { setupDataLossTests(); }
if (!opts.web) { setupDataPreferencesTests(); }
setupDataSearchTests();
if (!opts.web) { setupDataNotebookTests(); }
setupDataNotebookTests();
setupDataLanguagesTests();
setupDataEditorTests();
setupDataStatusbarTests(!!opts.web);