From 75e18f220a3112a32864b0465f6c08b2351ec9a8 Mon Sep 17 00:00:00 2001 From: Sandeep Somavarapu Date: Fri, 8 Sep 2017 12:52:55 +0200 Subject: [PATCH] smoke: add timeout descriptions --- test/smoke/src/areas/terminal/terminal.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/smoke/src/areas/terminal/terminal.ts b/test/smoke/src/areas/terminal/terminal.ts index 409a78dd2c9..841c2308081 100644 --- a/test/smoke/src/areas/terminal/terminal.ts +++ b/test/smoke/src/areas/terminal/terminal.ts @@ -17,7 +17,7 @@ export class Terminal { if (!await this.isVisible()) { await this.spectron.workbench.commandPallette.runCommand('View: Toggle Integrated Terminal'); await this.spectron.client.waitForElement(Terminal.TERMINAL_SELECTOR); - await this.waitForTerminalText(text => !!text[text.length - 1] && text[text.length - 1].trim().indexOf('vscode-smoketest-express') !== -1); + await this.waitForTerminalText(text => !!text[text.length - 1] && text[text.length - 1].trim().indexOf('vscode-smoketest-express') !== -1, 'Waiting for Terminal to be ready'); } } @@ -32,18 +32,18 @@ export class Terminal { } public async waitForTextInLine(line: number, fn: (text: string) => boolean): Promise { - const terminalText = await this.waitForTerminalText(terminalText => fn(terminalText[line - 1])); + const terminalText = await this.waitForTerminalText(terminalText => fn(terminalText[line - 1]), 'Waiting for Text in line ' + line); return terminalText[line - 1]; } - public async waitForTerminalText(fn: (text: string[]) => boolean): Promise { + public async waitForTerminalText(fn: (text: string[]) => boolean, timeOutDescription: string = 'Getting Terminal Text'): Promise { return this.spectron.client.waitFor(async () => { const terminalText = await this.getTerminalText(); if (fn(terminalText)) { return terminalText; } return undefined; - }, void 0, 'Getting terminal text'); + }, void 0, timeOutDescription); } public getCurrentLineNumber(): Promise { -- GitLab