Commit 7a4356b7 authored by Johannes Zellner's avatar Johannes Zellner

Fixup the tests

parent b11fdf81
......@@ -114,6 +114,26 @@ describe('Application life cycle test', function () {
}
function closeWizard(callback) {
browser.get(`https://${app.fqdn}`).then(function () {
return waitForElement(By.id('firstrunwizard'));
}).then(function () {
return waitForElement(By.xpath('//div[@id="firstrunwizard"]//button'));
}).then(function () {
var button = browser.findElement(By.xpath('//div[@id="firstrunwizard"]//button'));
return browser.executeScript('arguments[0].scrollIntoView(false)', button);
}).then(function () {
return browser.findElement(By.xpath('//div[@id="firstrunwizard"]//button')).click();
}).then(function () {
return waitForElement(By.id('filestable'));
}).then(function () {
// give it some time to save
return browser.sleep(20000);
}).then(function () {
callback();
});
}
function closeWizardOld(callback) {
browser.get(`https://${app.fqdn}`).then(function () {
return waitForElement(By.xpath('//a[contains(@class, "icon-close")]'));
}).then(function () {
......@@ -134,9 +154,9 @@ describe('Application life cycle test', function () {
function listUsers(callback) {
browser.get(`https://${app.fqdn}/settings/users`).then(function () {
// should see admin user
return waitForElement(By.xpath('//div[text()="admin"]'));
return waitForElement(By.xpath('//div[@class="user-list-grid"]//div[contains(text(), "admin")]'));
}).then(function () {
return browser.wait(until.elementLocated(By.xpath('//div[text()="' + username + '"]')), TEST_TIMEOUT);
return browser.wait(until.elementLocated(By.xpath(`//div[@class="user-list-grid"]//div[contains(text(), "${username}")]`)), TEST_TIMEOUT);
}).then(function () {
callback();
}); // should see external user
......@@ -144,7 +164,7 @@ describe('Application life cycle test', function () {
function getContact(callback) {
browser.get(`https://${app.fqdn}/apps/contacts`).then(function () {
return browser.wait(until.elementLocated(By.xpath('//div[contains(text(), "' + CONTACT_NAME + '")]')), TEST_TIMEOUT);
return browser.wait(until.elementLocated(By.xpath(`//div[contains(text(), "${CONTACT_NAME}")]`)), TEST_TIMEOUT);
}).then(function () {
callback();
});
......@@ -199,14 +219,8 @@ describe('Application life cycle test', function () {
});
}
xit('build app', function () {
execSync('cloudron build', EXEC_ARGS);
});
it('install app', function () {
execSync(`cloudron install --location ${LOCATION}`, EXEC_ARGS);
});
xit('build app', function () { execSync('cloudron build', EXEC_ARGS); });
it('install app', function () { execSync(`cloudron install --location ${LOCATION}`, EXEC_ARGS); });
it('can get app information', getAppInfo);
it('check scheduler script', function () {
......@@ -227,9 +241,7 @@ describe('Application life cycle test', function () {
it('can get contact', getContact);
it('can logout', logout);
it('can restart app', function () {
execSync(`cloudron restart --app ${app.id}`);
});
it('can restart app', function () { execSync(`cloudron restart --app ${app.id}`); });
it('can login', login.bind(null, username, password));
it('can logout', logout);
......@@ -239,13 +251,8 @@ describe('Application life cycle test', function () {
it('can logout', logout);
it('can download previously uploaded file', testFileDownload);
it('backup app', function () {
execSync(`cloudron backup create --app ${app.id}`);
});
it('restore app', function () {
execSync(`cloudron restore --app ${app.id}`, EXEC_ARGS);
});
it('backup app', function () { execSync(`cloudron backup create --app ${app.id}`); });
it('restore app', function () { execSync(`cloudron restore --app ${app.id}`, EXEC_ARGS); });
it('can login', login.bind(null, username, password));
it('can logout', logout);
......@@ -286,23 +293,18 @@ describe('Application life cycle test', function () {
});
// test update
it('can install app', function () {
execSync(`cloudron install --appstore-id com.nextcloud.cloudronapp --location ${LOCATION}`, EXEC_ARGS);
});
it('can install app', function () { execSync(`cloudron install --appstore-id com.nextcloud.cloudronapp --location ${LOCATION}`, EXEC_ARGS); });
it('can get app information', getAppInfo);
it('can upload file', uploadFile);
it('can download previously uploaded file', testFileDownload);
it('can admin login', login.bind(null, adminUser, adminPassword));
it('can close the wizard', closeWizard);
it('can close the wizard', closeWizardOld);
it('can enable contacts app', enableContacts);
it('can add contact', addContact);
it('can get contact', getContact);
it('can logout', logout);
it('can update', function () {
execSync(`cloudron update --app ${LOCATION}`, EXEC_ARGS);
});
it('can update', function () { execSync(`cloudron update --app ${LOCATION}`, EXEC_ARGS); });
it('can admin login', login.bind(null, adminUser, adminPassword));
it('can get contact', getContact);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment