Selaa lähdekoodia

test non-sso login

Girish Ramakrishnan 8 vuotta sitten
vanhempi
commit
dc18447084
1 muutettua tiedostoa jossa 28 lisäystä ja 4 poistoa
  1. 28 4
      test/test.js

+ 28 - 4
test/test.js

@@ -54,7 +54,7 @@ describe('Application life cycle test', function () {
         done();
     });
 
-    function login(done) {
+    function login(username, password, done) {
         browser.get('https://' + app.fqdn + '/wp-login.php').then(function () {
             browser.sleep(2000); // there seems to be some javascript that gives auto-focus to username
             browser.findElement(by.id('user_login')).sendKeys(username);
@@ -136,7 +136,7 @@ describe('Application life cycle test', function () {
         });
     });
 
-    it('can login', login);
+    it('can login', login.bind(null, username, password));
 
     it('is an admin dashboard', function (done) {
         browser.wait(until.elementLocated(by.xpath('//div[@class="wp-menu-name" and contains(text(), "Plugins")]')), TIMEOUT).then(function () { done(); });
@@ -202,7 +202,7 @@ describe('Application life cycle test', function () {
     it('can see media', checkMedia);
     it('has correct htaccess', checkHtaccess);
     it('can access permalink', checkPermalink);
-    it('can login', login);
+    it('can login', login.bind(null, username, password));
 
     it('move to different location', function () {
         browser.manage().deleteAllCookies();
@@ -217,7 +217,7 @@ describe('Application life cycle test', function () {
     it('can see media', checkMedia);
     it('has correct htaccess', checkHtaccess);
     it('can access permalink', checkPermalink);
-    it('can login', login);
+    it('can login', login.bind(null, username, password));
 
     it('uninstall app', function () {
         execSync('cloudron uninstall --app ' + app.id, { cwd: path.resolve(__dirname, '..'), stdio: 'inherit' });
@@ -236,4 +236,28 @@ describe('Application life cycle test', function () {
             done();
         });
     });
+
+    // No SSO
+    it('install app', function () {
+        execSync('cloudron install --new --wait --no-sso --location ' + LOCATION, { cwd: path.resolve(__dirname, '..'), stdio: 'inherit' });
+    });
+
+    it('can get app information', function () {
+        var inspect = JSON.parse(execSync('cloudron inspect'));
+
+        app = inspect.apps.filter(function (a) { return a.location === LOCATION; })[0];
+
+        expect(app).to.be.an('object');
+    });
+
+    it('can login', login.bind(null, 'admin', 'changeme'));
+
+    it('is an admin dashboard', function (done) {
+        browser.wait(until.elementLocated(by.xpath('//div[@class="wp-menu-name" and contains(text(), "Plugins")]')), TIMEOUT).then(function () { done(); });
+    });
+
+    it('uninstall app', function () {
+        execSync('cloudron uninstall --app ' + app.id, { cwd: path.resolve(__dirname, '..'), stdio: 'inherit' });
+    });
 });
+