Author: lfryc(a)redhat.com
Date: 2009-12-14 10:17:14 -0500 (Mon, 14 Dec 2009)
New Revision: 16123
Modified:
branches/sandbox/rf-demo-ftest-iexplore/src/test/java/org/jboss/richfaces/integrationTest/extendedDataTable/AbstractExtendedDataTableTestCase.java
branches/sandbox/rf-demo-ftest-iexplore/src/test/java/org/jboss/richfaces/integrationTest/extendedDataTable/FilteringTestCase.java
branches/sandbox/rf-demo-ftest-iexplore/src/test/java/org/jboss/richfaces/integrationTest/extendedDataTable/GroupingTestCase.java
Log:
* EDT - Filtering, Grouping
- added method recognizing type of browser: boolean browserIsInternetExplorer()
- when counting number of rows in EDT, the result is by 1 greater than in actual row count
- actually the first row is empty, so added platform dependent skip of first row
Modified:
branches/sandbox/rf-demo-ftest-iexplore/src/test/java/org/jboss/richfaces/integrationTest/extendedDataTable/AbstractExtendedDataTableTestCase.java
===================================================================
---
branches/sandbox/rf-demo-ftest-iexplore/src/test/java/org/jboss/richfaces/integrationTest/extendedDataTable/AbstractExtendedDataTableTestCase.java 2009-12-14
15:12:25 UTC (rev 16122)
+++
branches/sandbox/rf-demo-ftest-iexplore/src/test/java/org/jboss/richfaces/integrationTest/extendedDataTable/AbstractExtendedDataTableTestCase.java 2009-12-14
15:17:14 UTC (rev 16123)
@@ -21,9 +21,12 @@
*******************************************************************************/
package org.jboss.richfaces.integrationTest.extendedDataTable;
+import org.apache.commons.lang.StringUtils;
import org.jboss.richfaces.integrationTest.AbstractDataIterationTestCase;
import org.jboss.test.selenium.waiting.Condition;
+import org.testng.annotations.BeforeClass;
import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Parameters;
/**
* @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
@@ -47,6 +50,8 @@
private final String MSG_OPTION_SELECTION_MODE_PREFORMATTED =
getMsg("OPTION_SELECTION_MODE_PREFORMATTED");
+ private String browser;
+
@BeforeMethod
protected void loadPage() {
openComponent("Extended Data Table");
@@ -55,6 +60,22 @@
selenium.allowNativeXpath("true");
}
+ @BeforeClass
+ @Parameters( { "browser" })
+ public void detectBrowser(String browser) {
+ this.browser = browser;
+ }
+
+ protected boolean browserIsInternetExplorer() {
+ String[] ies = new String[] { "*iexplore", "*piiexplore",
"*iehta" };
+ for (String ie : ies) {
+ if (StringUtils.defaultString(browser).startsWith(ie)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
/**
* Wait for splash screen indicating request of table rerendering disappears
*/
Modified:
branches/sandbox/rf-demo-ftest-iexplore/src/test/java/org/jboss/richfaces/integrationTest/extendedDataTable/FilteringTestCase.java
===================================================================
---
branches/sandbox/rf-demo-ftest-iexplore/src/test/java/org/jboss/richfaces/integrationTest/extendedDataTable/FilteringTestCase.java 2009-12-14
15:12:25 UTC (rev 16122)
+++
branches/sandbox/rf-demo-ftest-iexplore/src/test/java/org/jboss/richfaces/integrationTest/extendedDataTable/FilteringTestCase.java 2009-12-14
15:17:14 UTC (rev 16123)
@@ -21,7 +21,7 @@
*******************************************************************************/
package org.jboss.richfaces.integrationTest.extendedDataTable;
-import static org.testng.Assert.*;
+import static org.testng.Assert.assertTrue;
import org.apache.commons.lang.StringUtils;
import org.jboss.test.selenium.dom.Event;
@@ -79,6 +79,10 @@
int rows = getJQueryCount(format(cellsState, 0));
for (int row = 1; row <= rows; row++) {
+ if (row == 1 && browserIsInternetExplorer()) {
+ continue;
+ }
+
if (statePrefix.length() > 0) {
String state = selenium.getText(format(cellsState, row));
assertTrue(state.startsWith(statePrefix), format("'{0}' doesn't
start with prefix '{1}'", state,
Modified:
branches/sandbox/rf-demo-ftest-iexplore/src/test/java/org/jboss/richfaces/integrationTest/extendedDataTable/GroupingTestCase.java
===================================================================
---
branches/sandbox/rf-demo-ftest-iexplore/src/test/java/org/jboss/richfaces/integrationTest/extendedDataTable/GroupingTestCase.java 2009-12-14
15:12:25 UTC (rev 16122)
+++
branches/sandbox/rf-demo-ftest-iexplore/src/test/java/org/jboss/richfaces/integrationTest/extendedDataTable/GroupingTestCase.java 2009-12-14
15:17:14 UTC (rev 16123)
@@ -58,6 +58,10 @@
String expectedGroup = null;
for (int row = 1; row <= rows; row++) {
+ if (row == 1 && browserIsInternetExplorer()) {
+ continue;
+ }
+
if (belongsClass(MSG_TR_CLASS, format(LOC_TR_PREFORMATTED, row))) {
// table row is type group
expectedGroup = selenium.getText(format(LOC_TD_GROUP_PREFORMATTED,
row)).replace("State Name: ", "").replace("(1)",
"");
Show replies by date