mirror of
https://github.com/Microsoft/vscode
synced 2024-10-02 17:32:41 +00:00
parent
af0f039869
commit
63d4fe776b
|
@ -532,6 +532,16 @@ class ExtensionsContributions extends Disposable implements IWorkbenchContributi
|
|||
order: 3
|
||||
}));
|
||||
|
||||
this.registerExtensionAction({
|
||||
id: 'workbench.extensions.action.focusExtensionsView',
|
||||
title: { value: localize('focusExtensions', "Focus on Extensions View"), original: 'Focus on Extensions View' },
|
||||
category: ExtensionsLocalizedLabel,
|
||||
f1: true,
|
||||
run: async (accessor: ServicesAccessor) => {
|
||||
await accessor.get(IPaneCompositePartService).openPaneComposite(VIEWLET_ID, ViewContainerLocation.Sidebar, true);
|
||||
}
|
||||
});
|
||||
|
||||
this.registerExtensionAction({
|
||||
id: 'workbench.extensions.action.installExtensions',
|
||||
title: { value: localize('installExtensions', "Install Extensions"), original: 'Install Extensions' },
|
||||
|
|
|
@ -9,30 +9,18 @@ import path = require('path');
|
|||
import fs = require('fs');
|
||||
import { ncp } from 'ncp';
|
||||
import { promisify } from 'util';
|
||||
import { Commands } from './workbench';
|
||||
|
||||
const SEARCH_BOX = 'div.extensions-viewlet[id="workbench.view.extensions"] .monaco-editor textarea';
|
||||
const REFRESH_BUTTON = 'div.part.sidebar.left[id="workbench.parts.sidebar"] .codicon.codicon-extensions-refresh';
|
||||
|
||||
export class Extensions extends Viewlet {
|
||||
|
||||
constructor(code: Code) {
|
||||
constructor(code: Code, private commands: Commands) {
|
||||
super(code);
|
||||
}
|
||||
|
||||
async openExtensionsViewlet(): Promise<any> {
|
||||
if (process.platform === 'darwin') {
|
||||
await this.code.dispatchKeybinding('cmd+shift+x');
|
||||
} else {
|
||||
await this.code.dispatchKeybinding('ctrl+shift+x');
|
||||
}
|
||||
|
||||
await this.code.waitForActiveElement(SEARCH_BOX);
|
||||
}
|
||||
|
||||
async searchForExtension(id: string): Promise<any> {
|
||||
await this.code.waitAndClick(SEARCH_BOX);
|
||||
await this.code.waitForActiveElement(SEARCH_BOX);
|
||||
await this.code.waitForTypeInEditor(SEARCH_BOX, `@id:${id}`);
|
||||
await this.commands.runCommand('workbench.extensions.action.focusExtensionsView');
|
||||
await this.code.waitForTypeInEditor('div.extensions-viewlet[id="workbench.view.extensions"] .monaco-editor textarea', `@id:${id}`);
|
||||
await this.code.waitForTextContent(`div.part.sidebar div.composite.title h2`, 'Extensions: Marketplace');
|
||||
|
||||
let retrials = 1;
|
||||
|
@ -41,7 +29,7 @@ export class Extensions extends Viewlet {
|
|||
return await this.code.waitForElement(`div.extensions-viewlet[id="workbench.view.extensions"] .monaco-list-row[data-extension-id="${id}"]`, undefined, 100);
|
||||
} catch (error) {
|
||||
this.code.logger.log(`Extension '${id}' is not found. Retrying count: ${retrials}`);
|
||||
await this.code.waitAndClick(REFRESH_BUTTON);
|
||||
await this.commands.runCommand('workbench.extensions.action.refreshExtension');
|
||||
}
|
||||
}
|
||||
throw new Error(`Extension ${id} is not found`);
|
||||
|
|
|
@ -55,7 +55,7 @@ export class Workbench {
|
|||
this.explorer = new Explorer(code);
|
||||
this.activitybar = new ActivityBar(code);
|
||||
this.search = new Search(code);
|
||||
this.extensions = new Extensions(code);
|
||||
this.extensions = new Extensions(code, this.quickaccess);
|
||||
this.editor = new Editor(code, this.quickaccess);
|
||||
this.scm = new SCM(code);
|
||||
this.debug = new Debug(code, this.quickaccess, this.editors, this.editor);
|
||||
|
|
|
@ -7,7 +7,7 @@ import { Application, Logger } from '../../../../automation';
|
|||
import { installAllHandlers } from '../../utils';
|
||||
|
||||
export function setup(logger: Logger) {
|
||||
describe.skip('Extensions', () => {
|
||||
describe('Extensions', () => {
|
||||
|
||||
// Shared before/after handling
|
||||
installAllHandlers(logger);
|
||||
|
@ -15,7 +15,6 @@ export function setup(logger: Logger) {
|
|||
it('install and enable vscode-smoketest-check extension', async function () {
|
||||
const app = this.app as Application;
|
||||
|
||||
await app.workbench.extensions.openExtensionsViewlet();
|
||||
await app.workbench.extensions.installExtension('ms-vscode.vscode-smoketest-check', true);
|
||||
|
||||
// Close extension editor because keybindings dispatch is not working when web views are opened and focused
|
||||
|
|
|
@ -15,7 +15,6 @@ export function setup(logger: Logger) {
|
|||
it('starts with "DE" locale and verifies title and viewlets text is in German', async function () {
|
||||
const app = this.app as Application;
|
||||
|
||||
await app.workbench.extensions.openExtensionsViewlet();
|
||||
await app.workbench.extensions.installExtension('ms-ceintl.vscode-language-pack-de', false);
|
||||
await app.restart({ extraArgs: ['--locale=DE'] });
|
||||
|
||||
|
|
Loading…
Reference in a new issue