syncope-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From matte...@apache.org
Subject [3/3] syncope git commit: [SYNCOPE-853] making all tests work togheter
Date Wed, 07 Sep 2016 07:40:15 GMT
[SYNCOPE-853] making all tests work togheter


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

Branch: refs/heads/master
Commit: ef5784b1ede2fd33de430cf2764cc669f79106d9
Parents: de5e9f1
Author: Matteo Di Carlo <matteo.dicarlo@tirasa.net>
Authored: Wed Sep 7 09:34:26 2016 +0200
Committer: Matteo Di Carlo <matteo.dicarlo@tirasa.net>
Committed: Wed Sep 7 09:35:15 2016 +0200

----------------------------------------------------------------------
 .../client/enduser/protractor/tests/edituser.js | 105 ------------------
 .../client/enduser/protractor/tests/abstract.js |   4 +-
 .../client/enduser/protractor/tests/create.js   |   2 +-
 .../client/enduser/protractor/tests/edituser.js | 108 +++++++++++++++++++
 .../client/enduser/protractor/tests/login.js    |  22 +++-
 5 files changed, 131 insertions(+), 110 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/syncope/blob/ef5784b1/client/enduser/src/test/resources/org/apache/syncope/client/enduser/protractor/tests/edituser.js
----------------------------------------------------------------------
diff --git a/client/enduser/src/test/resources/org/apache/syncope/client/enduser/protractor/tests/edituser.js
b/client/enduser/src/test/resources/org/apache/syncope/client/enduser/protractor/tests/edituser.js
deleted file mode 100644
index 04e888d..0000000
--- a/client/enduser/src/test/resources/org/apache/syncope/client/enduser/protractor/tests/edituser.js
+++ /dev/null
@@ -1,105 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-describe('syncope enduser user edit', function () {
-
-  function next() {
-    element.all(by.id('next')).last().click();
-  }
-  ;
-
-  function cancel() {
-    element.all(by.id('cancel')).last().click();
-  }
-  ;
-
-  it('should edit user credentials', function () {
-    browser.get('http://localhost:9080/syncope-enduser/app/');
-
-    //login
-    element(by.model('credentials.username')).sendKeys('bellini');
-    element(by.model('credentials.password')).sendKeys('password');
-    element.all(by.options('language.name for language in languages.availableLanguages track
by language.id')).
-            then(function (language) {
-              expect(language.length).toBe(3);
-            });
-    element.all(by.options('language.name for language in languages.availableLanguages track
by language.id')).
-            get(0).click();
-    element(by.id('login-btn')).click();
-
-    //credential
-    element(by.model('user.username')).clear();
-    element(by.model('user.username')).sendKeys('bellini');
-    element(by.model('user.password')).clear();
-    element(by.model('user.password')).sendKeys('password');
-    element(by.model('confirmPassword.value')).sendKeys('password');
-    var secQuestion = element(by.model('user.securityQuestion'));
-    var selectedSecQuestion = secQuestion.all(by.options
-            ('securityQuestion.key as securityQuestion.content for securityQuestion in availableSecurityQuestions'))
-            .last();
-    selectedSecQuestion.click();
-    element(by.model('user.securityAnswer')).sendKeys('Agata Ferlito');
-//    browser.driver.sleep(1000);
-    next();
-
-    //groups
-    var group = element(by.model('dynamicForm.selectedGroups'));
-    var selectedGroup = group.element(by.css('.ui-select-search'));
-    group.click();
-
-    // add "additional", a group with type extensions, and "root".
-    selectedGroup.sendKeys('additional');
-    element.all(by.css('.ui-select-choices-row-inner span')).first().click();
-    selectedGroup.sendKeys('root');
-    element.all(by.css('.ui-select-choices-row-inner span')).first().click();
-    next();
-
-    //plainSchemas
-    //  count groups in plainschemas: "own" and "additional".
-    element.all(by.repeater('groupSchema in dynamicForm.groupSchemas')).then(function (groupSchema)
{
-      expect(groupSchema.length).toBe(2);
-    })
-    //  fills own fields
-    element(by.css('[name="fullname"]')).clear();
-    element(by.css('[name="fullname"]')).sendKeys('Vincenzo Bellini');
-    element(by.css('[name="userId"]')).clear();
-    element(by.css('[name="userId"]')).sendKeys('bellini@apache.org');
-    var selectedDate = element(by.model('selectedDate')).click();
-    selectedDate.clear();
-    selectedDate.sendKeys('2009-06-21');
-    element(by.css('[name="firstname"]')).clear();
-    element(by.css('[name="firstname"]')).sendKeys('Vincenzo');
-    element(by.css('[name="surname"]')).clear();
-    element(by.css('[name="surname"]')).sendKeys('Bellini');
-    element(by.css('[name="ctype"]')).clear();
-    element(by.css('[name="ctype"]')).sendKeys('bellinictype');
-    next();
-    //derSchemas
-    next();
-    //virSchemas
-    next();
-    //Resources
-    next();
-
-  });
-});
-
-
-
-

http://git-wip-us.apache.org/repos/asf/syncope/blob/ef5784b1/fit/enduser-reference/src/test/resources/org/apache/syncope/client/enduser/protractor/tests/abstract.js
----------------------------------------------------------------------
diff --git a/fit/enduser-reference/src/test/resources/org/apache/syncope/client/enduser/protractor/tests/abstract.js
b/fit/enduser-reference/src/test/resources/org/apache/syncope/client/enduser/protractor/tests/abstract.js
index 0a952af..b1f06f0 100644
--- a/fit/enduser-reference/src/test/resources/org/apache/syncope/client/enduser/protractor/tests/abstract.js
+++ b/fit/enduser-reference/src/test/resources/org/apache/syncope/client/enduser/protractor/tests/abstract.js
@@ -53,7 +53,7 @@ exports.doCreate = function () {
      
     });
   });
-}
+};
 
 exports.doLogin = function (username, password) {
   describe('doLogin', function () {
@@ -67,7 +67,7 @@ exports.doLogin = function (username, password) {
 
       expect(element(by.model('user.username')).getAttribute('value')).toEqual(username);
 
-      element(by.id('logout')).click();
+//      element(by.id('logout')).click();
     });
   });
 }

