diff --git a/test/automation/src/terminal.ts b/test/automation/src/terminal.ts index 55d7b0c85c3..d2a043146c8 100644 --- a/test/automation/src/terminal.ts +++ b/test/automation/src/terminal.ts @@ -96,9 +96,13 @@ export class Terminal { } } - async createTerminal(assertLocation?: 'editor' | 'panel'): Promise { + /** + * Creates a terminal using the new terminal command. + * @param location The location to check the terminal for, defaults to panel. + */ + async createTerminal(location?: 'editor' | 'panel'): Promise { await this.runCommand(TerminalCommandId.CreateNew); - await this._waitForTerminal(assertLocation); + await this._waitForTerminal(location); } async assertEditorGroupCount(count: number): Promise { @@ -208,8 +212,12 @@ export class Terminal { return (this.code.driver as any).page; } - private async _waitForTerminal(value?: 'editor' | 'panel'): Promise { + /** + * Waits for the terminal to be focused and to contain content. + * @param location The location to check the terminal for, defaults to panel. + */ + private async _waitForTerminal(location?: 'editor' | 'panel'): Promise { await this.code.waitForElement(Selector.XtermFocused); - await this.code.waitForTerminalBuffer(value === 'editor' ? Selector.XtermEditor : Selector.Xterm, lines => lines.some(line => line.length > 0)); + await this.code.waitForTerminalBuffer(location === 'editor' ? Selector.XtermEditor : Selector.Xterm, lines => lines.some(line => line.length > 0)); } }