Sfoglia il codice sorgente

Adjust to new admin location

Johannes Zellner 7 anni fa
parent
commit
b29dc809f6
1 ha cambiato i file con 20 aggiunte e 2 eliminazioni
  1. 20 2
      test/test.js

+ 20 - 2
test/test.js

@@ -78,12 +78,30 @@ describe('Application life cycle test SSO', function () {
     }
 
     function adminLogin(callback) {
+        browser.get('https://' + app.fqdn + '/admin/login/').then(function () {
+            return browser.findElement(by.name('username')).sendKeys('admin');
+        }).then(function () {
+            return browser.findElement(by.name('password')).sendKeys('123123');
+        }).then(function () {
+            return browser.findElement(by.id('login-form')).submit();
+        }).then(function () {
+            return waitForElement(by.xpath('//h1[text()="Site administration"]'));
+        }).then(function () {
+            return browser.findElement(by.xpath('//a[text()="Log out"]')).click();
+        }).then(function () {
+            return browser.sleep(2000);
+        }).then(function () {
+            callback();
+        });
+    }
+
+    function adminLoginOld(callback) {
         browser.get('https://' + app.fqdn + '/admin').then(function () {
             return browser.findElement(by.name('username')).sendKeys('admin');
         }).then(function () {
             return browser.findElement(by.name('password')).sendKeys('123123');
         }).then(function () {
-            return browser.findElement(by.className('login-form')).submit();
+            return browser.findElement(by.id('login-form')).submit();
         }).then(function () {
             return waitForElement(by.xpath('//h1[text()="Site administration"]'));
         }).then(function () {
@@ -222,7 +240,7 @@ describe('Application life cycle test SSO', function () {
         execSync('cloudron install --new --wait --appstore-id ' + app.manifest.id + ' --location ' + LOCATION, { cwd: path.resolve(__dirname, '..'), stdio: 'inherit' });
     });
 
-    it('can admin login', adminLogin);
+    it('can admin login', adminLoginOld);
     it('can get app information', getAppInfo);
     it('can login', login);
     it('can dismiss tutorial', dismissTutorial);