You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rave.apache.org by cg...@apache.org on 2013/02/27 01:39:01 UTC

svn commit: r1450552 - in /rave/trunk/rave-integration-tests: ./ rave-core-tests/src/main/java/org/apache/rave/integrationtests/pages/ rave-default-account-tests/src/main/java/org/apache/rave/integrationtests/steps/ rave-newuser-tests/src/main/java/org...

Author: cgeer
Date: Wed Feb 27 00:39:01 2013
New Revision: 1450552

URL: http://svn.apache.org/r1450552
Log:
RAVE-900 Fixed iTest errors. 1) Updated iTests for new DB deloyment model. 2) Fixed error in iTest related to new initial data script. 3) Fixed an error with "Stale Element"

Modified:
    rave/trunk/rave-integration-tests/pom.xml
    rave/trunk/rave-integration-tests/rave-core-tests/src/main/java/org/apache/rave/integrationtests/pages/Portal.java
    rave/trunk/rave-integration-tests/rave-default-account-tests/src/main/java/org/apache/rave/integrationtests/steps/PageOperationsSteps.java
    rave/trunk/rave-integration-tests/rave-newuser-tests/src/main/java/org/apache/rave/integrationtests/steps/NewUserSteps.java
    rave/trunk/rave-integration-tests/rave-newuser-tests/src/main/stories/newuser.story

Modified: rave/trunk/rave-integration-tests/pom.xml
URL: http://svn.apache.org/viewvc/rave/trunk/rave-integration-tests/pom.xml?rev=1450552&r1=1450551&r2=1450552&view=diff
==============================================================================
--- rave/trunk/rave-integration-tests/pom.xml (original)
+++ rave/trunk/rave-integration-tests/pom.xml Wed Feb 27 00:39:01 2013
@@ -170,6 +170,12 @@
             <artifactId>commons-logging</artifactId>
             <scope>compile</scope>
         </dependency>
+        <!-- Default database -->
+        <dependency>
+            <groupId>com.h2database</groupId>
+            <artifactId>h2</artifactId>
+            <scope>provided</scope>
+        </dependency>
     </dependencies>
 
     <build>
@@ -297,6 +303,20 @@
                             </deployables>
                             <configuration>
                                 <properties>
+                                    <cargo.datasource.datasource.portalDB>
+                                        cargo.datasource.jndi=jdbc/ravePortalDB|
+                                        cargo.datasource.driver=${portal.dataSource.driver}|
+                                        cargo.datasource.url=${portal.dataSource.url}|
+                                        cargo.datasource.username=${portal.dataSource.username}|
+                                        cargo.datasource.password=${portal.dataSource.password}
+                                    </cargo.datasource.datasource.portalDB>
+                                    <cargo.datasource.datasource.shindigDB>
+                                        cargo.datasource.jndi=jdbc/raveShindigDB|
+                                        cargo.datasource.driver=${shindig.dataSource.driver}|
+                                        cargo.datasource.url=${shindig.dataSource.url}|
+                                        cargo.datasource.username=${shindig.dataSource.username}|
+                                        cargo.datasource.password=${shindig.dataSource.password}
+                                    </cargo.datasource.datasource.shindigDB>
                                     <cargo.jvmargs>
                                         <![CDATA[-Dh2.bindAddress="localhost" -Xdebug -XX:MaxPermSize=256m -Xrunjdwp:transport=dt_socket,address=${cargo.debug.address},server=y,suspend=${cargo.debug.suspend} -noverify ${javaagent} ${cargo.args}]]>
                                     </cargo.jvmargs>
@@ -337,6 +357,11 @@
                                         <artifactId>activation</artifactId>
                                         <classpath>shared</classpath>
                                     </dependency>
+                                    <dependency>
+                                        <groupId>com.h2database</groupId>
+                                        <artifactId>h2</artifactId>
+                                        <classpath>extra</classpath>
+                                    </dependency>
                                 </dependencies>
                             </container>
                         </configuration>

