mirror of
https://github.com/Microsoft/vscode
synced 2024-07-17 02:57:19 +00:00
fix #137590
This commit is contained in:
parent
6729fbbc86
commit
4e303fcc52
|
@ -72,7 +72,7 @@ class PlaywrightDriver implements IDriver {
|
|||
await timeout(100);
|
||||
}
|
||||
|
||||
if (keybinding.startsWith('Alt') || keybinding.startsWith('Control')) {
|
||||
if (keybinding.startsWith('Alt') || keybinding.startsWith('Control') || keybinding.startsWith('Backspace')) {
|
||||
await this._page.keyboard.press(keybinding);
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -64,10 +64,13 @@ export class Terminal {
|
|||
}
|
||||
|
||||
async runCommandWithValue(commandId: TerminalCommandIdWithValue, value?: string, altKey?: boolean): Promise<void> {
|
||||
const shouldKeepOpen = !!value || commandId === TerminalCommandIdWithValue.SelectDefaultProfile || commandId === TerminalCommandIdWithValue.NewWithProfile;
|
||||
const shouldKeepOpen = !!value || commandId === TerminalCommandIdWithValue.SelectDefaultProfile || commandId === TerminalCommandIdWithValue.NewWithProfile || commandId === TerminalCommandIdWithValue.Rename;
|
||||
await this.quickaccess.runCommand(commandId, shouldKeepOpen);
|
||||
if (value) {
|
||||
await this.code.waitForSetValue(QuickInput.QUICK_INPUT_INPUT, value);
|
||||
} else if (commandId === TerminalCommandIdWithValue.Rename) {
|
||||
// Reset
|
||||
await this.code.dispatchKeybinding('Backspace');
|
||||
}
|
||||
await this.code.dispatchKeybinding(altKey ? 'Alt+Enter' : 'enter');
|
||||
await this.quickinput.waitForQuickInputClosed();
|
||||
|
@ -108,6 +111,10 @@ export class Terminal {
|
|||
}
|
||||
}
|
||||
|
||||
async getSingleTabName(): Promise<string> {
|
||||
return await (await this.code.waitForElement(Selector.SingleTab, singleTab => !!singleTab && singleTab?.textContent.length > 1)).textContent;
|
||||
}
|
||||
|
||||
private async assertTabExpected(selector?: string, listIndex?: number, nameRegex?: RegExp, icon?: string, color?: string): Promise<void> {
|
||||
if (listIndex) {
|
||||
if (nameRegex) {
|
||||
|
|
|
@ -67,6 +67,15 @@ export function setup(opts: ParsedArgs) {
|
|||
await terminal.assertSingleTab({ name });
|
||||
});
|
||||
|
||||
it('should reset the tab name to the default value when no name is provided', async () => {
|
||||
await terminal.runCommand(TerminalCommandId.Show);
|
||||
const defaultName = await terminal.getSingleTabName();
|
||||
const name = 'my terminal name';
|
||||
await terminal.runCommandWithValue(TerminalCommandIdWithValue.Rename, name);
|
||||
await terminal.runCommandWithValue(TerminalCommandIdWithValue.Rename, undefined);
|
||||
await terminal.assertSingleTab({ name: defaultName });
|
||||
});
|
||||
|
||||
it('should rename the tab in the tabs list', async () => {
|
||||
await terminal.runCommand(TerminalCommandId.Show);
|
||||
await terminal.runCommand(TerminalCommandId.Split);
|
||||
|
|
Loading…
Reference in a new issue