http://git-wip-us.apache.org/repos/asf/syncope/blob/ef5784b1/fit/enduser-reference/src/test/resources/org/apache/syncope/client/enduser/protractor/tests/create.js
----------------------------------------------------------------------
diff --git a/fit/enduser-reference/src/test/resources/org/apache/syncope/client/enduser/protractor/tests/create.js
b/fit/enduser-reference/src/test/resources/org/apache/syncope/client/enduser/protractor/tests/create.js
index a88f148..88a3f5b 100644
--- a/fit/enduser-reference/src/test/resources/org/apache/syncope/client/enduser/protractor/tests/create.js
+++ b/fit/enduser-reference/src/test/resources/org/apache/syncope/client/enduser/protractor/tests/create.js
@@ -27,4 +27,4 @@ describe('waitSuccess', function () {
   });
 });
 
-abstract.doLogin("donizetti", "Password123");
+//abstract.doLogin("donizetti", "password123");

http://git-wip-us.apache.org/repos/asf/syncope/blob/ef5784b1/fit/enduser-reference/src/test/resources/org/apache/syncope/client/enduser/protractor/tests/edituser.js
----------------------------------------------------------------------
diff --git a/fit/enduser-reference/src/test/resources/org/apache/syncope/client/enduser/protractor/tests/edituser.js
b/fit/enduser-reference/src/test/resources/org/apache/syncope/client/enduser/protractor/tests/edituser.js
new file mode 100644
index 0000000..3b9eeff
--- /dev/null
+++ b/fit/enduser-reference/src/test/resources/org/apache/syncope/client/enduser/protractor/tests/edituser.js
@@ -0,0 +1,108 @@
+/* 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//var abstract = require('./abstract.js');
+
+describe('syncope enduser user edit', function () {
+
+  function next() {
+    element.all(by.id('next')).last().click();
+  }
+  ;
+
+  function cancel() {
+    element.all(by.id('cancel')).last().click();
+  }
+  ;
+
+  it('should edit user credentials', function () {
+    browser.get('http://localhost:9080/syncope-enduser/app/');
+
+    //login
+    element(by.model('credentials.username')).sendKeys('bellini');
+    element(by.model('credentials.password')).sendKeys('password');
+    element.all(by.options('language.name for language in languages.availableLanguages track
by language.id')).
+            then(function (language) {
+              expect(language.length).toBe(3);
+            });
+    element.all(by.options('language.name for language in languages.availableLanguages track
by language.id')).
+            get(0).click();
+    element(by.id('login-btn')).click();
+
+//    abstract.doLogin("bellini", "password");
+
+    //credential
+    element(by.model('user.username')).clear();
+    element(by.model('user.username')).sendKeys('bellini');
+    element(by.model('user.password')).clear();
+    element(by.model('user.password')).sendKeys('password');
+    element(by.model('confirmPassword.value')).sendKeys('password');
+    var secQuestion = element(by.model('user.securityQuestion'));
+    var selectedSecQuestion = secQuestion.all(by.options
+            ('securityQuestion.key as securityQuestion.content for securityQuestion in availableSecurityQuestions'))
+            .last();
+    selectedSecQuestion.click();
+    element(by.model('user.securityAnswer')).sendKeys('Agata Ferlito');
+    browser.driver.sleep(1000);
+    next();
+
+    //groups
+    var group = element(by.model('dynamicForm.selectedGroups'));
+    var selectedGroup = group.element(by.css('.ui-select-search'));
+    group.click();
+
+    // add "additional", a group with type extensions, and "root".
+    selectedGroup.sendKeys('additional');
+    element.all(by.css('.ui-select-choices-row-inner span')).first().click();
+    selectedGroup.sendKeys('root');
+    element.all(by.css('.ui-select-choices-row-inner span')).first().click();
+    browser.driver.sleep(1000);
+    next();
+
+    //plainSchemas
+    //  count groups in plainschemas: "own" and "additional".
+    element.all(by.repeater('groupSchema in dynamicForm.groupSchemas')).then(function (groupSchema)
{
+      expect(groupSchema.length).toBe(2);
+    })
+    //  fills own fields
+    element(by.css('[name="fullname"]')).clear();
+    element(by.css('[name="fullname"]')).sendKeys('Vincenzo Bellini');
+    element(by.css('[name="userId"]')).clear();
+    element(by.css('[name="userId"]')).sendKeys('bellini@apache.org');
+    var selectedDate = element(by.model('selectedDate')).click();
+    selectedDate.clear();
+    selectedDate.sendKeys('2009-06-21');
+    element(by.css('[name="firstname"]')).clear();
+    element(by.css('[name="firstname"]')).sendKeys('Vincenzo');
+    element(by.css('[name="surname"]')).clear();
+    element(by.css('[name="surname"]')).sendKeys('Bellini');
+    element(by.css('[name="ctype"]')).clear();
+    element(by.css('[name="ctype"]')).sendKeys('bellinictype');
+    next();
+    //derSchemas
+    next();
+    //virSchemas
+    next();
+    //Resources
+    next();
+    browser.driver.sleep(1000);
+    element.all(by.id('cancel')).last().click();
+    browser.driver.sleep(1000);
+  });
+});

http://git-wip-us.apache.org/repos/asf/syncope/blob/ef5784b1/fit/enduser-reference/src/test/resources/org/apache/syncope/client/enduser/protractor/tests/login.js
----------------------------------------------------------------------
diff --git a/fit/enduser-reference/src/test/resources/org/apache/syncope/client/enduser/protractor/tests/login.js
b/fit/enduser-reference/src/test/resources/org/apache/syncope/client/enduser/protractor/tests/login.js
index 0b4fc3e..8cf7b78 100644
--- a/fit/enduser-reference/src/test/resources/org/apache/syncope/client/enduser/protractor/tests/login.js
+++ b/fit/enduser-reference/src/test/resources/org/apache/syncope/client/enduser/protractor/tests/login.js
@@ -17,7 +17,25 @@
  * under the License.
  */
 
-var abstract = require('./abstract.js');
+//var abstract = require('./abstract.js');
 
-abstract.doLogin("bellini", "password");
+//abstract.doLogin("rossini", "password");
 
+
+describe('syncope enduser user login', function () {
+
+  it('should login user', function () {
+    browser.get('http://localhost:9080/syncope-enduser/app/');
+
+    element(by.model('credentials.username')).sendKeys('rossini');
+    element(by.model('credentials.password')).sendKeys('password');
+    element.all(by.options('language.name for language in languages.availableLanguages track
by language.id')).
+            then(function (language) {
+              expect(language.length).toBe(3);
+            });
+    element.all(by.options('language.name for language in languages.availableLanguages track
by language.id')).
+            get(1).click();
+    element(by.id('login-btn')).click();
+
+  });
+});


Mime
View raw message