Author: vrockai
Date: 2008-10-21 11:22:11 -0400 (Tue, 21 Oct 2008)
New Revision: 12116
Modified:
branches/JBoss_Portal_Branch_2_6/testsuite/ui-tests/src/org/jboss/portal/test/selenium/JBossPortalSeleniumTestCase.java
Log:
4 minutes timeout for wait for element
Modified:
branches/JBoss_Portal_Branch_2_6/testsuite/ui-tests/src/org/jboss/portal/test/selenium/JBossPortalSeleniumTestCase.java
===================================================================
---
branches/JBoss_Portal_Branch_2_6/testsuite/ui-tests/src/org/jboss/portal/test/selenium/JBossPortalSeleniumTestCase.java 2008-10-21
15:21:08 UTC (rev 12115)
+++
branches/JBoss_Portal_Branch_2_6/testsuite/ui-tests/src/org/jboss/portal/test/selenium/JBossPortalSeleniumTestCase.java 2008-10-21
15:22:11 UTC (rev 12116)
@@ -24,7 +24,7 @@
protected static final String PAGE_LOAD = "900000";
// Element timeout in seconds
- protected static final int ELEM_TIMEOUT = 60;
+ protected static final int ELEM_TIMEOUT = 240;
@BeforeClass
public void setupChromeForLogin() throws Exception {
@@ -142,7 +142,7 @@
}
}
- public void waitForElement(String locator) {
+ protected void waitForElement(String locator) {
for (int second = 0;; second++) {
if (second >= ELEM_TIMEOUT) {
Assert.fail("Element " + locator + " not found.");
@@ -156,6 +156,20 @@
}
}
+ public void waitForText(String text) {
+ for (int second = 0;; second++) {
+ if (second >= ELEM_TIMEOUT) {
+ Assert.fail("Text '" + text + "' not found.");
+ }
+ try {
+ if (selenium.isTextPresent(text))
+ break;
+ } catch (Exception e) {
+ }
+ waitFor(1000);
+ }
+ }
+
protected void login(String username, String password) {
selenium.open(ADDR_PORTAL);
selenium.waitForPageToLoad(PAGE_LOAD);