Przeglądaj źródła

add non-sso test

Girish Ramakrishnan 6 lat temu
rodzic
commit
95b3667790
1 zmienionych plików z 51 dodań i 0 usunięć
  1. 51 0
      test/test.js

+ 51 - 0
test/test.js

@@ -66,6 +66,31 @@ describe('Application life cycle test SSO', function () {
         });
     }
 
+    function signUp(callback) {
+        browser.manage().deleteAllCookies();
+        browser.get('https://' + app.fqdn).then(function () {
+            return waitForElement(by.xpath('//a[@title="Sign up"]'));
+        }).then(function () {
+            return browser.findElement(by.xpath('//a[@title="Sign up"]')).click();
+        }).then(function () {
+            return waitForElement(by.name('username'));
+        }).then(function () {
+            return browser.findElement(by.name('username')).sendKeys(process.env.USERNAME);
+        }).then(function () {
+            return browser.findElement(by.name('full_name')).sendKeys(process.env.USERNAME + ' Name');
+        }).then(function () {
+            return browser.findElement(by.name('email')).sendKeys('test@cloudron.io');
+        }).then(function () {
+            return browser.findElement(by.name('password')).sendKeys(process.env.PASSWORD);
+        }).then(function () {
+            return browser.findElement(by.xpath('//button[@title="Sign up"]')).click();
+        }).then(function () {
+            return waitForElement(by.xpath('//p[contains(text(), "Welcome! Here you will find the projects you are involved on.")]'));
+        }).then(function () {
+            callback();
+        });
+    }
+
     function adminLogin(callback) {
         browser.get('https://' + app.fqdn + '/admin/login/').then(function () {
             return browser.findElement(by.name('username')).sendKeys('admin');
@@ -223,6 +248,32 @@ describe('Application life cycle test SSO', function () {
         });
     });
 
+    // no sso
+    it('install app', function () {
+        execSync('cloudron install --no-sso --new --wait --location ' + LOCATION, { cwd: path.resolve(__dirname, '..'), stdio: 'inherit' });
+    });
+    it('can get app information', getAppInfo);
+    it('can admin login', adminLogin);
+    it('can sign up', signUp);
+    it('can dismiss tutorial', dismissTutorial);
+    it('can create project', createProject);
+    it('can create user story', createUserStory);
+    it('user story exists', userStoryExists);
+
+    it('can restart app', function (done) {
+        execSync('cloudron restart --wait --app ' + app.id);
+        done();
+    });
+
+    it('user story is still present', userStoryExists);
+    it('uninstall app', function (done) {
+        // ensure we don't hit NXDOMAIN in the mean time
+        browser.get('about:blank').then(function () {
+            execSync('cloudron uninstall --app ' + app.id, { cwd: path.resolve(__dirname, '..'), stdio: 'inherit' });
+            done();
+        });
+    });
+
     // test update
     it('can install app', function () {
         execSync('cloudron install --new --wait --appstore-id ' + app.manifest.id + ' --location ' + LOCATION, { cwd: path.resolve(__dirname, '..'), stdio: 'inherit' });