From c91051c145991ca43d3cb8f193b2b8a210696a4f Mon Sep 17 00:00:00 2001 From: Johannes Zellner Date: Thu, 22 Jun 2023 21:09:28 +0200 Subject: [PATCH] Better tab closing instructions --- test/test.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/test/test.js b/test/test.js index efc0a7b..9367670 100644 --- a/test/test.js +++ b/test/test.js @@ -12,11 +12,14 @@ require('chromedriver'); const execSync = require('child_process').execSync, expect = require('expect.js'), + readlinePromises = require('readline/promises'), path = require('path'), util = require('util'), { Builder, By, Key, until } = require('selenium-webdriver'), { Options } = require('selenium-webdriver/chrome'); +const rl = readlinePromises.createInterface({ input: process.stdin, output: process.stdout }); + if (!process.env.USERNAME || !process.env.PASSWORD || !process.env.EMAIL) { console.log('USERNAME, EMAIL and PASSWORD env vars need to be set'); process.exit(1); @@ -93,8 +96,8 @@ describe('Application life cycle test', function () { await waitForElement(By.xpath('//a[contains(text(), "Configure my instance")]')); await browser.findElement(By.xpath('//a[contains(text(), "Configure my instance")]')).click(); // this opens a new window - console.log('Close the newly opened tab. Will wait for 60 seconds'); - await browser.sleep(60000); + execSync('spd-say "Close the newly opened configuration tab."'); + await rl.question('Is tab closed? '); } async function uploadVideo() {