From richfaces-svn-commits at lists.jboss.org Mon Dec 14 10:17:14 2009 Content-Type: multipart/mixed; boundary="===============5072174739624460802==" MIME-Version: 1.0 From: richfaces-svn-commits at lists.jboss.org To: richfaces-svn-commits at lists.jboss.org Subject: [richfaces-svn-commits] JBoss Rich Faces SVN: r16123 - branches/sandbox/rf-demo-ftest-iexplore/src/test/java/org/jboss/richfaces/integrationTest/extendedDataTable. Date: Mon, 14 Dec 2009 10:17:14 -0500 Message-ID: <200912141517.nBEFHElg006338@svn01.web.mwc.hst.phx2.redhat.com> --===============5072174739624460802== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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/richface= s/integrationTest/extendedDataTable/AbstractExtendedDataTableTestCase.java branches/sandbox/rf-demo-ftest-iexplore/src/test/java/org/jboss/richface= s/integrationTest/extendedDataTable/FilteringTestCase.java branches/sandbox/rf-demo-ftest-iexplore/src/test/java/org/jboss/richface= s/integrationTest/extendedDataTable/GroupingTestCase.java Log: * EDT - Filtering, Grouping - added method recognizing type of browser: boolean browserIsInternetExplor= er() - when counting number of rows in EDT, the result is by 1 greater than in a= ctual row count - actually the first row is empty, so added platform depend= ent skip of first row Modified: branches/sandbox/rf-demo-ftest-iexplore/src/test/java/org/jboss/r= ichfaces/integrationTest/extendedDataTable/AbstractExtendedDataTableTestCas= e.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/sandbox/rf-demo-ftest-iexplore/src/test/java/org/jboss/richfac= es/integrationTest/extendedDataTable/AbstractExtendedDataTableTestCase.java= 2009-12-14 15:12:25 UTC (rev 16122) +++ branches/sandbox/rf-demo-ftest-iexplore/src/test/java/org/jboss/richfac= es/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 Lukas Fryc @@ -47,6 +50,8 @@ = private final String MSG_OPTION_SELECTION_MODE_PREFORMATTED =3D getMsg("O= PTION_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 =3D browser; + } + + protected boolean browserIsInternetExplorer() { + String[] ies =3D 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 disappe= ars */ Modified: branches/sandbox/rf-demo-ftest-iexplore/src/test/java/org/jboss/r= ichfaces/integrationTest/extendedDataTable/FilteringTestCase.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/sandbox/rf-demo-ftest-iexplore/src/test/java/org/jboss/richfac= es/integrationTest/extendedDataTable/FilteringTestCase.java 2009-12-14 15:1= 2:25 UTC (rev 16122) +++ branches/sandbox/rf-demo-ftest-iexplore/src/test/java/org/jboss/richfac= es/integrationTest/extendedDataTable/FilteringTestCase.java 2009-12-14 15:1= 7: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 =3D getJQueryCount(format(cellsState, 0)); = for (int row =3D 1; row <=3D rows; row++) { + if (row =3D=3D 1 && browserIsInternetExplorer()) { + continue; + } + = if (statePrefix.length() > 0) { String state =3D 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/r= ichfaces/integrationTest/extendedDataTable/GroupingTestCase.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/sandbox/rf-demo-ftest-iexplore/src/test/java/org/jboss/richfac= es/integrationTest/extendedDataTable/GroupingTestCase.java 2009-12-14 15:12= :25 UTC (rev 16122) +++ branches/sandbox/rf-demo-ftest-iexplore/src/test/java/org/jboss/richfac= es/integrationTest/extendedDataTable/GroupingTestCase.java 2009-12-14 15:17= :14 UTC (rev 16123) @@ -58,6 +58,10 @@ String expectedGroup =3D null; = for (int row =3D 1; row <=3D rows; row++) { + if (row =3D=3D 1 && browserIsInternetExplorer()) { + continue; + } + = if (belongsClass(MSG_TR_CLASS, format(LOC_TR_PREFORMATTED, row))) { // table row is type group expectedGroup =3D selenium.getText(format(LOC_TD_GROUP_PREFORMATTED, r= ow)).replace("State Name: ", "").replace("(1)", ""); --===============5072174739624460802==--