Author: gmazza
Date: Wed Aug 14 03:45:04 2013
New Revision: 1513719
URL: http://svn.apache.org/r1513719
Log:
Updated Selenium tests to set Roller's front page blog.
Added:
roller/trunk/it-selenium/src/test/java/org/apache/roller/selenium/view/BlogHomePage.java
Modified:
roller/trunk/app/src/main/webapp/themes/basic/weblog.vm
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/SetupPage.java
Modified: roller/trunk/app/src/main/webapp/themes/basic/weblog.vm
URL:
http://svn.apache.org/viewvc/roller/trunk/app/src/main/webapp/themes/basic/weblog.vm?rev=1513719&r1=1513718&r2=1513719&view=diff
==============================================================================
--- roller/trunk/app/src/main/webapp/themes/basic/weblog.vm (original)
+++ roller/trunk/app/src/main/webapp/themes/basic/weblog.vm Wed Aug 14 03:45:04
2013
@@ -17,7 +17,7 @@ function setCookie(c_name, value, exdays
setCookie("roller_user_request_type","standard",30);
</script>
-<div class="content_wrapper">
+<div id="id_weblog" class="content_wrapper">
<div class="content">
<h1 class="weblogName">$utils.escapeHTML($model.weblog.name)</h1>
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=1513719&r1=1513718&r2=1513719&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
Wed Aug 14 03:45:04 2013
@@ -33,6 +33,7 @@ import org.apache.roller.selenium.core.S
import org.apache.roller.selenium.core.WelcomePage;
import org.apache.roller.selenium.editor.EntryAddPage;
import org.apache.roller.selenium.editor.EntryEditPage;
+import org.apache.roller.selenium.view.BlogHomePage;
import org.apache.roller.selenium.view.SingleBlogEntryPage;
public class InitialLoginTestIT {
@@ -50,9 +51,7 @@ public class InitialLoginTestIT {
@Test
public void testInitialLogin() throws Exception {
- String blogEntryTitle = "My First Blog Entry";
- String blogEntryContent = "Welcome to my blog!";
-
+ // create new user and first blog
driver.get(baseUrl);
SetupPage sp = new SetupPage(driver);
RegisterPage rp = sp.createNewUser();
@@ -62,7 +61,14 @@ public class InitialLoginTestIT {
CreateWeblogPage cwp = mmp.createWeblog();
mmp = cwp.createWeblog("Bob's Blog", "bobsblog", "[email protected]");
- EntryAddPage eap = mmp.createNewBlogEntry();
+ // set bobsblog as the front page blog
+ driver.get(baseUrl);
+ BlogHomePage bhp = sp.chooseFrontPageBlog();
+
+ // create and read first blog entry
+ String blogEntryTitle = "My First Blog Entry";
+ String blogEntryContent = "Welcome to my blog!";
+ EntryAddPage eap = bhp.createNewBlogEntry();
eap.setTitle(blogEntryTitle);
eap.setText(blogEntryContent);
EntryEditPage eep = eap.postBlogEntry();
Modified:
roller/trunk/it-selenium/src/test/java/org/apache/roller/selenium/core/SetupPage.java
URL:
http://svn.apache.org/viewvc/roller/trunk/it-selenium/src/test/java/org/apache/roller/selenium/core/SetupPage.java?rev=1513719&r1=1513718&r2=1513719&view=diff
==============================================================================
---
roller/trunk/it-selenium/src/test/java/org/apache/roller/selenium/core/SetupPage.java
(original)
+++
roller/trunk/it-selenium/src/test/java/org/apache/roller/selenium/core/SetupPage.java
Wed Aug 14 03:45:04 2013
@@ -18,6 +18,7 @@
package org.apache.roller.selenium.core;
import org.apache.roller.selenium.AbstractRollerPage;
+import org.apache.roller.selenium.view.BlogHomePage;
import org.openqa.selenium.WebDriver;
/**
@@ -40,4 +41,8 @@ public class SetupPage extends AbstractR
return new RegisterPage(driver);
}
+ public BlogHomePage chooseFrontPageBlog() {
+ clickById("setup_0");
+ return new BlogHomePage(driver);
+ }
}
\ No newline at end of file
Added:
roller/trunk/it-selenium/src/test/java/org/apache/roller/selenium/view/BlogHomePage.java
URL:
http://svn.apache.org/viewvc/roller/trunk/it-selenium/src/test/java/org/apache/roller/selenium/view/BlogHomePage.java?rev=1513719&view=auto
==============================================================================
---
roller/trunk/it-selenium/src/test/java/org/apache/roller/selenium/view/BlogHomePage.java
(added)
+++
roller/trunk/it-selenium/src/test/java/org/apache/roller/selenium/view/BlogHomePage.java
Wed Aug 14 03:45:04 2013
@@ -0,0 +1,43 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. 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. For additional information regarding
+ * copyright in this work, please see the NOTICE file in the top level
+ * directory of this distribution.
+ */
+package org.apache.roller.selenium.view;
+
+import org.apache.roller.selenium.AbstractRollerPage;
+import org.apache.roller.selenium.editor.EntryAddPage;
+import org.openqa.selenium.WebDriver;
+
+import java.lang.String;
+
+/**
+ * Represents a URL for the home page of a blog
+ * (URL similar to http://localhost:8080/roller/myblog)
+ */
+public class BlogHomePage extends AbstractRollerPage {
+
+ public BlogHomePage(WebDriver driver) {
+ this.driver = driver;
+ this.pageName = "blog home page";
+ verifyIdOnPage("id_weblog");
+ }
+
+ public EntryAddPage createNewBlogEntry() {
+ clickByLinkText("New Entry");
+ return new EntryAddPage(driver);
+ }
+
+}