Modified: rave/trunk/rave-integration-tests/rave-core-tests/src/main/java/org/apache/rave/integrationtests/pages/Portal.java
URL: http://svn.apache.org/viewvc/rave/trunk/rave-integration-tests/rave-core-tests/src/main/java/org/apache/rave/integrationtests/pages/Portal.java?rev=1450552&r1=1450551&r2=1450552&view=diff
==============================================================================
--- rave/trunk/rave-integration-tests/rave-core-tests/src/main/java/org/apache/rave/integrationtests/pages/Portal.java (original)
+++ rave/trunk/rave-integration-tests/rave-core-tests/src/main/java/org/apache/rave/integrationtests/pages/Portal.java Wed Feb 27 00:39:01 2013
@@ -56,57 +56,57 @@ public class Portal extends WebDriverPag
     public WebElement getLoginForm() {
         return findElement(By.id("loginForm"));
     }
-	 
-	 public WebElement getOpenIdLoginForm() {
-		  return findElement(By.id("openIdForm"));
-	 }
+
+    public WebElement getOpenIdLoginForm() {
+        return findElement(By.id("openIdForm"));
+    }
 
     public WebElement getEmptyPageBox() {
         return findElement(By.id("emptyPageMessageWrapper"));
     }
 
-	 public void login(String username, String password) {
-		  final WebElement loginForm=getLoginForm();
-		  loginForm.findElement(By.id("usernameField")).sendKeys(username);
-		  loginForm.findElement(By.id("passwordField")).sendKeys(password);
-		  loginForm.submit();
-	 }
-	 
-	 public void openIdLogin(String openIdUrl) {
-		  final WebElement openIdLogin=getOpenIdLoginForm();
-		  openIdLogin.findElement(By.id("openid_identifier")).sendKeys(openIdUrl);
-		  openIdLogin.submit();
-	 }
-
-	 public void logout() {
-		  final WebElement logoutLink=findElement(By.linkText("Logout"));
-		  logoutLink.click();
-	 }
-
-	 public void clickLink(WebElement linkToClick) {
-		  //TODO Should make sure this is clickable.
-		  linkToClick.click();
-	 }
-
-	 public WebElement findElement(By by) {
-     return this.delayedFindElement(by, 1);
-	 }
-
-  // Do 3 attempts with increasing interval to find a DOM element.
-  // The DOM may not have finished when the check is fired.
-  private WebElement delayedFindElement(By by, int attempt) {
-    try {
-      return super.findElement(by);
-    } catch (NoSuchElementException e) {
-      if (attempt >= MAX_ATTEMPTS) {
-        throw e;
-      }
-      try {
-        Thread.sleep(attempt * SLEEP_TIME);
-      } catch (InterruptedException ie) {
-        throw new RuntimeException("Could not sleep thread", ie);
-      }
-      return this.delayedFindElement(by, attempt + 1);
+    public void login(String username, String password) {
+        final WebElement loginForm = getLoginForm();
+        loginForm.findElement(By.id("usernameField")).sendKeys(username);
+        loginForm.findElement(By.id("passwordField")).sendKeys(password);
+        loginForm.submit();
+    }
+
+    public void openIdLogin(String openIdUrl) {
+        final WebElement openIdLogin = getOpenIdLoginForm();
+        openIdLogin.findElement(By.id("openid_identifier")).sendKeys(openIdUrl);
+        openIdLogin.submit();
+    }
+
+    public void logout() {
+        final WebElement logoutLink = findElement(By.linkText("Logout"));
+        logoutLink.click();
+    }
+
+    public void clickLink(WebElement linkToClick) {
+        //TODO Should make sure this is clickable.
+        linkToClick.click();
+    }
+
+    public WebElement findElement(By by) {
+        return this.delayedFindElement(by, 1);
+    }
+
+    // Do 3 attempts with increasing interval to find a DOM element.
+    // The DOM may not have finished when the check is fired.
+    private WebElement delayedFindElement(By by, int attempt) {
+        try {
+            return super.findElement(by);
+        } catch (NoSuchElementException e) {
+            if (attempt >= MAX_ATTEMPTS) {
+                throw e;
+            }
+            try {
+                Thread.sleep(attempt * SLEEP_TIME);
+            } catch (InterruptedException ie) {
+                throw new RuntimeException("Could not sleep thread", ie);
+            }
+            return this.delayedFindElement(by, attempt + 1);
+        }
     }
-  }
 }

