Author: dsvyatobatsko
Date: 2008-04-28 05:10:03 -0400 (Mon, 28 Apr 2008)
New Revision: 8220
Added:
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/A4JStatusTestBean.java
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/JSFunctionBean.java
trunk/test-applications/seleniumTest/src/main/resources/org/
trunk/test-applications/seleniumTest/src/main/resources/org/ajax4jsf/
trunk/test-applications/seleniumTest/src/main/resources/org/ajax4jsf/css/
trunk/test-applications/seleniumTest/src/main/resources/org/ajax4jsf/css/loadStyleTest.css
trunk/test-applications/seleniumTest/src/main/resources/org/ajax4jsf/js/
trunk/test-applications/seleniumTest/src/main/resources/org/ajax4jsf/js/loadScriptTest.js
trunk/test-applications/seleniumTest/src/main/webapp/layout/template.xhtml
trunk/test-applications/seleniumTest/src/main/webapp/pages/ajaxStatus/
trunk/test-applications/seleniumTest/src/main/webapp/pages/ajaxStatus/ajaxStatusDescription.xhtml
trunk/test-applications/seleniumTest/src/main/webapp/pages/ajaxStatus/ajaxStatusTest.xhtml
trunk/test-applications/seleniumTest/src/main/webapp/pages/jsFunction/
trunk/test-applications/seleniumTest/src/main/webapp/pages/jsFunction/jsFunctionDescription.xhtml
trunk/test-applications/seleniumTest/src/main/webapp/pages/jsFunction/jsFunctionTest.xhtml
trunk/test-applications/seleniumTest/src/main/webapp/pages/loadScript/
trunk/test-applications/seleniumTest/src/main/webapp/pages/loadScript/loadScriptDescription.xhtml
trunk/test-applications/seleniumTest/src/main/webapp/pages/loadScript/loadScriptTest.xhtml
trunk/test-applications/seleniumTest/src/main/webapp/pages/loadStyle/
trunk/test-applications/seleniumTest/src/main/webapp/pages/loadStyle/loadStyleDescription.xhtml
trunk/test-applications/seleniumTest/src/main/webapp/pages/loadStyle/loadStyleTest.xhtml
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/AjaxStatusTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/JSFunctionTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/LoadScriptTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/LoadStyleTest.java
Removed:
trunk/test-applications/seleniumTest/src/main/webapp/template/
Modified:
trunk/test-applications/seleniumTest/src/main/webapp/WEB-INF/faces-config.xml
trunk/test-applications/seleniumTest/src/main/webapp/pages/progressBar/progressBarTest.xhtml
trunk/test-applications/seleniumTest/src/test/java/org/ajax4jsf/test/base/SeleniumTestBase.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/AjaxCommandLinkTest.java
Log:
JSFunction/loadScript/loadStyle/ajaxStatus selenium tests
Added:
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/A4JStatusTestBean.java
===================================================================
---
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/A4JStatusTestBean.java
(rev 0)
+++
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/A4JStatusTestBean.java 2008-04-28
09:10:03 UTC (rev 8220)
@@ -0,0 +1,16 @@
+package org.ajax4jsf;
+
+import javax.faces.event.ActionEvent;
+
+public class A4JStatusTestBean {
+
+ public void actionListener(ActionEvent event) {
+ //mega time-consuming operation - sleeping
+ try {
+ Thread.sleep(2000);
+ } catch (InterruptedException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+}
Property changes on:
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/A4JStatusTestBean.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Added:
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/JSFunctionBean.java
===================================================================
--- trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/JSFunctionBean.java
(rev 0)
+++
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/JSFunctionBean.java 2008-04-28
09:10:03 UTC (rev 8220)
@@ -0,0 +1,23 @@
+package org.ajax4jsf;
+
+public class JSFunctionBean {
+
+ private String name = "";
+
+ /**
+ * Gets value of name field.
+ * @return value of name field
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * Set a new value for name field.
+ * @param name a new value for name field
+ */
+ public void setName(String name) {
+ this.name = name;
+ }
+
+}
Property changes on:
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/JSFunctionBean.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Added:
trunk/test-applications/seleniumTest/src/main/resources/org/ajax4jsf/css/loadStyleTest.css
===================================================================
---
trunk/test-applications/seleniumTest/src/main/resources/org/ajax4jsf/css/loadStyleTest.css
(rev 0)
+++
trunk/test-applications/seleniumTest/src/main/resources/org/ajax4jsf/css/loadStyleTest.css 2008-04-28
09:10:03 UTC (rev 8220)
@@ -0,0 +1,5 @@
+.rectangle {
+ background-color: blue;
+ width: 50px;
+ height: 100px;
+}
\ No newline at end of file
Property changes on:
trunk/test-applications/seleniumTest/src/main/resources/org/ajax4jsf/css/loadStyleTest.css
___________________________________________________________________
Name: svn:mime-type
+ text/css
Name: svn:eol-style
+ native
Added:
trunk/test-applications/seleniumTest/src/main/resources/org/ajax4jsf/js/loadScriptTest.js
===================================================================
---
trunk/test-applications/seleniumTest/src/main/resources/org/ajax4jsf/js/loadScriptTest.js
(rev 0)
+++
trunk/test-applications/seleniumTest/src/main/resources/org/ajax4jsf/js/loadScriptTest.js 2008-04-28
09:10:03 UTC (rev 8220)
@@ -0,0 +1,3 @@
+function summarize (operand1, operand2) {
+ return operand1 + operand2;
+}
\ No newline at end of file
Property changes on:
trunk/test-applications/seleniumTest/src/main/resources/org/ajax4jsf/js/loadScriptTest.js
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Modified: trunk/test-applications/seleniumTest/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
---
trunk/test-applications/seleniumTest/src/main/webapp/WEB-INF/faces-config.xml 2008-04-28
08:11:32 UTC (rev 8219)
+++
trunk/test-applications/seleniumTest/src/main/webapp/WEB-INF/faces-config.xml 2008-04-28
09:10:03 UTC (rev 8220)
@@ -40,6 +40,15 @@
<managed-bean-name>panelBean</managed-bean-name>
<managed-bean-class>org.ajax4jsf.RichPanelTestBean</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
+ </managed-bean>
+ <managed-bean>
+ <managed-bean-name>jsFunctionBean</managed-bean-name>
+ <managed-bean-class>org.ajax4jsf.JSFunctionBean</managed-bean-class>
+ <managed-bean-scope>request</managed-bean-scope>
+ </managed-bean>
+ <managed-bean>
+ <managed-bean-name>statusBean</managed-bean-name>
+ <managed-bean-class>org.ajax4jsf.A4JStatusTestBean</managed-bean-class>
+ <managed-bean-scope>request</managed-bean-scope>
</managed-bean>
-
</faces-config>
\ No newline at end of file
Copied: trunk/test-applications/seleniumTest/src/main/webapp/layout/template.xhtml (from
rev 8108, trunk/test-applications/seleniumTest/src/main/webapp/layout/template.xhtml)
===================================================================
--- trunk/test-applications/seleniumTest/src/main/webapp/layout/template.xhtml
(rev 0)
+++ trunk/test-applications/seleniumTest/src/main/webapp/layout/template.xhtml 2008-04-28
09:10:03 UTC (rev 8220)
@@ -0,0 +1,112 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:a4j="http://richfaces.org/a4j"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:rich="http://richfaces.org/rich"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:ui="http://java.sun.com/jsf/facelets">
+<head>
+ <script>
+ var errorMessage = null;
+ var pauseHolder = {};
+ window.onerror = function (message, url, code) {
+ errorMessage = message;
+ };
+ function checkError () {
+ return errorMessage;
+ }
+
+ function pause (miliseconds, id) {
+ pauseHolder[id] = false;
+ window.setTimeout(function () { pauseHolder[id] = true; }, miliseconds);
+ }
+
+ function submitForm () {
+ document.getElementById('_form').submit();
+ }
+
+ function reRenderAll () {
+ document.getElementById('_Selenium_Test_ReRender_Form:_reRender').onclick();
+ return;
+ }
+ </script>
+ <style type="text/css">
+ <ui:insert name="style"/>
+ </style>
+</head>
+<f:view>
+<body>
+<div style="padding: 10px; font-size: 24px;">Rich faces component testing
by Selenium</div><br/>
+<h:form id="_Selenium_Test_ReRender_Form">
+ <table border="0" cellpadding="5" cellspacing="0">
+ <tr>
+ <td colspan="2">
+ <a4j:commandLink reRender="_Selenium_Test_Form1, _Selenium_Test_Form2"
style="text-decoration: underline; color: blue" value="ReRenderAll"
id="_reRender"/>
+ </td>
+ </tr>
+ <!-- tr>
+ <td>
+ <b>Ajax Status:</b>
+ </td>
+ <td>
+ <a4j:status startText="Ajax in progress...">
+ <f:facet name="stop">
+ <h:outputText value="Completed" style="color:
green"></h:outputText>
+ </f:facet>
+ <f:facet name="start">
+ <h:outputText value="In progress..." style="color:
red"></h:outputText>
+ </f:facet>
+ </a4j:status>
+ </td>
+ </tr-->
+ </table>
+</h:form>
+<br/>
+<div id="_Selenium_Test_ControlPoint1" style="display:
none;">Control1</div>
+ <br/>
+<table border="0" cellpadding="0"
cellspacing="10"><tr><td style="vertical-align: top">
+ <rich:dataTable value="1" id="_Selenium_Test_Description">
+ <h:column>
+ <f:facet name="header">
+ <h:outputText value="Description area"></h:outputText>
+ </f:facet>
+ <ui:insert name="description"></ui:insert>
+ </h:column>
+ </rich:dataTable>
+</td></tr></table>
+
+ <br/><br/>
+<table border="0" cellpadding="0"
cellspacing="10"><tr><td style="vertical-align: top">
+<h:form id="_Selenium_Test_Form1">
+ <rich:dataTable value="1" id="_Selenium_Test_DataTable"
style="width: auto">
+ <h:column>
+ <f:facet name="header">
+ <h:outputText value="Testing area inside Data
Table"></h:outputText>
+ </f:facet>
+ <ui:insert name="component" />
+ </h:column>
+ </rich:dataTable>
+</h:form>
+</td>
+<td style="width: 20px">
+</td>
+<td style="vertical-align: top">
+<h:form id="_Selenium_Test_Form2">
+ <rich:panel id="_Selenium_Test_Panel">
+ <f:facet name="header">
+ <h:outputText value="Testing area inside Panel"></h:outputText>
+ </f:facet>
+ <ui:insert name="component" />
+ </rich:panel>
+</h:form>
+</td></tr></table>
+
+
+<script type="text/javascript">
+ window.done=false;A4J.AJAX.AddListener(new
A4J.AJAX.Listener(function(){window.done=true}));
+</script>
+
+<div id="_Selenium_Test_ControlPoint2" style="display:
none;">Control2</div>
+</body>
+</f:view>
+</html>
\ No newline at end of file
Added:
trunk/test-applications/seleniumTest/src/main/webapp/pages/ajaxStatus/ajaxStatusDescription.xhtml
===================================================================
(Binary files differ)
Property changes on:
trunk/test-applications/seleniumTest/src/main/webapp/pages/ajaxStatus/ajaxStatusDescription.xhtml
___________________________________________________________________
Name: svn:mime-type
+ application/xhtml+xml
Added:
trunk/test-applications/seleniumTest/src/main/webapp/pages/ajaxStatus/ajaxStatusTest.xhtml
===================================================================
(Binary files differ)
Property changes on:
trunk/test-applications/seleniumTest/src/main/webapp/pages/ajaxStatus/ajaxStatusTest.xhtml
___________________________________________________________________
Name: svn:mime-type
+ application/xhtml+xml
Added:
trunk/test-applications/seleniumTest/src/main/webapp/pages/jsFunction/jsFunctionDescription.xhtml
===================================================================
(Binary files differ)
Property changes on:
trunk/test-applications/seleniumTest/src/main/webapp/pages/jsFunction/jsFunctionDescription.xhtml
___________________________________________________________________
Name: svn:mime-type
+ application/xhtml+xml
Added:
trunk/test-applications/seleniumTest/src/main/webapp/pages/jsFunction/jsFunctionTest.xhtml
===================================================================
(Binary files differ)
Property changes on:
trunk/test-applications/seleniumTest/src/main/webapp/pages/jsFunction/jsFunctionTest.xhtml
___________________________________________________________________
Name: svn:mime-type
+ application/xhtml+xml
Added:
trunk/test-applications/seleniumTest/src/main/webapp/pages/loadScript/loadScriptDescription.xhtml
===================================================================
(Binary files differ)
Property changes on:
trunk/test-applications/seleniumTest/src/main/webapp/pages/loadScript/loadScriptDescription.xhtml
___________________________________________________________________
Name: svn:mime-type
+ application/xhtml+xml
Added:
trunk/test-applications/seleniumTest/src/main/webapp/pages/loadScript/loadScriptTest.xhtml
===================================================================
(Binary files differ)
Property changes on:
trunk/test-applications/seleniumTest/src/main/webapp/pages/loadScript/loadScriptTest.xhtml
___________________________________________________________________
Name: svn:mime-type
+ application/xhtml+xml
Added:
trunk/test-applications/seleniumTest/src/main/webapp/pages/loadStyle/loadStyleDescription.xhtml
===================================================================
(Binary files differ)
Property changes on:
trunk/test-applications/seleniumTest/src/main/webapp/pages/loadStyle/loadStyleDescription.xhtml
___________________________________________________________________
Name: svn:mime-type
+ application/xhtml+xml
Added:
trunk/test-applications/seleniumTest/src/main/webapp/pages/loadStyle/loadStyleTest.xhtml
===================================================================
(Binary files differ)
Property changes on:
trunk/test-applications/seleniumTest/src/main/webapp/pages/loadStyle/loadStyleTest.xhtml
___________________________________________________________________
Name: svn:mime-type
+ application/xhtml+xml
Modified:
trunk/test-applications/seleniumTest/src/main/webapp/pages/progressBar/progressBarTest.xhtml
===================================================================
---
trunk/test-applications/seleniumTest/src/main/webapp/pages/progressBar/progressBarTest.xhtml 2008-04-28
08:11:32 UTC (rev 8219)
+++
trunk/test-applications/seleniumTest/src/main/webapp/pages/progressBar/progressBarTest.xhtml 2008-04-28
09:10:03 UTC (rev 8220)
@@ -14,7 +14,7 @@
<h:outputText value="Process not started"></h:outputText>
</f:facet>
<f:facet name="complete">
- <h:outputText value="Process not started"></h:outputText>
+ <h:outputText value="Process completed"></h:outputText>
</f:facet>
<h:outputText value="{value}%"></h:outputText>
</rich:progressBar><br/>
@@ -24,7 +24,7 @@
<h:outputText value="Process not started"></h:outputText>
</f:facet>
<f:facet name="complete">
- <h:outputText value="Process not started"></h:outputText>
+ <h:outputText value="Process completed"></h:outputText>
</f:facet>
<h:outputText value="{value}%"></h:outputText>
</rich:progressBar> <br/>
Modified:
trunk/test-applications/seleniumTest/src/test/java/org/ajax4jsf/test/base/SeleniumTestBase.java
===================================================================
---
trunk/test-applications/seleniumTest/src/test/java/org/ajax4jsf/test/base/SeleniumTestBase.java 2008-04-28
08:11:32 UTC (rev 8219)
+++
trunk/test-applications/seleniumTest/src/test/java/org/ajax4jsf/test/base/SeleniumTestBase.java 2008-04-28
09:10:03 UTC (rev 8220)
@@ -331,8 +331,7 @@
public String getValueById(String id) {
return selenium.getValue("id=" + id);
}
-
-
+
/**
* Returns element's width
* @param id - DOM element id
@@ -343,6 +342,15 @@
}
/**
+ * Returns element's height
+ * @param id - DOM element id
+ * @return
+ */
+ public Number getHeightById(String id) {
+ return selenium.getElementHeight("id=" + id);
+ }
+
+ /**
* Clicks on element
*
* @param id -
Modified:
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/AjaxCommandLinkTest.java
===================================================================
---
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/AjaxCommandLinkTest.java 2008-04-28
08:11:32 UTC (rev 8219)
+++
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/AjaxCommandLinkTest.java 2008-04-28
09:10:03 UTC (rev 8220)
@@ -90,7 +90,7 @@
}
public String getTestUrl() {
- return null;
- }
+ return "/faces/pages/ajaxCommandLink/ajaxLinkTest.xhtml";
+ }
}
Added:
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/AjaxStatusTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/AjaxStatusTest.java
(rev 0)
+++
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/AjaxStatusTest.java 2008-04-28
09:10:03 UTC (rev 8220)
@@ -0,0 +1,41 @@
+package org.richfaces;
+
+import org.ajax4jsf.test.base.SeleniumTestBase;
+import org.ajax4jsf.test.base.Templates;
+import org.testng.annotations.AfterTest;
+import org.testng.annotations.BeforeTest;
+import org.testng.annotations.Parameters;
+import org.testng.annotations.Test;
+
+public class AjaxStatusTest extends SeleniumTestBase {
+
+ public AjaxStatusTest() {
+ super("http", "localhost", "8080");
+ }
+
+ /**
+ * This method are invoking before selenium tests started
+ */
+ @BeforeTest
+ @Parameters( { "browser" })
+ public void startSelenium(String browser) {
+ super.startSelenium(browser);
+ }
+
+ /**
+ * This method are invoking after selenium tests completed
+ */
+ @AfterTest
+ public void stopSelenium() {
+ super.stopSelenium();
+ }
+
+ @Test
+ public void testAjaxStatusComponent() throws Exception {
+ _testAjaxStatusComponent(Templates.DATATABLE);
+ }
+
+ private void _testAjaxStatusComponent(Templates template) {
+ renderPage("/faces/pages/ajaxStatus/ajaxStatusTest.xhtml", template);
+ }
+}
Property changes on:
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/AjaxStatusTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Added:
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/JSFunctionTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/JSFunctionTest.java
(rev 0)
+++
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/JSFunctionTest.java 2008-04-28
09:10:03 UTC (rev 8220)
@@ -0,0 +1,56 @@
+package org.richfaces;
+
+import static org.testng.Assert.assertEquals;
+import org.ajax4jsf.test.base.SeleniumTestBase;
+import org.ajax4jsf.test.base.Templates;
+
+import org.testng.annotations.AfterTest;
+import org.testng.annotations.BeforeTest;
+import org.testng.annotations.Parameters;
+import org.testng.annotations.Test;
+
+public class JSFunctionTest extends SeleniumTestBase {
+
+ public JSFunctionTest() {
+ super("http", "localhost", "8080");
+ }
+
+ /**
+ * This method are invoking before selenium tests started
+ */
+ @BeforeTest
+ @Parameters( { "browser" })
+ public void startSelenium(String browser) {
+ super.startSelenium(browser);
+ }
+
+ /**
+ * This method are invoking after selenium tests completed
+ */
+ @AfterTest
+ public void stopSelenium() {
+ super.stopSelenium();
+ }
+
+ @Test
+ public void testJSFunctionComponent() throws Exception {
+ _testJSFunctionComponent(Templates.DATATABLE);
+ }
+
+ private void _testJSFunctionComponent(Templates template) {
+ renderPage("/faces/pages/jsFunction/jsFunctionTest.xhtml", template);
+
+ selenium.mouseOver("alex");
+ waitForAjaxCompletion();
+ assertEquals(getTextById("alex"), "Alex");
+
+ selenium.mouseOver("jonh");
+ waitForAjaxCompletion();
+ assertEquals(getTextById("jonh"), "Jonh");
+
+ selenium.mouseOver("roger");
+ waitForAjaxCompletion();
+ assertEquals(getTextById("roger"), "Roger");
+ }
+
+}
Property changes on:
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/JSFunctionTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Added:
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/LoadScriptTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/LoadScriptTest.java
(rev 0)
+++
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/LoadScriptTest.java 2008-04-28
09:10:03 UTC (rev 8220)
@@ -0,0 +1,48 @@
+package org.richfaces;
+
+import static org.testng.Assert.assertEquals;
+
+import org.ajax4jsf.test.base.SeleniumTestBase;
+import org.ajax4jsf.test.base.Templates;
+import org.testng.annotations.AfterTest;
+import org.testng.annotations.BeforeTest;
+import org.testng.annotations.Parameters;
+import org.testng.annotations.Test;
+
+public class LoadScriptTest extends SeleniumTestBase {
+
+ public LoadScriptTest() {
+ super("http", "localhost", "8080");
+ }
+
+ /**
+ * This method are invoking before selenium tests started
+ */
+ @BeforeTest
+ @Parameters( { "browser" })
+ public void startSelenium(String browser) {
+ super.startSelenium(browser);
+ }
+
+ /**
+ * This method are invoking after selenium tests completed
+ */
+ @AfterTest
+ public void stopSelenium() {
+ super.stopSelenium();
+ }
+
+ @Test
+ public void testLoadScriptComponent() throws Exception {
+ _testLoadScriptComponent(Templates.DATATABLE);
+ }
+
+ private void _testLoadScriptComponent(Templates template) {
+ renderPage("/faces/pages/loadScript/loadScriptTest.xhtml", template);
+ String jsCall = "summarize(%1$s, %2$s);";
+ int opr1 = 1;
+ int opr2 = 2;
+ String result = runScript(String.format(jsCall, opr1, opr2));
+ assertEquals(Integer.parseInt(result), opr1 + opr2);
+ }
+}
Property changes on:
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/LoadScriptTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Added:
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/LoadStyleTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/LoadStyleTest.java
(rev 0)
+++
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/LoadStyleTest.java 2008-04-28
09:10:03 UTC (rev 8220)
@@ -0,0 +1,46 @@
+package org.richfaces;
+
+import org.ajax4jsf.test.base.SeleniumTestBase;
+import org.ajax4jsf.test.base.Templates;
+
+import static org.testng.Assert.assertEquals;
+import org.testng.annotations.AfterTest;
+import org.testng.annotations.BeforeTest;
+import org.testng.annotations.Parameters;
+import org.testng.annotations.Test;
+
+public class LoadStyleTest extends SeleniumTestBase {
+
+ public LoadStyleTest() {
+ super("http", "localhost", "8080");
+ }
+
+ /**
+ * This method are invoking before selenium tests started
+ */
+ @BeforeTest
+ @Parameters( { "browser" })
+ public void startSelenium(String browser) {
+ super.startSelenium(browser);
+ }
+
+ /**
+ * This method are invoking after selenium tests completed
+ */
+ @AfterTest
+ public void stopSelenium() {
+ super.stopSelenium();
+ }
+
+ @Test
+ public void testLoadStyleComponent() throws Exception {
+ _testLoadStyleComponent(Templates.DATATABLE);
+ }
+
+ private void _testLoadStyleComponent(Templates template) {
+ renderPage("/faces/pages/loadStyle/loadStyleTest.xhtml", template);
+ String divId = getParentId() + "rectangle";
+ assertEquals(50, getWidthById(divId));
+ assertEquals(100, getHeightById(divId));
+ }
+}
Property changes on:
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/LoadStyleTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native