mirror of
https://git.cloudron.io/cloudron/prometheus-server-app.git
synced 2024-12-12 18:26:29 +00:00
Fix tests
This commit is contained in:
parent
9c586976ad
commit
6d332d053f
1 changed files with 6 additions and 8 deletions
14
test/test.js
14
test/test.js
|
@ -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); });
|
||||||
|
|
Loading…
Reference in a new issue