usergrid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From snoopd...@apache.org
Subject [05/42] git commit: adding firefox tests
Date Wed, 05 Feb 2014 01:21:15 GMT
adding firefox tests


Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/df3f9abf
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/df3f9abf
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/df3f9abf

Branch: refs/pull/27/merge
Commit: df3f9abf45686789ce3e5876fddc960739031208
Parents: 9687b65
Author: Shawn Feldman <shawn.feldman@gmail.com>
Authored: Tue Jan 28 18:28:43 2014 -0700
Committer: Shawn Feldman <shawn.feldman@gmail.com>
Committed: Tue Jan 28 18:28:43 2014 -0700

----------------------------------------------------------------------
 portal/Gruntfile.js                            | 40 ++++++++++++++++-----
 portal/tests/protractor/forgotPassword.spec.js |  4 +++
 portal/tests/protractor/profile.spec.js        |  4 +++
 portal/tests/protractor/util.js                | 34 +++++++++++++-----
 portal/tests/protractorConf.js                 |  3 +-
 5 files changed, 67 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/df3f9abf/portal/Gruntfile.js
----------------------------------------------------------------------
diff --git a/portal/Gruntfile.js b/portal/Gruntfile.js
index d30fa90..35d7f12 100644
--- a/portal/Gruntfile.js
+++ b/portal/Gruntfile.js
@@ -163,6 +163,12 @@ module.exports = function (grunt) {
           port: 3006,
           base: distPath
         }
