portals-pluto-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From asfgr...@apache.org
Subject [22/22] portals-pluto git commit: PLUTO-733 Add Header Phase Portlet Demo test
Date Thu, 25 Oct 2018 20:19:54 GMT
PLUTO-733 Add Header Phase 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/89672e7e
Tree: http://git-wip-us.apache.org/repos/asf/portals-pluto/tree/89672e7e
Diff: http://git-wip-us.apache.org/repos/asf/portals-pluto/diff/89672e7e

Branch: refs/heads/master
Commit: 89672e7e4fbaeaecbb24296693254133747c9cf0
Parents: 6028492
Author: Kyle Stiemann <stiemannkj1@gmail.com>
Authored: Fri Oct 12 17:25:00 2018 -0400
Committer: Neil Griffin <neil.griffin.scm@gmail.com>
Committed: Thu Oct 25 15:48:31 2018 -0400

----------------------------------------------------------------------
 demo-integration-tests/pom.xml                  |  7 +++
 .../integration/test/HeaderPhaseDemoIT.java     | 62 ++++++++++++++++++++
 2 files changed, 69 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/89672e7e/demo-integration-tests/pom.xml
----------------------------------------------------------------------
diff --git a/demo-integration-tests/pom.xml b/demo-integration-tests/pom.xml
index 49f942c..65ab75d 100644
--- a/demo-integration-tests/pom.xml
+++ b/demo-integration-tests/pom.xml
@@ -47,6 +47,8 @@
    <properties>
       <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
 
+      <test.portal.name>Pluto</test.portal.name>
+
       <!-- test.context.base context string used when addressing test pages. Used by module
stylesheet -->
       <test.context.base>pluto/portal/</test.context.base>
       <test.dependency.portlet.default.jquery.version>1.12.3</test.dependency.portlet.default.jquery.version>
@@ -241,6 +243,7 @@
       <profile>
          <id>liferay</id>
          <properties>
+            <test.portal.name>Liferay</test.portal.name>
             <test.server.login.url>http://${test.server.host}:${test.server.port}/group/pluto-demos</test.server.login.url>
          </properties>
       </profile>
@@ -264,6 +267,10 @@
                            <trimStackTrace>false</trimStackTrace>
                            <systemProperties>
                               <property>
+                                 <name>test.portal.name</name>
+                                 <value>${test.portal.name}</value>
+                              </property>
+                              <property>
                                  <name>test.server.login.url</name>
                                  <value>${test.server.login.url}</value>
                               </property>

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/89672e7e/demo-integration-tests/src/test/java/org/apache/portals/pluto/demo/integration/test/HeaderPhaseDemoIT.java
----------------------------------------------------------------------
diff --git a/demo-integration-tests/src/test/java/org/apache/portals/pluto/demo/integration/test/HeaderPhaseDemoIT.java
b/demo-integration-tests/src/test/java/org/apache/portals/pluto/demo/integration/test/HeaderPhaseDemoIT.java
new file mode 100644
index 0000000..7b56f83
--- /dev/null
+++ b/demo-integration-tests/src/test/java/org/apache/portals/pluto/demo/integration/test/HeaderPhaseDemoIT.java
@@ -0,0 +1,62 @@
+/*  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 java.nio.charset.StandardCharsets;
+import org.junit.Test;
+import org.openqa.selenium.By;
+
+import static org.apache.portals.pluto.demo.integration.test.Util.*;
+import static org.openqa.selenium.support.ui.ExpectedConditions.*;
+
+
+/**
+ *
+ * @author Kyle Stiemann
+ */
+public class HeaderPhaseDemoIT extends DemoTestDriver {
+
+   @Test
+   public void testHeaderPhaseDemo() {
+      navigateToPage("V2 and V3 Header Tests");
+      By characterEncodingByXpath = By.xpath("//p[contains(text(),'Character encoding:')]");
+      waitingAsserter.assertTrue(and(visibilityOfElementLocated(characterEncodingByXpath),
+            textToBePresentInElementLocated(characterEncodingByXpath, StandardCharsets.UTF_8.toString())));
+
+      By contentTypeByXpath = By.xpath("//p[contains(text(),'Content type:')]");
+      waitingAsserter.assertTrue(and(visibilityOfElementLocated(contentTypeByXpath),
+            textToBePresentInElementLocated(contentTypeByXpath, "text/html")));
+
+      By cookieDivByXpath = By.xpath(getXpath("div", "cookieDiv"));
+      waitingAsserter.assertTrue(and(visibilityOfElementLocated(cookieDivByXpath),
+            textToBePresentInElementLocated(cookieDivByXpath, "V3HeaderPortlet=something-special"),
+            textToBePresentInElementLocated(cookieDivByXpath, "Author=Scott")));
+
+      String propertyNameXpath = "//li[contains(text(),'Property')][contains(text(),'name:')]";
+      By portletPropertyByXpath = By.xpath(propertyNameXpath + "[contains(text(),'Portlet')]");
+      waitingAsserter.assertTrue(and(visibilityOfElementLocated(portletPropertyByXpath),
+            textToBePresentInElementLocated(portletPropertyByXpath, "V3HeaderPortlet"),
+            textToBePresentInElementLocated(portletPropertyByXpath, "[V3HeaderPortlet]")));
+
+      By portalPropertyByXpath = By.xpath(propertyNameXpath + "[contains(text(),'Portal')]");
+      String portalName = System.getProperty("test.portal.name");
+      waitingAsserter.assertTrue(and(visibilityOfElementLocated(portalPropertyByXpath),
+            textToBePresentInElementLocated(portalPropertyByXpath, portalName),
+            textToBePresentInElementLocated(portalPropertyByXpath, "[" + portalName)));
+   }
+}


Mime
View raw message