This commit is contained in:
Sandeep Somavarapu 2020-12-02 17:48:16 +01:00
parent df2c328e59
commit 0ac5e95251
2 changed files with 8 additions and 8 deletions

View file

@ -11,7 +11,7 @@ export class KeybindingsEditor {
constructor(private code: Code) { }
async updateKeybinding(command: string, keybinding: string, title: string): Promise<any> {
async updateKeybinding(command: string, commandName: string | undefined, keybinding: string, keybindingTitle: string): Promise<any> {
if (process.platform === 'darwin') {
await this.code.dispatchKeybinding('cmd+k cmd+s');
} else {
@ -19,16 +19,16 @@ export class KeybindingsEditor {
}
await this.code.waitForActiveElement(SEARCH_INPUT);
await this.code.waitForSetValue(SEARCH_INPUT, command);
await this.code.waitForSetValue(SEARCH_INPUT, `@command:${command}`);
await this.code.waitAndClick('.keybindings-list-container .monaco-list-row.keybinding-item');
await this.code.waitForElement('.keybindings-list-container .monaco-list-row.keybinding-item.focused.selected');
const commandTitle = commandName ? `${commandName} (${command})` : command;
await this.code.waitAndClick(`.keybindings-list-container .monaco-list-row.keybinding-item .command span.monaco-highlighted-label[title="${commandTitle}"]`);
await this.code.waitForElement(`.keybindings-list-container .monaco-list-row.keybinding-item.focused.selected .command span.monaco-highlighted-label[title="${commandTitle}"]`);
await this.code.dispatchKeybinding('enter');
await this.code.waitAndClick('.keybindings-list-container .monaco-list-row.keybinding-item .action-item .codicon-keybindings-add');
await this.code.waitForActiveElement('.defineKeybindingWidget .monaco-inputbox input');
await this.code.dispatchKeybinding(keybinding);
await this.code.dispatchKeybinding('enter');
await this.code.waitForElement(`.keybindings-list-container .keybinding-label div[title="${title}"]`);
await this.code.waitForElement(`.keybindings-list-container .keybinding-label div[title="${keybindingTitle}"]`);
}
}

View file

@ -22,7 +22,7 @@ export function setup() {
const app = this.app as Application;
await app.workbench.activitybar.waitForActivityBar(ActivityBarPosition.LEFT);
await app.workbench.keybindingsEditor.updateKeybinding('workbench.action.toggleSidebarPosition', 'ctrl+u', 'Control+U');
await app.workbench.keybindingsEditor.updateKeybinding('workbench.action.toggleSidebarPosition', 'View: Toggle Side Bar Position', 'ctrl+u', 'Control+U');
await app.code.dispatchKeybinding('ctrl+u');
await app.workbench.activitybar.waitForActivityBar(ActivityBarPosition.RIGHT);