+      },
+      'e2e-firefox': {
+        options: {
+          port: 3007,
+          base: distPath
+        }
       }
     },
     karma: {
@@ -185,24 +191,41 @@ module.exports = function (grunt) {
       phantom: {
         options: {
           args: {
+            baseUrl:'http://localhost:3005',
             // Arguments passed to the command
-            capabilities: {
-              baseUrl:'http://localhost:3005',
-              'browserName': 'phantomjs'
-            }
+            'browser': 'phantomjs'
           }
         }
       },
       chrome: {
         options: {
           args: {
+            baseUrl:'http://localhost:3006',
+            // Arguments passed to the command
+            'browser': 'chrome'
+          }
+        }
+      },
+      prod: {
+        options: {
+          args: {
+            baseUrl:'http://apigee.com/usergrid',
             // Arguments passed to the command
-            capabilities: {
-              baseUrl:'http://localhost:3006',
-              'browserName': 'chrome'
+            browser: 'chrome',
+            params:{
+              useSso:true
             }
           }
         }
+      },
+      firefox: {
+        options: {
+          args: {
+            baseUrl:'http://localhost:3007',
+            // Arguments passed to the command
+            'browser': 'firefox'
+          }
+        }
       }
     },
     copy:{
@@ -296,7 +319,8 @@ module.exports = function (grunt) {
 
   grunt.registerTask('e2e', ['karma:unit','connect:e2e-phantom','protractor:phantom']);
   grunt.registerTask('e2e-chrome', ['karma:unit','connect:e2e-chrome','protractor:chrome']);
-
+  grunt.registerTask('e2e-firefox', ['karma:unit','connect:e2e-firefox','protractor:firefox']);
+  grunt.registerTask('e2e-prod', ['protractor:prod']);
 
   grunt.registerTask('no-monitoring', ['build','clean:perf','karma:unit','compress']);
 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/df3f9abf/portal/tests/protractor/forgotPassword.spec.js
----------------------------------------------------------------------
diff --git a/portal/tests/protractor/forgotPassword.spec.js b/portal/tests/protractor/forgotPassword.spec.js
index dfc07be..715de21 100644
--- a/portal/tests/protractor/forgotPassword.spec.js
+++ b/portal/tests/protractor/forgotPassword.spec.js
@@ -7,6 +7,10 @@ describe('Forgot Password', function () {
     util.logout();
   });
   it('should have correct iframe url', function () {
+    if(browser.params.useSso){
+      //this will not work with sso since its an enterprise config.
+      return;
+    }
     browser.wait(function () {
       return browser.driver.getCurrentUrl().then(function (url) {
         return /login/.test(url);

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/df3f9abf/portal/tests/protractor/profile.spec.js
----------------------------------------------------------------------
diff --git a/portal/tests/protractor/profile.spec.js b/portal/tests/protractor/profile.spec.js
index 50a5062..f775cce 100644
--- a/portal/tests/protractor/profile.spec.js
+++ b/portal/tests/protractor/profile.spec.js
@@ -8,6 +8,10 @@ describe('Test User Profile', function () {
   })
   describe('Test Changing profile values',function(){
     it('should set email to some random value',function(){
+      if(browser.params.useSso){
+        //this will not work with sso since its an enterprise config.
+        return;
+      }
       browser.driver.get(browser.baseUrl+'/#!/profile');
       element(by.id('account-link')).click();
       element(by.model('user.email')).isPresent().then(function() {

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/df3f9abf/portal/tests/protractor/util.js
----------------------------------------------------------------------
diff --git a/portal/tests/protractor/util.js b/portal/tests/protractor/util.js
index 027a63d..686307b 100644
--- a/portal/tests/protractor/util.js
+++ b/portal/tests/protractor/util.js
@@ -8,20 +8,35 @@ module.exports = {
     }
     var self = this;
     browser.driver.get(browser.baseUrl + '/');
-    browser.waitForAngular();
     browser.wait(function () {
       return browser.driver.getCurrentUrl().then(function (url) {
-        return /login/.test(url);
+        return/login/.test(url) || url.indexOf('accounts/sign_in')>0;
       });
     });
-    element(by.model('login.username')).isPresent().then(function () {
-      element(by.model('login.username')).sendKeys(browser.params.login.user);
-      element(by.model('login.password')).sendKeys(browser.params.login.password);
-      element(by.id('button-login')).submit();
-    });
+    if(browser.params.useSso){
+      browser.wait(function(){
+        return browser.driver.findElement(by.id('email')).isDisplayed();
+      });
+      browser.driver.findElement(by.id('email')).isDisplayed().then(function () {
+        browser.driver.findElement(by.id('email')).sendKeys(browser.params.login.user);
+        browser.driver.findElement(by.id('password')).sendKeys(browser.params.login.password);
+        browser.driver.findElement(by.id('btnSubmit')).click();
+      });
+      browser.wait(function () {
+        return browser.driver.getCurrentUrl().then(function (url) {
+          return  url.indexOf('org-overview')>0;
+        });
+      });
+    }else{
+      element(by.model('login.username')).isPresent().then(function () {
+        element(by.model('login.username')).sendKeys(browser.params.login.user);
+        element(by.model('login.password')).sendKeys(browser.params.login.password);
+        element(by.id('button-login')).submit();
+      });
+    }
 
     browser.wait(function(){
-      return element(by.id('current-org-selector')).isDisplayed();
+      return browser.driver.findElement(by.id('current-org-selector')).isDisplayed();
     });
 
     browser.wait(function () {
@@ -45,7 +60,8 @@ module.exports = {
       browser.driver.get(browser.baseUrl+'/#!/logout');
       browser.wait(function () {
         return browser.driver.getCurrentUrl().then(function (url) {
-          return /login/.test(url);
+          var test =  /login/.test(url) || url.indexOf('accounts/sign_in')>0;
+          return test;
         });
       });
     }

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/df3f9abf/portal/tests/protractorConf.js
----------------------------------------------------------------------
diff --git a/portal/tests/protractorConf.js b/portal/tests/protractorConf.js
index c52266f..fdd8bbf 100644
--- a/portal/tests/protractorConf.js
+++ b/portal/tests/protractorConf.js
@@ -68,7 +68,8 @@ exports.config = {
     },
     orgName:'rippela',
     appName1:'test',
-    appName2:'sandbox'
+    appName2:'sandbox',
+    useSso:false
 
   },
   // ----- More information for your tests ----


Mime
View raw message