mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-04 09:35:38 -05:00
Merge from vscode e3c4990c67c40213af168300d1cfeb71d680f877 (#16569)
This commit is contained in:
@@ -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';
|
||||
|
||||
@@ -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> {
|
||||
|
||||
@@ -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));
|
||||
};
|
||||
};
|
||||
|
||||
@@ -39,4 +39,4 @@ export class MultiLogger implements Logger {
|
||||
logger.log(message, ...args);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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');
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user