Merge VS Code 1.23.1 (#1520)

This commit is contained in:
Matt Irvine
2018-06-05 11:24:51 -07:00
committed by GitHub
parent e3baf5c443
commit 0c58f09e59
3651 changed files with 74249 additions and 48599 deletions

View File

@@ -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');
});
});
}

View File

@@ -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`);
}
}