Merge from vscode e3c4990c67c40213af168300d1cfeb71d680f877 (#16569)

This commit is contained in:
Cory Rivera
2021-08-25 16:28:29 -07:00
committed by GitHub
parent ab1112bfb3
commit cb7b7da0a4
1752 changed files with 59525 additions and 33878 deletions

View File

@@ -1,6 +1,6 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import * as fs from 'fs';

View File

@@ -140,6 +140,7 @@ export async function spawn(options: SpawnOptions): Promise<Code> {
'--disable-updates',
'--disable-keytar',
'--disable-crash-reporter',
'--disable-workspace-trust',
`--extensions-dir=${options.extensionsPath}`,
`--user-data-dir=${options.userDataDir}`,
'--driver', handle
@@ -310,9 +311,9 @@ export class Code {
return element.textContent;
}
async waitAndClick(selector: string, xoffset?: number, yoffset?: number): Promise<void> {
async waitAndClick(selector: string, xoffset?: number, yoffset?: number, retryCount: number = 200): Promise<void> {
const windowId = await this.getActiveWindowId();
await poll(() => this.driver.click(windowId, selector, xoffset, yoffset), () => true, `click '${selector}'`);
await poll(() => this.driver.click(windowId, selector, xoffset, yoffset), () => true, `click '${selector}'`, retryCount);
}
async waitAndDoubleClick(selector: string): Promise<void> {

View File

@@ -9,4 +9,4 @@ exports.connect = function (outPath, handle) {
const bootstrapPath = path.join(outPath, 'bootstrap-amd.js');
const { load } = require(bootstrapPath);
return new Promise((c, e) => load('vs/platform/driver/node/driver', ({ connect }) => connect(handle).then(c, e), e));
};
};

View File

@@ -39,4 +39,4 @@ export class MultiLogger implements Logger {
logger.log(message, ...args);
}
}
}
}

View File

@@ -35,6 +35,7 @@ function buildDriver(browser: playwright.Browser, page: playwright.Page): IDrive
getWindowIds: () => {
return Promise.resolve([1]);
},
// {{SQL CARBON EDIT}}
capturePage: async () => {
const buffer = await page.screenshot();
return buffer.toString('base64');

View File

@@ -43,6 +43,11 @@ export class Search extends Viewlet {
await this.waitForInputFocus(INPUT);
}
async getSearchTooltip(): Promise<any> {
const icon = await this.code.waitForElement(`.activitybar .action-label.codicon.codicon-search-view-icon`, (el) => !!el?.attributes?.['title']);
return icon.attributes['title'];
}
async searchFor(text: string): Promise<void> {
await this.waitForInputFocus(INPUT);
await this.code.waitForSetValue(INPUT, text);