syncope-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ilgro...@apache.org
Subject [1/2] syncope git commit: [SYNCOPE-987] Fixing Enduser IT
Date Fri, 30 Dec 2016 11:58:37 GMT
Repository: syncope
Updated Branches:
  refs/heads/2_0_X e0c087d09 -> 02722801b
  refs/heads/master c615370e1 -> 5b00c8c8c


[SYNCOPE-987] Fixing Enduser IT


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

Branch: refs/heads/2_0_X
Commit: 02722801bc7ec8008210990beb394048947e7da8
Parents: e0c087d
Author: Francesco Chicchiriccò <ilgrosso@apache.org>
Authored: Fri Dec 30 12:58:12 2016 +0100
Committer: Francesco Chicchiriccò <ilgrosso@apache.org>
Committed: Fri Dec 30 12:58:12 2016 +0100

----------------------------------------------------------------------
 fit/enduser-reference/pom.xml                   | 47 ++++++----
 .../enduser/protractor/protractor-conf.js       | 36 --------
 .../client/enduser/protractor/tests/abstract.js | 43 ---------
 .../client/enduser/protractor/tests/create.js   | 73 ---------------
 .../client/enduser/protractor/tests/edit.js     | 94 --------------------
 .../enduser/protractor/tests/passwordreset.js   | 54 -----------
 .../src/test/resources/protractor-conf.js       | 36 ++++++++
 .../src/test/resources/tests/abstract.js        | 43 +++++++++
 .../src/test/resources/tests/create.js          | 73 +++++++++++++++
 .../src/test/resources/tests/edit.js            | 94 ++++++++++++++++++++
 .../src/test/resources/tests/passwordreset.js   | 54 +++++++++++
 11 files changed, 332 insertions(+), 315 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/syncope/blob/02722801/fit/enduser-reference/pom.xml
----------------------------------------------------------------------
diff --git a/fit/enduser-reference/pom.xml b/fit/enduser-reference/pom.xml
index a350315..d490d12 100644
--- a/fit/enduser-reference/pom.xml
+++ b/fit/enduser-reference/pom.xml
@@ -36,6 +36,8 @@ under the License.
   <properties>
     <rootpom.basedir>${basedir}/../..</rootpom.basedir>
     <enduser-test.dir>${project.build.directory}/enduser-test</enduser-test.dir>
+    <protractor.cmd>${enduser-test.dir}/nodejs/bin/protractor</protractor.cmd>
+    <webdriver-manager.cmd>${enduser-test.dir}/nodejs/bin/webdriver-manager</webdriver-manager.cmd>
   </properties>
 
   <dependencies>
@@ -135,18 +137,19 @@ under the License.
         <artifactId>phantomjs-maven-plugin</artifactId>
         <configuration>
           <version>${phantomjs.version}</version>
-          <checkSystemPath>false</checkSystemPath>          
+          <checkSystemPath>false</checkSystemPath>
           <skip>${skipTests}</skip>
-        </configuration> 
+        </configuration>
         <executions>
           <execution>
+            <id>install-phantomjs</id>
             <goals>
               <goal>install</goal>
             </goals>
           </execution>
         </executions>
       </plugin>
-           
+
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-antrun-plugin</artifactId>
@@ -156,13 +159,14 @@ under the License.
             <id>setup-enduser-it</id>
             <phase>pre-integration-test</phase>
             <configuration>
-              <target>               
-                <mkdir dir="${enduser-test.dir}" />
+              <target>
+                <mkdir dir="${enduser-test.dir}"/>
                 <copy todir="${enduser-test.dir}" overwrite="true">
-                  <fileset dir="${basedir}/src/test/resources/org/apache/syncope/client/enduser/protractor/"
includes="**/*" />                  
+                  <file name="${project.build.directory}/test-classes/protractor-conf.js"/>
+                  <fileset dir="${project.build.directory}/test-classes" includes="tests/**"/>
                 </copy>
-                <replace file="${enduser-test.dir}/protractor-conf.js" token="@phantomjs.binary.path@"
value="${phantomjs.binary}" />
-                <delete file="${basedir}/../core-reference/target/syncope-fit-core-reference-${project.version}/WEB-INF/classes/userWorkflow.bpmn20.xml"
/>
+
+                <delete file="${basedir}/../core-reference/target/syncope-fit-core-reference-${project.version}/WEB-INF/classes/userWorkflow.bpmn20.xml"/>
               </target>
               <skip>${skipTests}</skip>
             </configuration>
