roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ko...@apache.org
Subject svn commit: r1704450 - in /roller/trunk/it-selenium: ./ src/test/java/org/apache/roller/selenium/ src/test/java/org/apache/roller/selenium/core/ src/test/java/org/apache/roller/selenium/editor/
Date Tue, 22 Sep 2015 02:25:59 GMT
Author: kohei
Date: Tue Sep 22 02:25:56 2015
New Revision: 1704450

URL: http://svn.apache.org/viewvc?rev=1704450&view=rev
Log:
Fix Selenium test

Modified:
    roller/trunk/it-selenium/pom.xml
    roller/trunk/it-selenium/src/test/java/org/apache/roller/selenium/AbstractRollerPage.java
    roller/trunk/it-selenium/src/test/java/org/apache/roller/selenium/InitialLoginTestIT.java
    roller/trunk/it-selenium/src/test/java/org/apache/roller/selenium/core/CreateWeblogPage.java
    roller/trunk/it-selenium/src/test/java/org/apache/roller/selenium/editor/AbstractEntryPage.java

Modified: roller/trunk/it-selenium/pom.xml
URL: http://svn.apache.org/viewvc/roller/trunk/it-selenium/pom.xml?rev=1704450&r1=1704449&r2=1704450&view=diff
==============================================================================
--- roller/trunk/it-selenium/pom.xml (original)
+++ roller/trunk/it-selenium/pom.xml Tue Sep 22 02:25:56 2015
@@ -33,7 +33,8 @@
     <packaging>war</packaging>
 
     <properties>
-        <selenium.version>2.39.0</selenium.version>
+        <selenium.version>2.47.1</selenium.version>
+        <javamail.version>1.4.7</javamail.version>
     </properties>
 
     <!-- Process to run Selenium tests (actually no tests right now, just a skeleton)
@@ -184,6 +185,11 @@
                         <artifactId>derbyclient</artifactId>
                         <version>${derby.version}</version>
                     </dependency>
+                    <dependency>
+                        <groupId>javax.mail</groupId>
+                        <artifactId>mail</artifactId>
+                        <version>${javamail.version}</version>
+                    </dependency>
                 </dependencies>
             </plugin>
         </plugins>

Modified: roller/trunk/it-selenium/src/test/java/org/apache/roller/selenium/AbstractRollerPage.java
URL: http://svn.apache.org/viewvc/roller/trunk/it-selenium/src/test/java/org/apache/roller/selenium/AbstractRollerPage.java?rev=1704450&r1=1704449&r2=1704450&view=diff
==============================================================================
--- roller/trunk/it-selenium/src/test/java/org/apache/roller/selenium/AbstractRollerPage.java
(original)
+++ roller/trunk/it-selenium/src/test/java/org/apache/roller/selenium/AbstractRollerPage.java
Tue Sep 22 02:25:56 2015
@@ -21,6 +21,7 @@ import org.openqa.selenium.By;
 import org.openqa.selenium.NoSuchElementException;
 import org.openqa.selenium.WebDriver;
 import org.openqa.selenium.WebElement;
+import org.openqa.selenium.support.ui.Select;
 
 /**
  * Abstract class holding functionality common to Selenium Page Objects
@@ -73,4 +74,9 @@ public abstract class AbstractRollerPage
     protected String getTextById(String fieldId) {
         return driver.findElement(By.id(fieldId)).getText();
     }
+
+    protected void selectOptionByVisibleText(String selectId, String visibleText) {
+        Select select = new Select(driver.findElement(By.id(selectId)));
+        select.selectByVisibleText(visibleText);
+    }
 }
\ No newline at end of file

Modified: roller/trunk/it-selenium/src/test/java/org/apache/roller/selenium/InitialLoginTestIT.java
URL: http://svn.apache.org/viewvc/roller/trunk/it-selenium/src/test/java/org/apache/roller/selenium/InitialLoginTestIT.java?rev=1704450&r1=1704449&r2=1704450&view=diff
==============================================================================
--- roller/trunk/it-selenium/src/test/java/org/apache/roller/selenium/InitialLoginTestIT.java
(original)
+++ roller/trunk/it-selenium/src/test/java/org/apache/roller/selenium/InitialLoginTestIT.java
Tue Sep 22 02:25:56 2015
@@ -35,6 +35,7 @@ import org.apache.roller.selenium.editor
 import org.apache.roller.selenium.editor.EntryEditPage;
 import org.apache.roller.selenium.view.BlogHomePage;
 import org.apache.roller.selenium.view.SingleBlogEntryPage;
+import org.openqa.selenium.firefox.FirefoxProfile;
 
 public class InitialLoginTestIT {
     private WebDriver driver;
@@ -44,7 +45,9 @@ public class InitialLoginTestIT {
 
     @Before
     public void setUp() throws Exception {
-        driver = new FirefoxDriver();
+        FirefoxProfile profile = new FirefoxProfile();
+        profile.setPreference("intl.accept_languages", "en_US");
+        driver = new FirefoxDriver(profile);
         baseUrl = "http://localhost:8080/roller/";
         driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
     }

Modified: roller/trunk/it-selenium/src/test/java/org/apache/roller/selenium/core/CreateWeblogPage.java
URL: http://svn.apache.org/viewvc/roller/trunk/it-selenium/src/test/java/org/apache/roller/selenium/core/CreateWeblogPage.java?rev=1704450&r1=1704449&r2=1704450&view=diff
==============================================================================
--- roller/trunk/it-selenium/src/test/java/org/apache/roller/selenium/core/CreateWeblogPage.java
(original)
+++ roller/trunk/it-selenium/src/test/java/org/apache/roller/selenium/core/CreateWeblogPage.java
Tue Sep 22 02:25:56 2015
@@ -44,6 +44,7 @@ public class CreateWeblogPage extends Ab
         setName(name);
         setHandle(handle);
         setEmail(email);
+        setLocale("English");
         return createWeblog();
     }
 
@@ -63,4 +64,8 @@ public class CreateWeblogPage extends Ab
         setFieldValue("createWeblog_bean_emailAddress", value);
     }
 
+    public void setLocale(String value) {
+        selectOptionByVisibleText("createWeblog_bean_locale", value);
+    }
+
 }

Modified: roller/trunk/it-selenium/src/test/java/org/apache/roller/selenium/editor/AbstractEntryPage.java
URL: http://svn.apache.org/viewvc/roller/trunk/it-selenium/src/test/java/org/apache/roller/selenium/editor/AbstractEntryPage.java?rev=1704450&r1=1704449&r2=1704450&view=diff
==============================================================================
--- roller/trunk/it-selenium/src/test/java/org/apache/roller/selenium/editor/AbstractEntryPage.java
(original)
+++ roller/trunk/it-selenium/src/test/java/org/apache/roller/selenium/editor/AbstractEntryPage.java
Tue Sep 22 02:25:56 2015
@@ -32,7 +32,7 @@ public abstract class AbstractEntryPage
     }
 
     public void setText(String value) {
-        setFieldValue("entry_bean_text", value);
+        setFieldValue("edit_content", value);
     }
 
     public void setSummary(String value) {
@@ -40,7 +40,7 @@ public abstract class AbstractEntryPage
     }
 
     public EntryEditPage postBlogEntry() {
-        clickById("entry_2");
+        clickById("entry_%{#mainAction}!publish");
         return new EntryEditPage(driver);
     }
 }



Mime
View raw message