portals-pluto-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From asfgr...@apache.org
Subject [15/22] portals-pluto git commit: PLUTO-733 Add Status Code Portlet Demo test
Date Thu, 25 Oct 2018 20:19:47 GMT
PLUTO-733 Add Status Code Portlet Demo test


Project: http://git-wip-us.apache.org/repos/asf/portals-pluto/repo
Commit: http://git-wip-us.apache.org/repos/asf/portals-pluto/commit/9341939d
Tree: http://git-wip-us.apache.org/repos/asf/portals-pluto/tree/9341939d
Diff: http://git-wip-us.apache.org/repos/asf/portals-pluto/diff/9341939d

Branch: refs/heads/master
Commit: 9341939ddc5e3f89080872802b1994072a640631
Parents: eb1a84d
Author: Kyle Stiemann <stiemannkj1@gmail.com>
Authored: Fri Oct 12 16:10:38 2018 -0400
Committer: Neil Griffin <neil.griffin.scm@gmail.com>
Committed: Thu Oct 25 15:48:31 2018 -0400

----------------------------------------------------------------------
 .../src/main/webapp/WEB-INF/jsp/view-ascp.jsp   |  2 +-
 .../src/main/webapp/WEB-INF/jsp/view-long.jsp   |  2 +-
 .../test/FragmentIdentifierDemoIT.java          |  3 +-
 .../demo/integration/test/StatusCodeDemoIT.java | 47 ++++++++++++++++++++
 4 files changed, 51 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/9341939d/PortletV3Demo/src/main/webapp/WEB-INF/jsp/view-ascp.jsp
----------------------------------------------------------------------
diff --git a/PortletV3Demo/src/main/webapp/WEB-INF/jsp/view-ascp.jsp b/PortletV3Demo/src/main/webapp/WEB-INF/jsp/view-ascp.jsp
index 7136009..1f4b559 100644
--- a/PortletV3Demo/src/main/webapp/WEB-INF/jsp/view-ascp.jsp
+++ b/PortletV3Demo/src/main/webapp/WEB-INF/jsp/view-ascp.jsp
@@ -40,7 +40,7 @@ limitations under the License.
    </td><td <%=colStyle %>>
    <input name='<%=PARAM_STATUSCODE%>' type='text' value='' size='10' maxlength='10'>
    </td><td <%=colStyle %>>
-   <INPUT VALUE='send' TYPE='submit'>
+   <INPUT ID='<portlet:namespace />-send' VALUE='send' TYPE='submit'>
    </td></tr></table>
 </FORM>
 <p><hr/></p>

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/9341939d/PortletV3Demo/src/main/webapp/WEB-INF/jsp/view-long.jsp
----------------------------------------------------------------------
diff --git a/PortletV3Demo/src/main/webapp/WEB-INF/jsp/view-long.jsp b/PortletV3Demo/src/main/webapp/WEB-INF/jsp/view-long.jsp
index e12f0b2..99b68ea 100644
--- a/PortletV3Demo/src/main/webapp/WEB-INF/jsp/view-long.jsp
+++ b/PortletV3Demo/src/main/webapp/WEB-INF/jsp/view-long.jsp
@@ -43,7 +43,7 @@ limitations under the License.
    </td><td>
    <input name='<%=PARAM_LINE%>' type='text' value='' size='10' maxlength='10'>
    </td></tr><tr><td>
-   <INPUT VALUE='send' TYPE='submit'>
+   <INPUT ID='<portlet:namespace />-send' VALUE='send' TYPE='submit'>
    </td></tr></table>
 </FORM>
 <%

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/9341939d/demo-integration-tests/src/test/java/org/apache/portals/pluto/demo/integration/test/FragmentIdentifierDemoIT.java
----------------------------------------------------------------------
diff --git a/demo-integration-tests/src/test/java/org/apache/portals/pluto/demo/integration/test/FragmentIdentifierDemoIT.java
b/demo-integration-tests/src/test/java/org/apache/portals/pluto/demo/integration/test/FragmentIdentifierDemoIT.java
index a319e1c..8aa5747 100644
--- a/demo-integration-tests/src/test/java/org/apache/portals/pluto/demo/integration/test/FragmentIdentifierDemoIT.java
+++ b/demo-integration-tests/src/test/java/org/apache/portals/pluto/demo/integration/test/FragmentIdentifierDemoIT.java
@@ -39,7 +39,8 @@ public class FragmentIdentifierDemoIT extends DemoTestDriver {
       String fragmentId = "fragmentId";
       sendKeysToElement(driver, waitingAsserter, "//input[@name='frag'][@type='text']", fragmentId);
       sendKeysToElement(driver, waitingAsserter, "//input[@name='line'][@type='text']", "3");
-      clickElement(driver, waitingAsserter, "//input[@value='send'][@type='submit']");
+      clickElement(driver, waitingAsserter,
+         "//input[contains(@id,'Pluto_PortletV3Demo_LongPortlet')][@value='send'][@type='submit']");
       clickElement(driver, waitingAsserter, "//a[text()='Jump to line 3']");
       waitingAsserter.assertTrue(new ExpectedCondition<Boolean>() {
          @Override

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/9341939d/demo-integration-tests/src/test/java/org/apache/portals/pluto/demo/integration/test/StatusCodeDemoIT.java
----------------------------------------------------------------------
diff --git a/demo-integration-tests/src/test/java/org/apache/portals/pluto/demo/integration/test/StatusCodeDemoIT.java
b/demo-integration-tests/src/test/java/org/apache/portals/pluto/demo/integration/test/StatusCodeDemoIT.java
new file mode 100644
index 0000000..3efaa0e
--- /dev/null
+++ b/demo-integration-tests/src/test/java/org/apache/portals/pluto/demo/integration/test/StatusCodeDemoIT.java
@@ -0,0 +1,47 @@
+/*  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.
+ */
+package org.apache.portals.pluto.demo.integration.test;
+
+import org.junit.Test;
+import org.openqa.selenium.By;
+import org.openqa.selenium.WebDriver;
+import org.openqa.selenium.support.ui.ExpectedCondition;
+
+import static org.apache.portals.pluto.demo.integration.test.Util.*;
+import static org.openqa.selenium.support.ui.ExpectedConditions.*;
+
+
+/**
+ *
+ * @author Kyle Stiemann
+ */
+public class StatusCodeDemoIT extends DemoTestDriver {
+
+   @Test
+   public void testStatusCodeDemo() {
+      for (String statusCode : unmodifiableList("404", "200", "500")) {
+         navigateToPage("V3.0 Misc Tests - HTTP SC, fragment id");
+         sendKeysToElement(driver, waitingAsserter, "//input[@name='statusCode'][@type='text']",
statusCode);
+         clickElement(driver, waitingAsserter,
+               "//input[contains(@id,'Pluto_PortletV3Demo_AuthSCPortlet')][@value='send'][@type='submit']");
+         clickElement(driver, waitingAsserter, "//a[text()='Resource URL, status code = "
+ statusCode + "']");
+         waitingAsserter.assertTrue(visibilityOfElementLocated(By.xpath(
+               "//p[contains(text(),'Status code: " + statusCode + "')]")));
+      }
+   }
+}


Mime
View raw message