@@ -172,7 +176,7 @@ under the License.
           </execution>
         </executions>
       </plugin>     
-                                                                        
+
       <plugin>
         <groupId>com.github.eirslett</groupId>
         <artifactId>frontend-maven-plugin</artifactId>
@@ -182,7 +186,7 @@ under the License.
         </configuration>
         <executions>
           <execution>
-            <id>install node and npm</id>
+            <id>install-node-npm</id>
             <phase>pre-integration-test</phase>            
             <goals>
               <goal>install-node-and-npm</goal>
@@ -204,7 +208,7 @@ under the License.
         </configuration>
         <executions>
           <execution>            
-            <id>Install Protractor</id>
+            <id>install-protractor</id>
             <phase>pre-integration-test</phase>
             <goals>
               <goal>exec</goal>
@@ -221,7 +225,7 @@ under the License.
             </configuration>
           </execution>
           <execution>            
-            <id>Install Agent</id>
+            <id>update-protractor-webdriver-manager</id>
             <phase>pre-integration-test</phase>
             <goals>
               <goal>exec</goal>
@@ -230,13 +234,13 @@ under the License.
               <workingDirectory>${enduser-test.dir}/nodejs/lib</workingDirectory>
               <executable>${enduser-test.dir}/nodejs/node/node</executable>
               <arguments>
-                <argument>node_modules/protractor/bin/webdriver-manager</argument>
+                <argument>${webdriver-manager.cmd}</argument>
                 <argument>update</argument>                             
               </arguments>
             </configuration>
           </execution>
           <execution>            
-            <id>Execute Tests</id>
+            <id>exec-protractor</id>
             <phase>integration-test</phase>
             <goals>
               <goal>exec</goal>
@@ -244,7 +248,7 @@ under the License.
             <configuration>
               <executable>${enduser-test.dir}/nodejs/node/node</executable>
               <arguments>
-                <argument>${enduser-test.dir}/nodejs/bin/protractor</argument>
+                <argument>${protractor.cmd}</argument>
                 <argument>${enduser-test.dir}/protractor-conf.js</argument> 
                           
               </arguments>
             </configuration>
@@ -381,6 +385,19 @@ under the License.
   
   <profiles>
     <profile>
+      <id>windows-it</id>
+
+      <activation>
+        <os><family>Windows</family></os>
+      </activation>
+
+      <properties>
+	<protractor.cmd>${enduser-test.dir}/nodejs/node/node_modules/protractor/bin/protractor</protractor.cmd>
+	<webdriver-manager.cmd>${enduser-test.dir}/nodejs/node/node_modules/protractor/bin/webdriver-manager</webdriver-manager.cmd>
+      </properties>
+    </profile>
+
+    <profile>
       <id>debug</id>
 
       <properties>

http://git-wip-us.apache.org/repos/asf/syncope/blob/02722801/fit/enduser-reference/src/test/resources/org/apache/syncope/client/enduser/protractor/protractor-conf.js
----------------------------------------------------------------------
diff --git a/fit/enduser-reference/src/test/resources/org/apache/syncope/client/enduser/protractor/protractor-conf.js
b/fit/enduser-reference/src/test/resources/org/apache/syncope/client/enduser/protractor/protractor-conf.js
deleted file mode 100644
index 52b5977..0000000
--- a/fit/enduser-reference/src/test/resources/org/apache/syncope/client/enduser/protractor/protractor-conf.js
+++ /dev/null
@@ -1,36 +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.
- */
-exports.config = {
-  directConnect: false,
-  capabilities: {
-    'browserName': 'phantomjs',
-    'phantomjs.binary.path': '@phantomjs.binary.path@',
-    'phantomjs.ghostdriver.cli.args': ['--loglevel=DEBUG']
-  },
-  
-  allScriptsTimeout: 241000,
-  
-  jasmineNodeOpts: {
-    defaultTimeoutInterval: 2500000
-  },
-  
-  // Spec patterns are relative to the current working directly when protractor is called.
-  specs: ['tests/*.js'],
-  exclude: ['tests/abstract.js']
-};

