Fixup tests

This commit is contained in:
Johannes Zellner 2022-09-21 16:55:48 +02:00
parent 519a2a2628
commit 3df343c185

View file

@ -89,19 +89,12 @@ describe('Application life cycle test', function () {
async function completeSetup() { async function completeSetup() {
var button; var button;
await browser.get('https://' + app.fqdn + '/admin/config/edit-custom'); await browser.get(`https://${app.fqdn}`);
await waitForElement(By.xpath('//a[contains(text(), "Configure my instance")]')); await waitForElement(By.xpath('//a[contains(text(), "Configure my instance")]'));
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
await browser.get('https://' + app.fqdn + '/admin/config/edit-custom'); console.log('Close the newly opened tab. Will wait for 10 seconds');
await waitForElement(By.xpath('//input[contains(@value, "Update configuration")]')); await browser.sleep(10000);
button = await browser.findElement(By.xpath('//input[contains(@value, "Update configuration")]'));
await browser.executeScript('arguments[0].scrollIntoView(true)', button);
await button.click();
await waitForElement(By.xpath('//h3[contains(text(), "Success")]'));
console.log('Close the newly opened tab. Will wait for 20 seconds');
await browser.sleep(20000);
} }
async function uploadVideo() { async function uploadVideo() {
@ -174,7 +167,10 @@ describe('Application life cycle test', function () {
it('can login', login.bind(null, username, password)); it('can login', login.bind(null, username, password));
it('logout', logout); it('logout', logout);
it('uninstall app', function () { execSync('cloudron uninstall --app ' + app.id, EXEC_ARGS); }); it('uninstall app', async function () {
await browser.executeScript('localStorage.clear();');
execSync('cloudron uninstall --app ' + app.id, EXEC_ARGS);
});
// No SSO // No SSO
it('install app (no sso)', async function () { it('install app (no sso)', async function () {
@ -188,7 +184,10 @@ describe('Application life cycle test', function () {
it('can complete setup', completeSetup); it('can complete setup', completeSetup);
it('can logout', logout); it('can logout', logout);
it('uninstall app (no sso)', function () { execSync('cloudron uninstall --app ' + app.id, EXEC_ARGS); }); it('uninstall app (no sso)', async function () {
await browser.executeScript('localStorage.clear();');
execSync('cloudron uninstall --app ' + app.id, EXEC_ARGS);
});
// test update // test update
it('can install app', async function () { it('can install app', async function () {
@ -210,5 +209,8 @@ describe('Application life cycle test', function () {
it('can login', login.bind(null, username, password)); it('can login', login.bind(null, username, password));
it('logout', logout); it('logout', logout);
it('uninstall app', function () { execSync('cloudron uninstall --app ' + app.id, EXEC_ARGS); }); it('uninstall app', async function () {
await browser.executeScript('localStorage.clear();');
execSync('cloudron uninstall --app ' + app.id, EXEC_ARGS);
});
}); });