mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-03-22 04:40:30 -04:00
Merge VS Code 1.23.1 (#1520)
This commit is contained in:
@@ -3,17 +3,12 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import * as assert from 'assert';
|
||||
import { SpectronApplication, Quality } from '../../spectron/application';
|
||||
import { Application, Quality } from '../../application';
|
||||
|
||||
export function setup() {
|
||||
describe('Extensions', () => {
|
||||
before(function () {
|
||||
this.app.suiteName = 'Extensions';
|
||||
});
|
||||
|
||||
it(`install and activate vscode-smoketest-check extension`, async function () {
|
||||
const app = this.app as SpectronApplication;
|
||||
const app = this.app as Application;
|
||||
|
||||
if (app.quality === Quality.Dev) {
|
||||
this.skip();
|
||||
@@ -23,16 +18,12 @@ export function setup() {
|
||||
const extensionName = 'vscode-smoketest-check';
|
||||
await app.workbench.extensions.openExtensionsViewlet();
|
||||
|
||||
const installed = await app.workbench.extensions.installExtension(extensionName);
|
||||
assert.ok(installed);
|
||||
await app.workbench.extensions.installExtension(extensionName);
|
||||
|
||||
await app.reload();
|
||||
await app.workbench.extensions.waitForExtensionsViewlet();
|
||||
await app.workbench.quickopen.runCommand('Smoke Test Check');
|
||||
|
||||
const statusbarText = await app.workbench.statusbar.getStatusbarTextByTitle('smoke test');
|
||||
await app.screenCapturer.capture('Statusbar');
|
||||
assert.equal(statusbarText, 'VS Code Smoke Test Check');
|
||||
await app.workbench.extensions.openExtensionsViewlet();
|
||||
await app.workbench.runCommand('Smoke Test Check');
|
||||
await app.workbench.statusbar.waitForStatusbarText('smoke test', 'VS Code Smoke Test Check');
|
||||
});
|
||||
});
|
||||
}
|
||||
@@ -3,40 +3,32 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { SpectronApplication } from '../../spectron/application';
|
||||
import { Viewlet } from '../workbench/viewlet';
|
||||
import { Commands } from '../workbench/workbench';
|
||||
import { Code } from '../../vscode/code';
|
||||
|
||||
const SEARCH_BOX = 'div.extensions-viewlet[id="workbench.view.extensions"] input.search-box';
|
||||
|
||||
export class Extensions extends Viewlet {
|
||||
|
||||
constructor(spectron: SpectronApplication) {
|
||||
super(spectron);
|
||||
constructor(code: Code, private commands: Commands) {
|
||||
super(code);
|
||||
}
|
||||
|
||||
async openExtensionsViewlet(): Promise<any> {
|
||||
await this.spectron.runCommand('workbench.view.extensions');
|
||||
await this.waitForExtensionsViewlet();
|
||||
}
|
||||
|
||||
async waitForExtensionsViewlet(): Promise<any> {
|
||||
await this.spectron.client.waitForActiveElement(SEARCH_BOX);
|
||||
await this.commands.runCommand('workbench.view.extensions');
|
||||
await this.code.waitForActiveElement(SEARCH_BOX);
|
||||
}
|
||||
|
||||
async searchForExtension(name: string): Promise<any> {
|
||||
await this.spectron.client.click(SEARCH_BOX);
|
||||
await this.spectron.client.waitForActiveElement(SEARCH_BOX);
|
||||
await this.spectron.client.setValue(SEARCH_BOX, name);
|
||||
await this.code.waitAndClick(SEARCH_BOX);
|
||||
await this.code.waitForActiveElement(SEARCH_BOX);
|
||||
await this.code.waitForSetValue(SEARCH_BOX, `name:"${name}"`);
|
||||
}
|
||||
|
||||
async installExtension(name: string): Promise<boolean> {
|
||||
async installExtension(name: string): Promise<void> {
|
||||
await this.searchForExtension(name);
|
||||
|
||||
// we might want to wait for a while longer since the Marketplace can be slow
|
||||
// a minute should do
|
||||
await this.spectron.client.waitFor(() => this.spectron.client.click(`div.extensions-viewlet[id="workbench.view.extensions"] .monaco-list-row[aria-label="${name}"] .extension li[class='action-item'] .extension-action.install`), void 0, 'waiting for install button', 600);
|
||||
|
||||
await this.spectron.client.waitForElement(`div.extensions-viewlet[id="workbench.view.extensions"] .monaco-list-row[aria-label="${name}"] .extension li[class='action-item'] .extension-action.reload`);
|
||||
return true;
|
||||
await this.code.waitAndClick(`div.extensions-viewlet[id="workbench.view.extensions"] .monaco-list-row[aria-label="${name}"] .extension li[class='action-item'] .extension-action.install`);
|
||||
await this.code.waitForElement(`div.extensions-viewlet[id="workbench.view.extensions"] .monaco-list-row[aria-label="${name}"] .extension li[class='action-item'] .extension-action.reload`);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user