mirror of
https://github.com/Microsoft/vscode
synced 2024-08-26 20:39:37 +00:00
Fix #109644
This commit is contained in:
parent
df2c328e59
commit
0ac5e95251
|
@ -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 {
|
||||||
}
|
}
|
||||||
|
|
||||||
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() {
|
||||||
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);
|
||||||
|
|
Loading…
Reference in a new issue