diff --git a/test/test.js b/test/test.js index 3222311..797008f 100644 --- a/test/test.js +++ b/test/test.js @@ -89,19 +89,12 @@ describe('Application life cycle test', function () { async function completeSetup() { 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 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'); - await waitForElement(By.xpath('//input[contains(@value, "Update configuration")]')); - 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); + console.log('Close the newly opened tab. Will wait for 10 seconds'); + await browser.sleep(10000); } async function uploadVideo() { @@ -174,7 +167,10 @@ describe('Application life cycle test', function () { it('can login', login.bind(null, username, password)); 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 it('install app (no sso)', async function () { @@ -188,7 +184,10 @@ describe('Application life cycle test', function () { it('can complete setup', completeSetup); 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 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('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); + }); });