From 6d332d053fa87dcb3d682adada83c6ecad95541e Mon Sep 17 00:00:00 2001 From: Girish Ramakrishnan Date: Fri, 15 Nov 2024 12:59:58 +0530 Subject: [PATCH] Fix tests --- test/test.js | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/test/test.js b/test/test.js index 83baf95..55227ef 100755 --- a/test/test.js +++ b/test/test.js @@ -6,7 +6,7 @@ require('chromedriver'); -var execSync = require('child_process').execSync, +const execSync = require('child_process').execSync, expect = require('expect.js'), fs = require('fs'), path = require('path'), @@ -25,11 +25,9 @@ describe('Application life cycle test', function () { const EXEC_ARGS = { cwd: path.resolve(__dirname, '..'), stdio: 'inherit' }; const TEST_TIMEOUT = parseInt(process.env.TIMEOUT, 10) || 50000; - var browser; - var username = process.env.USERNAME; - var password = process.env.PASSWORD; - - var app; + let browser, app; + const username = process.env.USERNAME; + const password = process.env.PASSWORD; before(function () { const chromeOptions = new Options().windowSize({ width: 1280, height: 1024 }); @@ -76,7 +74,7 @@ describe('Application life cycle test', function () { await browser.findElement(By.id('loginSubmitButton')).click(); } - await waitForElement(By.xpath('//a[text()="Alerts"]')); + await waitForElement(By.xpath('//a[contains(., "Alerts")]')); } async function logout() { @@ -86,7 +84,7 @@ describe('Application life cycle test', function () { async function loadApp() { await browser.get(`https://${app.fqdn}`); - await waitForElement(By.xpath('//a[text()="Alerts"]')); + await waitForElement(By.xpath('//a[contains(., "Alerts")]')); } xit('build app', function () { execSync('cloudron build', EXEC_ARGS); });