portals-pluto-scm mailing list archives

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

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

----------------------------------------------------------------------
 .../integration/test/PortletConfigDemoIT.java   | 109 +++++++++++++++++++
 1 file changed, 109 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/1df44597/demo-integration-tests/src/test/java/org/apache/portals/pluto/demo/integration/test/PortletConfigDemoIT.java
----------------------------------------------------------------------
diff --git a/demo-integration-tests/src/test/java/org/apache/portals/pluto/demo/integration/test/PortletConfigDemoIT.java
b/demo-integration-tests/src/test/java/org/apache/portals/pluto/demo/integration/test/PortletConfigDemoIT.java
new file mode 100644
index 0000000..fdc0950
--- /dev/null
+++ b/demo-integration-tests/src/test/java/org/apache/portals/pluto/demo/integration/test/PortletConfigDemoIT.java
@@ -0,0 +1,109 @@
+/*  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 static org.openqa.selenium.support.ui.ExpectedConditions.*;
+
+
+/**
+ *
+ * @author Kyle Stiemann
+ */
+public class PortletConfigDemoIT extends DemoTestDriver {
+
+   @Test
+   public void testPortletConfigDemo() {
+      navigateToPage("V3.0 PM and WS");
+
+      // Portlet Modes for Portlet 1:
+      assertTextVisible("Portlet Modes:", "MIME type: text/html, PortletMode: help, Allowed:
true", 1);
+      assertTextVisible("Portlet Modes:", "MIME type: text/html, PortletMode: view, Allowed:
true", 1);
+      assertTextVisible("Portlet Modes:", "MIME type: text/html, PortletMode: edit, Allowed:
true", 1);
+      assertTextVisible("Portlet Modes:", "MIME type: text/html, PortletMode: mymode_portalmanaged_3,
Allowed: false",
+            1);
+      assertTextVisible("Portlet Modes:",
+            "MIME type: text/html, PortletMode: mymode_nonportalmanaged_1, Allowed: false",
1);
+      assertTextVisible("Portlet Modes:",
+            "MIME type: text/html, PortletMode: mymode_nonportalmanaged_2, Allowed: false",
1);
+      assertTextVisible("Portlet Modes:", "MIME type: text/vnd.wap.wml, PortletMode: view",
1);
+      assertTextVisible("Portlet Modes:", "MIME type: text/vnd.wap.wml, PortletMode: mymode_nonportalmanaged_1",
1);
+
+      // Window States for Portlet 1:
+      assertTextVisible("Window States:", "MIME type: text/html, WindowState: testwindowstate_2,
Allowed: false", 1);
+      assertTextVisible("Window States:", "MIME type: text/html, WindowState: normal, Allowed:
true", 1);
+      assertTextVisible("Window States:", "MIME type: text/html, WindowState: testwindowstate_1,
Allowed: false", 1);
+      assertTextVisible("Window States:", "MIME type: text/html, WindowState: maximized,
Allowed: true", 1);
+      assertTextVisible("Window States:", "MIME type: text/html, WindowState: minimized,
Allowed: true", 1);
+      assertTextVisible("Window States:", "MIME type: text/vnd.wap.wml, WindowState: testwindowstate_2",
1);
+      assertTextVisible("Window States:", "MIME type: text/vnd.wap.wml, WindowState: normal",
1);
+      assertTextVisible("Window States:", "MIME type: text/vnd.wap.wml, WindowState: testwindowstate_1",
1);
+      assertTextVisible("Window States:", "MIME type: text/vnd.wap.wml, WindowState: maximized",
1);
+      assertTextVisible("Window States:", "MIME type: text/vnd.wap.wml, WindowState: minimized",
1);
+
+      // Public Render Parameters for Portlet 1:
+      assertTextVisible("Public Render Parameters:",
+            "Name: color, QName: {http://www.apache.org/portals/pluto/pub-render-params/ResourcePortlet}alt-color",
+            1);
+      assertTextVisible("Public Render Parameters:",
+            "Name: photo, QName: {http://www.apache.org/portals/pluto/pub-render-params/ResourcePortlet}ph-imgName",
+            1);
+
+      // Portlet Context Info for Portlet 1:
+      assertTextVisible("Portlet Context Info:", "Portlet application version: 3.0", 1);
+      assertTextVisible("Portlet Context Info:", "ClassLoader:", 1);
+      assertTextVisible("Portlet Context Info:", "Portlet context path: /PortletV3Demo",
1);
+
+      // Portlet Modes for Portlet 2:
+      assertTextVisible("Portlet Modes:", "MIME type: text/html, PortletMode: help, Allowed:
true", 2);
+      assertTextVisible("Portlet Modes:", "MIME type: text/html, PortletMode: view, Allowed:
true", 2);
+      assertTextVisible("Portlet Modes:",
+            "MIME type: text/html, PortletMode: mymode_nonportalmanaged_1, Allowed: false",
+            2);
+      assertTextVisible("Portlet Modes:",
+            "MIME type: text/vnd.wap.wml, PortletMode: view", 2);
+
+      // Window States for Portlet 2:
+      assertTextVisible("Window States:", "MIME type: text/html, WindowState: normal, Allowed:
true", 2);
+      assertTextVisible("Window States:", "MIME type: text/html, WindowState: testwindowstate_1,
Allowed: false", 2);
+      assertTextVisible("Window States:", "MIME type: text/html, WindowState: maximized,
Allowed: true", 2);
+      assertTextVisible("Window States:", "MIME type: text/html, WindowState: minimized,
Allowed: true", 2);
+      assertTextVisible("Window States:", "MIME type: text/vnd.wap.wml, WindowState: normal",
2);
+      assertTextVisible("Window States:", "MIME type: text/vnd.wap.wml, WindowState: testwindowstate_1",
2);
+      assertTextVisible("Window States:", "MIME type: text/vnd.wap.wml, WindowState: maximized",
2);
+      assertTextVisible("Window States:", "MIME type: text/vnd.wap.wml, WindowState: minimized",
2);
+
+      // Public Render Parameters for Portlet 2:
+      assertTextVisible("Public Render Parameters:",
+            "Name: color, QName: {http://www.apache.org/portals/pluto/pub-render-params/ResourcePortlet}alt-color",
+            2);
+
+      // Portlet Context Info for Portlet 2:
+      assertTextVisible("Portlet Context Info:", "Portlet application version: 3.0", 2);
+      assertTextVisible("Portlet Context Info:", "ClassLoader:", 2);
+      assertTextVisible("Portlet Context Info:", "Portlet context path: /PortletV3Demo",
2);
+   }
+
+   private void assertTextVisible(String title, String text, int portlet) {
+      waitingAsserter.assertTrue(visibilityOfAllElementsLocatedBy(By.xpath(
+            "(//h5[text()='" + title + "'])[" + portlet + "]/following-sibling::ul/" +
+                  "li[contains(text(),'" + text + "')]")));
+   }
+}


Mime
View raw message