usergrid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From snoopd...@apache.org
Subject [03/41] updating portal with latest code base
Date Mon, 24 Feb 2014 07:20:58 GMT
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/a5a98884/portal/tests/karma.conf.js
----------------------------------------------------------------------
diff --git a/portal/tests/karma.conf.js b/portal/tests/karma.conf.js
index e3e4a2e..6aa9f7f 100644
--- a/portal/tests/karma.conf.js
+++ b/portal/tests/karma.conf.js
@@ -29,7 +29,7 @@ module.exports = function(config) {
     // level of logging
     // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO
|| config.LOG_DEBUG
     // CLI --log-level debug
-    logLevel: config.LOG_INFO,
+    logLevel: config.LOG_WARN,
 
     // enable / disable watching file and executing tests whenever any file changes
     // CLI --auto-watch --no-auto-watch

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/a5a98884/portal/tests/protractor/data.spec.js
----------------------------------------------------------------------
diff --git a/portal/tests/protractor/data.spec.js b/portal/tests/protractor/data.spec.js
index 2848eb0..d747b43 100644
--- a/portal/tests/protractor/data.spec.js
+++ b/portal/tests/protractor/data.spec.js
@@ -13,10 +13,15 @@ describe('Test Data', function () {
 
       var entityName = 'test_e2e';
       var dateString = Date.now().toString();
-
-      element(by.id("new-collection-link")).isPresent().then(function(){
+      browser.wait(function(){
+        return element(by.id("new-collection-link")).isDisplayed();
+      });
+      element(by.id("new-collection-link")).isDisplayed().then(function(){
         element(by.id("new-collection-link")).click();
       });
+      browser.wait(function(){
+        return element(by.id("new-collection-name")).isDisplayed();
+      });
       element(by.id('new-collection-name')).isDisplayed().then(function () {
         //fill in data
         browser.sleep(500);

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/a5a98884/portal/tests/protractor/monitoring.spec.js
----------------------------------------------------------------------
diff --git a/portal/tests/protractor/monitoring.spec.js b/portal/tests/protractor/monitoring.spec.js
deleted file mode 100644
index e581845..0000000
--- a/portal/tests/protractor/monitoring.spec.js
+++ /dev/null
@@ -1,15 +0,0 @@
-'use strict';
-var util = require('./util');
-describe('Monitoring Suite', function () {
-  beforeEach(function(){
-    util.login();
-  });
-  describe('Monitoring',function(){
-    it('should have demo data',function(){
-      browser.driver.get(browser.baseUrl+'/#!/performance/app-usage?timeFilter=1h&sessionChartFilter=&currentCompare=NOW');
-      browser.wait(function(){
-        return element(by.id('demo-data-ctrl')).isDisplayed();
-      });
-    });
-  });
-});
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/a5a98884/portal/tests/protractor/profile.spec.js
----------------------------------------------------------------------
diff --git a/portal/tests/protractor/profile.spec.js b/portal/tests/protractor/profile.spec.js
index 9166af2..f93073c 100644
--- a/portal/tests/protractor/profile.spec.js
+++ b/portal/tests/protractor/profile.spec.js
@@ -62,6 +62,10 @@ describe('Test User Profile', function () {
 
   describe('Test change password',function(){
     it('should change password to some value',function(){
+      if(browser.params.useSso){
+        //this will not work with sso since its an enterprise config.
+        return;
+      }
       browser.driver.get(browser.baseUrl+'/#!/org-overview');
       browser.driver.get(browser.baseUrl+'/#!/profile');
       var email = element(by.model('user.email'));

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/a5a98884/portal/tests/protractor/push.spec.js
----------------------------------------------------------------------
diff --git a/portal/tests/protractor/push.spec.js b/portal/tests/protractor/push.spec.js
deleted file mode 100644
index 87d57a4..0000000
--- a/portal/tests/protractor/push.spec.js
+++ /dev/null
@@ -1,15 +0,0 @@
-'use strict';
-var util = require('./util');
-describe('Push Suite', function () {
-  beforeEach(function(){
-    util.login();
-  });
-  describe('Push',function(){
-    it('should have Push fields',function(){
-      browser.driver.get(browser.baseUrl+'/#!/push/sendNotification');
-      browser.wait(function(){
-        return element(by.id('notification-json')).isDisplayed();
-      });
-    });
-  });
-});
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/a5a98884/portal/tests/protractor/users.spec.js
----------------------------------------------------------------------
diff --git a/portal/tests/protractor/users.spec.js b/portal/tests/protractor/users.spec.js
index d295997..f8a50ff 100644
--- a/portal/tests/protractor/users.spec.js
+++ b/portal/tests/protractor/users.spec.js
@@ -11,13 +11,17 @@ describe('Users ', function () {
   describe('add and delete', function () {
     it('should add and then delete', function () {
       var dateString = Date.now().toString();
+      browser.driver.get(browser.baseUrl + '/#!/users');
 
       browser.wait(function(){
-        return browser.driver.findElement(by.id("new-user-button")).isDisplayed();
+        return element(by.id("new-user-button")).isDisplayed();
       });
-      element(by.id("new-user-button")).isPresent().then(function(){
+      element(by.id("new-user-button")).isDisplayed().then(function(){
         element(by.id("new-user-button")).click();
       });
+      browser.wait(function(){
+        return element(by.id("new-user-username")).isDisplayed();
+      });
       element(by.id('new-user-username')).isDisplayed().then(function () {
         //fill in data
         browser.sleep(500);
@@ -25,25 +29,24 @@ describe('Users ', function () {
         element(by.id('new-user-username')).sendKeys('test' + dateString);
         element(by.id('new-user-fullname')).sendKeys('Test ' + dateString);
         element(by.id('new-user-email')).sendKeys('sfeldman+test' + dateString + '@apigee.com');
-        element(by.id('new-user-password')).sendKeys(dateString);
-        element(by.id('new-user-re-password')).sendKeys(dateString);
+        element(by.id('new-user-password')).sendKeys('P@ssw0rd1');
+        element(by.id('new-user-re-password')).sendKeys('P@ssw0rd1');
         browser.sleep(1000);
         element(by.id('dialogButton-users')).submit();
       });
 
-      var deleteCheckbox = element(by.id('user-' + 'test' + dateString + '-checkbox'));
       browser.wait(function () {
-        return deleteCheckbox.isPresent();
+        return element(by.id('user-' + 'test' + dateString + '-checkbox')).isPresent();
       });
-      deleteCheckbox.isPresent().then(function () {
-        deleteCheckbox.click();
+      element(by.id('user-' + 'test' + dateString + '-checkbox')).isPresent().then(function
() {
+        element(by.id('user-' + 'test' + dateString + '-checkbox')).click();
         browser.sleep(1000);
         element(by.id('delete-user-button')).click();
         element(by.id('dialogButton-deleteusers')).submit();
       });
       //need to wait for the element not to be there.
       browser.wait(function(){
-        return deleteCheckbox.isPresent().then(function (present) {
+        return element(by.id('user-' + 'test' + dateString + '-checkbox')).isPresent().then(function
(present) {
           return !present;
         });
       });

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/a5a98884/portal/tests/protractor/util.js
----------------------------------------------------------------------
diff --git a/portal/tests/protractor/util.js b/portal/tests/protractor/util.js
index 686307b..39bd7a0 100644
--- a/portal/tests/protractor/util.js
+++ b/portal/tests/protractor/util.js
@@ -36,7 +36,7 @@ module.exports = {
     }
 
     browser.wait(function(){
-      return browser.driver.findElement(by.id('current-org-selector')).isDisplayed();
+      return element(by.id('current-org-selector')).isDisplayed();
     });
 
     browser.wait(function () {
@@ -61,6 +61,7 @@ module.exports = {
       browser.wait(function () {
         return browser.driver.getCurrentUrl().then(function (url) {
           var test =  /login/.test(url) || url.indexOf('accounts/sign_in')>0;
+          test && browser.sleep(1000);
           return test;
         });
       });
@@ -68,6 +69,7 @@ module.exports = {
   },
   navigate:function(orgName,appName){
     browser.driver.get(browser.baseUrl+'/#!/org-overview');
+    browser.sleep(1000);
     browser.wait(function () {
       return element.all(by.repeater("(k,v) in organizations")).count().then(function(count){
         var appCount =  count >0;
@@ -75,17 +77,18 @@ module.exports = {
       });
     });
     browser.wait(function(){
-      return element(by.id('current-org-selector')).isDisplayed().then(function(){
-        element(by.id('current-org-selector')).click();
-        return true;
+      return element(by.id('current-org-selector')).isPresent().then(function(present){
+        return present;
       });
     });
+    element(by.id('current-org-selector')).click();
+
     browser.wait(function(){
-      return element(by.id('org-'+orgName+'-selector')).isDisplayed().then(function(){
-        element(by.id('org-'+orgName+'-selector')).click();
-        return true;
+      return element(by.id('org-'+orgName+'-selector')).isPresent().then(function(present){
+        return present;
       });
     });
+    element(by.id('org-'+orgName+'-selector')).click();
 
     browser.wait(function() {
       return element(by.id('org-overview-name')).getText().then(function(text) {

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/a5a98884/portal/tests/protractorConf.js
----------------------------------------------------------------------
diff --git a/portal/tests/protractorConf.js b/portal/tests/protractorConf.js
index aabb83d..5aeb5d3 100644
--- a/portal/tests/protractorConf.js
+++ b/portal/tests/protractorConf.js
@@ -17,10 +17,10 @@ exports.config = {
   // The location of the selenium standalone server .jar file, relative
   // to the location of this config. If no other method of starting selenium
   // is found, this will default to protractor/selenium/selenium-server...
-  seleniumServerJar: './selenium/selenium-server-standalone-2.37.0.jar',
+  seleniumServerJar: null,//'./selenium/selenium-server-standalone-2.37.0.jar',
   // The port to start the selenium server on, or null if the server should
   // find its own unused port.
-  seleniumPort: null,
+  seleniumPort: 3010,//3010,
   // Chromedriver location is used to help the selenium standalone server
   // find chromedriver. This will be passed to the selenium jar as
   // the system property webdriver.chrome.driver. If null, selenium will
@@ -37,8 +37,11 @@ exports.config = {
   // The address of a running selenium server. If specified, Protractor will
   // connect to an already running instance of selenium. This usually looks like
   // seleniumAddress: 'http://localhost:4444/wd/hub'
-  seleniumAddress: null,
-
+  seleniumAddress:  'http://localhost:4444/wd/hub',
+  // If sauceUser and sauceKey are specified, seleniumServerJar will be ignored.
+  // The tests will be run remotely using SauceLabs.
+ // sauceUser: 'safeldm',
+ // sauceKey: 'a3388a50-0ddb-4f90-8f81-4baa5bc839e1',
   // The timeout for each script run on the browser. This should be longer
   // than the maximum time your application needs to stabilize between tasks.
   allScriptsTimeout: 30000,
@@ -58,13 +61,13 @@ exports.config = {
   // https://code.google.com/p/selenium/source/browse/javascript/webdriver/capabilities.js
   capabilities: {
     'browserName': 'chrome'
-  //  'browserName': 'chrome'
+  //  'browserName': 'firefox'
   //  'browserName': 'phantomjs'
   },
   params: {
     login: {
       user: 'sfeldman+apijeeps@apigee.com',
-      password: 'p@ssw0rd1'
+      password: 'P@ssw0rd1'
     },
     orgName:'apijeeps',
     appName1:'website',

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/a5a98884/portal/tests/unit/sample.spec.js
----------------------------------------------------------------------
diff --git a/portal/tests/unit/sample.spec.js b/portal/tests/unit/sample.spec.js
index 167a526..afe95ab 100644
--- a/portal/tests/unit/sample.spec.js
+++ b/portal/tests/unit/sample.spec.js
@@ -3,19 +3,18 @@
 describe('PageCtrl', function(){
   var scope;//we'll use this scope in our tests
 
+  var rootscope;
   //mock Application to allow us to inject our own dependencies
-  beforeEach(angular.mock.module('appservices.controllers'));
-  beforeEach(angular.mock.module('angulartics'));
-  beforeEach(angular.mock.module('angulartics.google.analytics'));
+  beforeEach(module('appservices.controllers'));
   //mock the controller for the same reason and include $rootScope and $controller
   beforeEach(function(){
-    angular.mock.inject(function($rootScope, $controller){
+    inject(function($rootScope, $controller){
       //create an empty scope
+      rootscope = $rootScope;
       scope = $rootScope.$new();
       //declare the controller and inject our empty scope
       $controller('PageCtrl', {
         $scope: scope,
-        'data':{},
         'ug':{
           getAppSettings:function(){}
         },
@@ -33,7 +32,8 @@ describe('PageCtrl', function(){
         },
         '$routeParams':{},
         '$q':{},
-        '$route':{}
+        '$route':{},
+        '$log':{}
       });
     });
   });


Mime
View raw message