Fix tests

This commit is contained in:
Girish Ramakrishnan 2024-11-15 12:59:58 +05:30
parent 9c586976ad
commit 6d332d053f

View file

@ -6,7 +6,7 @@
require('chromedriver'); require('chromedriver');
var execSync = require('child_process').execSync, const execSync = require('child_process').execSync,
expect = require('expect.js'), expect = require('expect.js'),
fs = require('fs'), fs = require('fs'),
path = require('path'), path = require('path'),
@ -25,11 +25,9 @@ describe('Application life cycle test', function () {
const EXEC_ARGS = { cwd: path.resolve(__dirname, '..'), stdio: 'inherit' }; const EXEC_ARGS = { cwd: path.resolve(__dirname, '..'), stdio: 'inherit' };
const TEST_TIMEOUT = parseInt(process.env.TIMEOUT, 10) || 50000; const TEST_TIMEOUT = parseInt(process.env.TIMEOUT, 10) || 50000;
var browser; let browser, app;
var username = process.env.USERNAME; const username = process.env.USERNAME;
var password = process.env.PASSWORD; const password = process.env.PASSWORD;
var app;
before(function () { before(function () {
const chromeOptions = new Options().windowSize({ width: 1280, height: 1024 }); 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 browser.findElement(By.id('loginSubmitButton')).click();
} }
await waitForElement(By.xpath('//a[text()="Alerts"]')); await waitForElement(By.xpath('//a[contains(., "Alerts")]'));
} }
async function logout() { async function logout() {
@ -86,7 +84,7 @@ describe('Application life cycle test', function () {
async function loadApp() { async function loadApp() {
await browser.get(`https://${app.fqdn}`); 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); }); xit('build app', function () { execSync('cloudron build', EXEC_ARGS); });