From 0ac5e95251d92554d82a252420222834eec8e1c7 Mon Sep 17 00:00:00 2001 From: Sandeep Somavarapu Date: Wed, 2 Dec 2020 17:48:16 +0100 Subject: [PATCH] Fix #109644 --- test/automation/src/keybindings.ts | 14 +++++++------- .../src/areas/preferences/preferences.test.ts | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/test/automation/src/keybindings.ts b/test/automation/src/keybindings.ts index 1de40d42bc9..4978ad09cd4 100644 --- a/test/automation/src/keybindings.ts +++ b/test/automation/src/keybindings.ts @@ -11,7 +11,7 @@ export class KeybindingsEditor { constructor(private code: Code) { } - async updateKeybinding(command: string, keybinding: string, title: string): Promise { + async updateKeybinding(command: string, commandName: string | undefined, keybinding: string, keybindingTitle: string): Promise { 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}"]`); } } diff --git a/test/smoke/src/areas/preferences/preferences.test.ts b/test/smoke/src/areas/preferences/preferences.test.ts index 1ea98dc7481..69652142369 100644 --- a/test/smoke/src/areas/preferences/preferences.test.ts +++ b/test/smoke/src/areas/preferences/preferences.test.ts @@ -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);