提交 0ac5e952 编写于 作者: S Sandeep Somavarapu

Fix #109644

上级 df2c328e
...@@ -11,7 +11,7 @@ export class KeybindingsEditor { ...@@ -11,7 +11,7 @@ export class KeybindingsEditor {
constructor(private code: Code) { } 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') { if (process.platform === 'darwin') {
await this.code.dispatchKeybinding('cmd+k cmd+s'); await this.code.dispatchKeybinding('cmd+k cmd+s');
} else { } else {
...@@ -19,16 +19,16 @@ export class KeybindingsEditor { ...@@ -19,16 +19,16 @@ export class KeybindingsEditor {
} }
await this.code.waitForActiveElement(SEARCH_INPUT); 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'); const commandTitle = commandName ? `${commandName} (${command})` : command;
await this.code.waitForElement('.keybindings-list-container .monaco-list-row.keybinding-item.focused.selected'); 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.waitForActiveElement('.defineKeybindingWidget .monaco-inputbox input');
await this.code.dispatchKeybinding(keybinding); await this.code.dispatchKeybinding(keybinding);
await this.code.dispatchKeybinding('enter'); 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}"]`);
} }
} }
...@@ -22,7 +22,7 @@ export function setup() { ...@@ -22,7 +22,7 @@ export function setup() {
const app = this.app as Application; const app = this.app as Application;
await app.workbench.activitybar.waitForActivityBar(ActivityBarPosition.LEFT); 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.code.dispatchKeybinding('ctrl+u');
await app.workbench.activitybar.waitForActivityBar(ActivityBarPosition.RIGHT); await app.workbench.activitybar.waitForActivityBar(ActivityBarPosition.RIGHT);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册