fix terminal smoketests

fixes #48396
This commit is contained in:
Joao Moreno
2018-05-02 12:29:39 +02:00
parent 5dc5b4a90e
commit fe49af2cac
6 changed files with 56 additions and 55 deletions

View File

@@ -3,24 +3,24 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
// import { Application } from '../../application';
import { Application } from '../../application';
export function setup() {
describe('Terminal', () => {
// it(`opens terminal, runs 'echo' and verifies the output`, async function () {
// const app = this.app as Application;
it(`opens terminal, runs 'echo' and verifies the output`, async function () {
const app = this.app as Application;
// const expected = new Date().getTime().toString();
// await app.workbench.terminal.showTerminal();
// await app.workbench.terminal.runCommand(`echo ${expected}`);
// await app.workbench.terminal.waitForTerminalText(terminalText => {
// for (let index = terminalText.length - 2; index >= 0; index--) {
// if (!!terminalText[index] && terminalText[index].trim() === expected) {
// return true;
// }
// }
// return false;
// });
// });
const expected = new Date().getTime().toString();
await app.workbench.terminal.showTerminal();
await app.workbench.terminal.runCommand(`echo ${expected}`);
await app.workbench.terminal.waitForTerminalText(terminalText => {
for (let index = terminalText.length - 2; index >= 0; index--) {
if (!!terminalText[index] && terminalText[index].trim() === expected) {
return true;
}
}
return false;
});
});
});
}