optional configure it seems

This commit is contained in:
Girish Ramakrishnan 2024-01-16 15:00:04 +01:00
parent 82be3d5f13
commit 27fb06cd91
3 changed files with 18 additions and 1 deletions

14
test/package-lock.json generated
View file

@ -10,6 +10,7 @@
"license": "ISC", "license": "ISC",
"dependencies": { "dependencies": {
"chromedriver": "^120.0.1", "chromedriver": "^120.0.1",
"safetydance": "^2.4.0",
"selenium-webdriver": "^4.16.0" "selenium-webdriver": "^4.16.0"
}, },
"devDependencies": { "devDependencies": {
@ -1083,6 +1084,14 @@
} }
] ]
}, },
"node_modules/safetydance": {
"version": "2.4.0",
"resolved": "https://registry.npmjs.org/safetydance/-/safetydance-2.4.0.tgz",
"integrity": "sha512-KsQJ5xpuv05yeLVMP6FTp8PNtj/iY5MxmirU2Bb6lf5EvKkZFr3Qrx9umV9/NrAvRfin8mhotJNAnBD3C3MUkw==",
"engines": [
"node >= 4.0.0"
]
},
"node_modules/selenium-webdriver": { "node_modules/selenium-webdriver": {
"version": "4.16.0", "version": "4.16.0",
"resolved": "https://registry.npmjs.org/selenium-webdriver/-/selenium-webdriver-4.16.0.tgz", "resolved": "https://registry.npmjs.org/selenium-webdriver/-/selenium-webdriver-4.16.0.tgz",
@ -2130,6 +2139,11 @@
"integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==",
"dev": true "dev": true
}, },
"safetydance": {
"version": "2.4.0",
"resolved": "https://registry.npmjs.org/safetydance/-/safetydance-2.4.0.tgz",
"integrity": "sha512-KsQJ5xpuv05yeLVMP6FTp8PNtj/iY5MxmirU2Bb6lf5EvKkZFr3Qrx9umV9/NrAvRfin8mhotJNAnBD3C3MUkw=="
},
"selenium-webdriver": { "selenium-webdriver": {
"version": "4.16.0", "version": "4.16.0",
"resolved": "https://registry.npmjs.org/selenium-webdriver/-/selenium-webdriver-4.16.0.tgz", "resolved": "https://registry.npmjs.org/selenium-webdriver/-/selenium-webdriver-4.16.0.tgz",

View file

@ -14,6 +14,7 @@
}, },
"dependencies": { "dependencies": {
"chromedriver": "^120.0.1", "chromedriver": "^120.0.1",
"safetydance": "^2.4.0",
"selenium-webdriver": "^4.16.0" "selenium-webdriver": "^4.16.0"
} }
} }

View file

@ -14,6 +14,7 @@ const execSync = require('child_process').execSync,
expect = require('expect.js'), expect = require('expect.js'),
readlinePromises = require('readline/promises'), readlinePromises = require('readline/promises'),
path = require('path'), path = require('path'),
safetydance = require('safetydance'),
util = require('util'), util = require('util'),
{ Builder, By, Key, until } = require('selenium-webdriver'), { Builder, By, Key, until } = require('selenium-webdriver'),
{ Options } = require('selenium-webdriver/chrome'); { Options } = require('selenium-webdriver/chrome');
@ -126,7 +127,8 @@ describe('Application life cycle test', function () {
await browser.get(`https://${app.fqdn}`); await browser.get(`https://${app.fqdn}`);
await browser.sleep(2000); await browser.sleep(2000);
await waitForElement(By.xpath('//a[contains(text(), "Configure my instance")]')); const [error] = await safe(waitForElement(By.xpath('//a[contains(text(), "Configure my instance")]')));
if (error) return; // sometimes it doesn't appear, maybe it's cached in local storage
await browser.findElement(By.xpath('//a[contains(text(), "Configure my instance")]')).click(); // this opens a new window await browser.findElement(By.xpath('//a[contains(text(), "Configure my instance")]')).click(); // this opens a new window
let say_cmd = await getOS() == "Darwin" ? "say" : "spd-say"; let say_cmd = await getOS() == "Darwin" ? "say" : "spd-say";