Modified: rave/trunk/rave-integration-tests/rave-default-account-tests/src/main/java/org/apache/rave/integrationtests/steps/PageOperationsSteps.java
URL: http://svn.apache.org/viewvc/rave/trunk/rave-integration-tests/rave-default-account-tests/src/main/java/org/apache/rave/integrationtests/steps/PageOperationsSteps.java?rev=1450552&r1=1450551&r2=1450552&view=diff
==============================================================================
--- rave/trunk/rave-integration-tests/rave-default-account-tests/src/main/java/org/apache/rave/integrationtests/steps/PageOperationsSteps.java (original)
+++ rave/trunk/rave-integration-tests/rave-default-account-tests/src/main/java/org/apache/rave/integrationtests/steps/PageOperationsSteps.java Wed Feb 27 00:39:01 2013
@@ -85,6 +85,7 @@ public class PageOperationsSteps {
         sleep(2000L);
         final WebElement deletePageLink = portal.findElement(By.xpath("//li[@id='pageMenuDelete']/a"));
         deletePageLink.click();
+        sleep(2000L);
     }
 
 

Modified: rave/trunk/rave-integration-tests/rave-newuser-tests/src/main/java/org/apache/rave/integrationtests/steps/NewUserSteps.java
URL: http://svn.apache.org/viewvc/rave/trunk/rave-integration-tests/rave-newuser-tests/src/main/java/org/apache/rave/integrationtests/steps/NewUserSteps.java?rev=1450552&r1=1450551&r2=1450552&view=diff
==============================================================================
--- rave/trunk/rave-integration-tests/rave-newuser-tests/src/main/java/org/apache/rave/integrationtests/steps/NewUserSteps.java (original)
+++ rave/trunk/rave-integration-tests/rave-newuser-tests/src/main/java/org/apache/rave/integrationtests/steps/NewUserSteps.java Wed Feb 27 00:39:01 2013
@@ -89,10 +89,10 @@ public class NewUserSteps {
         loginForm.submit();
     }
 
-    @Then("I see my portal page with the add new widgets box")
-    public void iSeeMyEmptyPortalPage() {
-        final WebElement emptyPageBox = portal.getEmptyPageBox();
-        assertThat(emptyPageBox.isDisplayed(), equalTo(Boolean.TRUE));
+    @Then("I see my portal page with the new user widget page")
+    public void iSeeMyNewUserPortalPage() {
+        final WebElement newUserDiv = portal.findElement(By.className("columns_3_newuser_static"));
+        assertThat(newUserDiv.isDisplayed(), equalTo(Boolean.TRUE));
     }
 
 

Modified: rave/trunk/rave-integration-tests/rave-newuser-tests/src/main/stories/newuser.story
URL: http://svn.apache.org/viewvc/rave/trunk/rave-integration-tests/rave-newuser-tests/src/main/stories/newuser.story?rev=1450552&r1=1450551&r2=1450552&view=diff
==============================================================================
--- rave/trunk/rave-integration-tests/rave-newuser-tests/src/main/stories/newuser.story (original)
+++ rave/trunk/rave-integration-tests/rave-newuser-tests/src/main/stories/newuser.story Wed Feb 27 00:39:01 2013
@@ -34,4 +34,4 @@ And I submit the new account form
 Then I see the login page
 And A message appears "Account successfully created"
 When I fill in the login form with username "newuser" password "password"
-Then I see my portal page with the add new widgets box
+Then I see my portal page with the new user widget page