syncope-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From matte...@apache.org
Subject syncope git commit: [SYNCOPE-973] updates tests
Date Tue, 27 Sep 2016 13:29:15 GMT
Repository: syncope
Updated Branches:
  refs/heads/2_0_X d247b1dd4 -> 496028e82


[SYNCOPE-973] updates tests


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

Branch: refs/heads/2_0_X
Commit: 496028e821d0b279c2777aeba680f97f0bb04378
Parents: d247b1d
Author: Matteo Di Carlo <matteo.dicarlo@tirasa.net>
Authored: Tue Sep 27 15:27:29 2016 +0200
Committer: Matteo Di Carlo <matteo.dicarlo@tirasa.net>
Committed: Tue Sep 27 15:27:29 2016 +0200

----------------------------------------------------------------------
 .../resources/app/views/passwordreset.html      |  6 ++--
 .../enduser/protractor/.LCKprotractor-conf.js~  |  1 -
 .../client/enduser/protractor/tests/create.js   | 28 ++++++++++++----
 .../client/enduser/protractor/tests/edituser.js | 17 ++++++----
 .../enduser/protractor/tests/passwordreset.js   | 35 +++++++++++++++-----
 5 files changed, 62 insertions(+), 25 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/syncope/blob/496028e8/client/enduser/src/main/resources/META-INF/resources/app/views/passwordreset.html
----------------------------------------------------------------------
diff --git a/client/enduser/src/main/resources/META-INF/resources/app/views/passwordreset.html
b/client/enduser/src/main/resources/META-INF/resources/app/views/passwordreset.html
index 693d3f7..47abae5 100644
--- a/client/enduser/src/main/resources/META-INF/resources/app/views/passwordreset.html
+++ b/client/enduser/src/main/resources/META-INF/resources/app/views/passwordreset.html
@@ -52,9 +52,9 @@ under the License.
                      disabled="disabled">              
             </div>
             <div id="attribute" class="form-group" ng-show="$root.pwdResetRequiringSecurityQuestions">
-              <label for="user.securityanswer">{{'SECURITYANSWER'| translate}}</label>
-              <input name="securityanswer" type="text" class="form-control" ng-model="user.securityanswer"

-                     placeholder="Security Answer" >              
+              <label for="user.securityAnswer">{{'SECURITYANSWER'| translate}}</label>
+              <input name="securityAnswer" type="text" class="form-control" ng-model="user.securityAnswer"

+                     placeholder="Security Answer" id="securityAnswer">              
             </div>
             <div id="attribute" class="form-group row">
               <!--captcha-->