http://git-wip-us.apache.org/repos/asf/syncope/blob/02722801/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
deleted file mode 100644
index 1f1b2ec..0000000
--- a/fit/enduser-reference/src/test/resources/org/apache/syncope/client/enduser/protractor/tests/abstract.js
+++ /dev/null
@@ -1,43 +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.
- */
-exports.goHome = function () {
-  var home = 'http://localhost:9080/syncope-enduser/app/';
-  browser.get(home);
-};
-
-exports.doNext = function () {
-  element.all(by.id('next')).last().click();
-};
-
-exports.doCancel = function () {
-  element.all(by.id('cancel')).last().click();
-};
-
-exports.doSave = function () {
-  element.all(by.id('save')).last().click();
-};
-
-exports.waitSpinner = function () {
-  element.all(by.css('treasure-overlay-spinner')).isDisplayed().then(function (result) {
-    if (result) {
-      browser.driver.sleep(3000);
-    }
-  });
-}
-;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/syncope/blob/02722801/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
deleted file mode 100644
index 0da74b4..0000000
--- a/fit/enduser-reference/src/test/resources/org/apache/syncope/client/enduser/protractor/tests/create.js
+++ /dev/null
@@ -1,73 +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.
- */
-
-var abstract = require('./abstract.js');
-describe('syncope enduser user create', function () {
-  it('should create user donizetti', function () {
-    console.log("");
-    console.log("user create");
-    abstract.goHome();
-    browser.wait(element(by.id('register')).isPresent());
-    element(by.id('register')).click();
-
-    //creadentials
-    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');
-    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('Domenica Oliva Nava');
-    element.all(by.id('next')).first().click();
-
-    //groups
-    browser.wait(element(by.model('user.realm')).isPresent());
-    element(by.model('user.realm')).click();
-    element.all(by.repeater('realm in availableRealms')).get(1).click();
-    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
-    abstract.waitSpinner();
-    browser.wait(element(by.name('fullname')).isPresent());
-    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,virtualSchemas,resources
-    for (var i = 0; i < 3; i++) {
-      element.all(by.id('next')).first().click();
-    }
-    //finish: breadcrumb should be clickable, testing navigation
-    for (var i = 0; i < 5; i++) {
-      element.all(by.repeater('(key, value) in wizard')).get(i).click();
-      browser.wait(element(by.id('finish')).isPresent());
-      element.all(by.id('finish')).last().click();
-    }
-    element.all(by.id('save')).last().click();
-  });
-});

