From 9d1a7abe35e863ca89b68b69293c2252d89ab443 Mon Sep 17 00:00:00 2001 From: Daniel Imms <2193314+Tyriar@users.noreply.github.com> Date: Mon, 13 Dec 2021 16:57:14 -0800 Subject: [PATCH] Some jsdoc --- test/automation/src/terminal.ts | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) 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)); } }