http://git-wip-us.apache.org/repos/asf/syncope/blob/496028e8/fit/enduser-reference/src/test/resources/org/apache/syncope/client/enduser/protractor/.LCKprotractor-conf.js~
----------------------------------------------------------------------
diff --git a/fit/enduser-reference/src/test/resources/org/apache/syncope/client/enduser/protractor/.LCKprotractor-conf.js~
b/fit/enduser-reference/src/test/resources/org/apache/syncope/client/enduser/protractor/.LCKprotractor-conf.js~
deleted file mode 100644
index 912d2e1..0000000
--- a/fit/enduser-reference/src/test/resources/org/apache/syncope/client/enduser/protractor/.LCKprotractor-conf.js~
+++ /dev/null
@@ -1 +0,0 @@
-/home/matt3o/WORKINGDIR/SYNCOPE/Syncope_Source/syncope/fit/enduser-reference/src/test/resources/org/apache/syncope/client/enduser/protractor/protractor-conf.js
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/syncope/blob/496028e8/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 cdd9dae..52674c7 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
@@ -20,12 +20,15 @@
 var abstract = require('./abstract.js');
 
 describe('syncope enduser user create', function () {
-
   it('should create user donizetti', function () {
-    console.log("create user test");
+    console.log("");
+    console.log("user create");
     abstract.goHome();
-
+    abstract.waitSpinner();
+    browser.wait(element(by.id('register')).isPresent());
     element(by.id('register')).click();
+
+    browser.wait(element(by.id('user.username')).isPresent());
     element(by.model('user.username')).sendKeys('donizetti');
     element(by.model('user.password')).sendKeys('password123');
     element(by.model('confirmPassword.value')).sendKeys('password123');
@@ -33,20 +36,33 @@ describe('syncope enduser user create', function () {
     element(by.cssContainingText('option', 'What\'s your mother\'s maiden name?')).click();
 
     browser.wait(element(by.id('user.securityAnswer')).isPresent());
-    element(by.model('user.securityAnswer')).sendKeys('Agata Ferlito');
-
+    element(by.model('user.securityAnswer')).sendKeys('Domenica Oliva Nava');
     element.all(by.id('next')).first().click();
+
+    //groups
+    var group = element(by.model('dynamicForm.selectedGroups'));
+    var selectedGroup = group.element(by.css('.ui-select-search'));
+    group.click();
+    //adds group root
+    selectedGroup.sendKeys('root');
+    element.all(by.css('.ui-select-choices-row-inner span')).first().click();
+    abstract.waitSpinner();
     element.all(by.id('next')).first().click();
 
+    //plainSchemas
     element.all(by.name('fullname')).first().sendKeys('Gaetano Donizetti');
     element.all(by.name('userId')).first().sendKeys('donizetti@apache.org');
     element.all(by.name('firstname')).first().sendKeys('Gaetano');
     element.all(by.name('surname')).first().sendKeys('Donizetti');
-
     element.all(by.id('next')).first().click();
+
+    //derivedSchemas
     element.all(by.id('next')).first().click();
+
+    //virtualSchemas
     element.all(by.id('next')).first().click();
     element.all(by.id('next')).first().click();
+
     element.all(by.id('save')).last().click();
   });
 });
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/syncope/blob/496028e8/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
index e307926..189dc0d 100644
--- 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
@@ -16,11 +16,13 @@
  * specific language governing permissions and limitations
  * under the License.
  */
+
 var abstract = require('./abstract.js');
 describe('syncope enduser user edit', function () {
   it('should edit user', function () {
 
-    console.log("user edit test");
+    console.log("");
+    console.log("user edit");
     abstract.goHome();
 
     //login
@@ -36,11 +38,12 @@ describe('syncope enduser user edit', function () {
     element(by.id('login-btn')).click();
 
     //credential
+    browser.wait(element(by.id('user.username')).isPresent());
     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');
+    element(by.model('user.password')).sendKeys('Password123');
+    element(by.model('confirmPassword.value')).sendKeys('Password123');
     var secQuestion = element(by.model('user.securityQuestion'));
     var selectedSecQuestion = secQuestion.all(by.options
             ('securityQuestion.key as securityQuestion.content for securityQuestion in availableSecurityQuestions'))
@@ -53,8 +56,8 @@ describe('syncope enduser user edit', function () {
     var group = element(by.model('dynamicForm.selectedGroups'));
     var selectedGroup = group.element(by.css('.ui-select-search'));
     group.click();
-    //adds group root
 
+    //adds group root
     selectedGroup.sendKeys('root');
     element.all(by.css('.ui-select-choices-row-inner span')).first().click();
     abstract.waitSpinner();
@@ -75,12 +78,11 @@ describe('syncope enduser user edit', function () {
     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');
 
     abstract.doNext();
+
     //derSchemas
     abstract.doNext();
     //virSchemas
@@ -88,6 +90,9 @@ describe('syncope enduser user edit', function () {
     //Resources
     abstract.doNext();
     //Captcha
+    abstract.waitSpinner();
     element.all(by.id('save')).last().click();
+    abstract.waitSpinner();
   });
 });
+

http://git-wip-us.apache.org/repos/asf/syncope/blob/496028e8/fit/enduser-reference/src/test/resources/org/apache/syncope/client/enduser/protractor/tests/passwordreset.js
----------------------------------------------------------------------
diff --git a/fit/enduser-reference/src/test/resources/org/apache/syncope/client/enduser/protractor/tests/passwordreset.js
b/fit/enduser-reference/src/test/resources/org/apache/syncope/client/enduser/protractor/tests/passwordreset.js
index ed4211b..0ceaf02 100644
--- a/fit/enduser-reference/src/test/resources/org/apache/syncope/client/enduser/protractor/tests/passwordreset.js
+++ b/fit/enduser-reference/src/test/resources/org/apache/syncope/client/enduser/protractor/tests/passwordreset.js
@@ -17,21 +17,38 @@
  * under the License.
  */
 
-
 var abstract = require('./abstract.js');
 
-describe('syncope enduser user reset password', function () {
-
-  it('should reset password for user bellini', function () {
-    console.log("password reset test");
+describe('syncope enduser user password reset ', function () {
+  it('should reset password for user donizetti', function () {
+    console.log("");
+    console.log("user password reset");
     abstract.goHome();
-    browser.wait(element(by.id('passwordreset')).isPresent());
+
+    abstract.waitSpinner();
     element(by.id('passwordreset')).click();
+    abstract.waitSpinner();
 
-    element(by.model('user.username')).sendKeys('donizetti');
+    var user = element(by.model('user.username'));
+    user.click();
+    user.sendKeys('donizetti');
+    user.click();
     element(by.model('user.username')).sendKeys(protractor.Key.TAB);
 
-    browser.wait(element(by.id('user.securityanswer')).isPresent());
-    element(by.model('user.securityanswer')).sendKeys('Agata Ferlito');
+    var secQuest = element(by.model('userSecurityQuestion'));
+    expect(secQuest.isEnabled()).toBe(false);
+    expect(element(by.model('userSecurityQuestion')).getAttribute('value')).toEqual('What\'s
your mother\'s maiden name?');
+    abstract.waitSpinner();
+
+    var secAns = element(by.model('user.securityAnswer'));
+    var EC = protractor.ExpectedConditions;
+    browser.wait(EC.presenceOf(secAns), 5000).then(function () {
+      secAns.click();
+      secAns.sendKeys('Domenica Oliva Nava');
+    }, function (error) {
+      expect(true).toBe(false);
+    });
+
+    element.all(by.id('resetpassword')).last().click();
   });
 });
\ No newline at end of file


Mime
View raw message