http://git-wip-us.apache.org/repos/asf/syncope/blob/02722801/fit/enduser-reference/src/test/resources/org/apache/syncope/client/enduser/protractor/tests/edit.js
----------------------------------------------------------------------
diff --git a/fit/enduser-reference/src/test/resources/org/apache/syncope/client/enduser/protractor/tests/edit.js
b/fit/enduser-reference/src/test/resources/org/apache/syncope/client/enduser/protractor/tests/edit.js
deleted file mode 100644
index 9c49f44..0000000
--- a/fit/enduser-reference/src/test/resources/org/apache/syncope/client/enduser/protractor/tests/edit.js
+++ /dev/null
@@ -1,94 +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.
- */
-
-var abstract = require('./abstract.js');
-describe('syncope enduser user edit', function () {
-  it('should edit user', function () {
-    console.log("");
-    console.log("user edit");
-    abstract.goHome();
-
-    //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(1).click();
-    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('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'))
-            .last();
-    selectedSecQuestion.click();
-    element(by.model('user.securityAnswer')).sendKeys('Agata Ferlito');
-    abstract.doNext();
-
-    //groups
-    browser.wait(element(by.model('user.realm')).isPresent());
-    element(by.model('user.realm')).click();
-    element.all(by.repeater('realm in availableRealms')).get(0).click();
-    browser.wait(element(by.model('dynamicForm.selectedGroups')).isPresent());
-    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();
-    abstract.doNext();
-
-    //plainSchemas
-    element.all(by.repeater('groupSchema in dynamicForm.groupSchemas')).then(function (groupSchema)
{
-      expect(groupSchema.length).toBe(1);
-    });
-    element.all(by.css('[name="fullname"]')).first().clear();
-    element.all(by.css('[name="fullname"]')).first().sendKeys('Vincenzo Bellini');
-    element.all(by.css('[name="userId"]')).first().clear();
-    element.all(by.css('[name="userId"]')).first().sendKeys('bellini@apache.org');
-    element.all(by.model('selectedDate')).first().clear();
-    element.all(by.model('selectedDate')).first().sendKeys('2009-06-21');
-    element.all(by.css('[name="firstname"]')).first().clear();
-    element.all(by.css('[name="firstname"]')).first().sendKeys('Vincenzo');
-    element.all(by.css('[name="ctype"]')).first().clear();
-    element.all(by.css('[name="ctype"]')).first().sendKeys('bellinictype');
-    abstract.doNext();
-    //derSchemas
-    abstract.doNext();
-    //virSchemas
-    abstract.doNext();
-    //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/02722801/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
deleted file mode 100644
index 0ceaf02..0000000
--- a/fit/enduser-reference/src/test/resources/org/apache/syncope/client/enduser/protractor/tests/passwordreset.js
+++ /dev/null
@@ -1,54 +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.
- */
-
-var abstract = require('./abstract.js');
-
-describe('syncope enduser user password reset ', function () {
-  it('should reset password for user donizetti', function () {
-    console.log("");
-    console.log("user password reset");
-    abstract.goHome();
-
-    abstract.waitSpinner();
-    element(by.id('passwordreset')).click();
-    abstract.waitSpinner();
-
-    var user = element(by.model('user.username'));
-    user.click();
-    user.sendKeys('donizetti');
-    user.click();
-    element(by.model('user.username')).sendKeys(protractor.Key.TAB);
-
-    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

http://git-wip-us.apache.org/repos/asf/syncope/blob/02722801/fit/enduser-reference/src/test/resources/protractor-conf.js
----------------------------------------------------------------------
diff --git a/fit/enduser-reference/src/test/resources/protractor-conf.js b/fit/enduser-reference/src/test/resources/protractor-conf.js
new file mode 100644
index 0000000..efc31f9
--- /dev/null
+++ b/fit/enduser-reference/src/test/resources/protractor-conf.js
@@ -0,0 +1,36 @@
+/* 
+ * 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.
+ */
+exports.config = {
+  directConnect: false,
+  capabilities: {
+    'browserName': 'phantomjs',
+    'phantomjs.binary.path': '${phantomjs.binary}',
+    'phantomjs.ghostdriver.cli.args': ['--loglevel=DEBUG']
+  },
+  
+  allScriptsTimeout: 241000,
+  
+  jasmineNodeOpts: {
+    defaultTimeoutInterval: 2500000
+  },
+  
+  // Spec patterns are relative to the current working directly when protractor is called.
+  specs: ['tests/*.js'],
+  exclude: ['tests/abstract.js']
+};

http://git-wip-us.apache.org/repos/asf/syncope/blob/02722801/fit/enduser-reference/src/test/resources/tests/abstract.js
----------------------------------------------------------------------
diff --git a/fit/enduser-reference/src/test/resources/tests/abstract.js b/fit/enduser-reference/src/test/resources/tests/abstract.js
new file mode 100644
index 0000000..1f1b2ec
--- /dev/null
+++ b/fit/enduser-reference/src/test/resources/tests/abstract.js
@@ -0,0 +1,43 @@
+/* 
+ * 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.
+ */
+exports.goHome = function () {
+  var home = 'http://localhost:9080/syncope-enduser/app/';
+  browser.get(home);
+};
+
+exports.doNext = function () {
+  element.all(by.id('next')).last().click();
+};
+
+exports.doCancel = function () {
+  element.all(by.id('cancel')).last().click();
+};
+
+exports.doSave = function () {
+  element.all(by.id('save')).last().click();
+};
+
+exports.waitSpinner = function () {
+  element.all(by.css('treasure-overlay-spinner')).isDisplayed().then(function (result) {
+    if (result) {
+      browser.driver.sleep(3000);
+    }
+  });
+}
+;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/syncope/blob/02722801/fit/enduser-reference/src/test/resources/tests/create.js
----------------------------------------------------------------------
diff --git a/fit/enduser-reference/src/test/resources/tests/create.js b/fit/enduser-reference/src/test/resources/tests/create.js
new file mode 100644
index 0000000..0da74b4
--- /dev/null
+++ b/fit/enduser-reference/src/test/resources/tests/create.js
@@ -0,0 +1,73 @@
+/* 
+ * 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 create', function () {
+  it('should create user donizetti', function () {
+    console.log("");
+    console.log("user create");
+    abstract.goHome();
+    browser.wait(element(by.id('register')).isPresent());
+    element(by.id('register')).click();
+
+    //creadentials
+    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');
+    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('Domenica Oliva Nava');
+    element.all(by.id('next')).first().click();
+
+    //groups
+    browser.wait(element(by.model('user.realm')).isPresent());
+    element(by.model('user.realm')).click();
+    element.all(by.repeater('realm in availableRealms')).get(1).click();
+    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
+    abstract.waitSpinner();
+    browser.wait(element(by.name('fullname')).isPresent());
+    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,virtualSchemas,resources
+    for (var i = 0; i < 3; i++) {
+      element.all(by.id('next')).first().click();
+    }
+    //finish: breadcrumb should be clickable, testing navigation
+    for (var i = 0; i < 5; i++) {
+      element.all(by.repeater('(key, value) in wizard')).get(i).click();
+      browser.wait(element(by.id('finish')).isPresent());
+      element.all(by.id('finish')).last().click();
+    }
+    element.all(by.id('save')).last().click();
+  });
+});

http://git-wip-us.apache.org/repos/asf/syncope/blob/02722801/fit/enduser-reference/src/test/resources/tests/edit.js
----------------------------------------------------------------------
diff --git a/fit/enduser-reference/src/test/resources/tests/edit.js b/fit/enduser-reference/src/test/resources/tests/edit.js
new file mode 100644
index 0000000..9c49f44
--- /dev/null
+++ b/fit/enduser-reference/src/test/resources/tests/edit.js
@@ -0,0 +1,94 @@
+/* 
+ * 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 () {
+  it('should edit user', function () {
+    console.log("");
+    console.log("user edit");
+    abstract.goHome();
+
+    //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(1).click();
+    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('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'))
+            .last();
+    selectedSecQuestion.click();
+    element(by.model('user.securityAnswer')).sendKeys('Agata Ferlito');
+    abstract.doNext();
+
+    //groups
+    browser.wait(element(by.model('user.realm')).isPresent());
+    element(by.model('user.realm')).click();
+    element.all(by.repeater('realm in availableRealms')).get(0).click();
+    browser.wait(element(by.model('dynamicForm.selectedGroups')).isPresent());
+    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();
+    abstract.doNext();
+
+    //plainSchemas
+    element.all(by.repeater('groupSchema in dynamicForm.groupSchemas')).then(function (groupSchema)
{
+      expect(groupSchema.length).toBe(1);
+    });
+    element.all(by.css('[name="fullname"]')).first().clear();
+    element.all(by.css('[name="fullname"]')).first().sendKeys('Vincenzo Bellini');
+    element.all(by.css('[name="userId"]')).first().clear();
+    element.all(by.css('[name="userId"]')).first().sendKeys('bellini@apache.org');
+    element.all(by.model('selectedDate')).first().clear();
+    element.all(by.model('selectedDate')).first().sendKeys('2009-06-21');
+    element.all(by.css('[name="firstname"]')).first().clear();
+    element.all(by.css('[name="firstname"]')).first().sendKeys('Vincenzo');
+    element.all(by.css('[name="ctype"]')).first().clear();
+    element.all(by.css('[name="ctype"]')).first().sendKeys('bellinictype');
+    abstract.doNext();
+    //derSchemas
+    abstract.doNext();
+    //virSchemas
+    abstract.doNext();
+    //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/02722801/fit/enduser-reference/src/test/resources/tests/passwordreset.js
----------------------------------------------------------------------
diff --git a/fit/enduser-reference/src/test/resources/tests/passwordreset.js b/fit/enduser-reference/src/test/resources/tests/passwordreset.js
new file mode 100644
index 0000000..0ceaf02
--- /dev/null
+++ b/fit/enduser-reference/src/test/resources/tests/passwordreset.js
@@ -0,0 +1,54 @@
+/* 
+ * 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 password reset ', function () {
+  it('should reset password for user donizetti', function () {
+    console.log("");
+    console.log("user password reset");
+    abstract.goHome();
+
+    abstract.waitSpinner();
+    element(by.id('passwordreset')).click();
+    abstract.waitSpinner();
+
+    var user = element(by.model('user.username'));
+    user.click();
+    user.sendKeys('donizetti');
+    user.click();
+    element(by.model('user.username')).sendKeys(protractor.Key.TAB);
+
+    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