[seam-commits] Seam SVN: r9969 - in trunk/src/test/ftest: examples/spring/src/org/jboss/seam/example/spring/test/selenium and 2 other directories.
seam-commits at lists.jboss.org
seam-commits at lists.jboss.org
Thu Jan 22 04:45:31 EST 2009
Author: jharting
Date: 2009-01-22 04:45:30 -0500 (Thu, 22 Jan 2009)
New Revision: 9969
Modified:
trunk/src/test/ftest/examples/dvdstore/src/org/jboss/seam/example/dvd/test/selenium/LoginTest.java
trunk/src/test/ftest/examples/dvdstore/src/org/jboss/seam/example/dvd/test/selenium/RegistrationTest.java
trunk/src/test/ftest/examples/dvdstore/src/org/jboss/seam/example/dvd/test/selenium/SeleniumDvdTest.java
trunk/src/test/ftest/examples/spring/src/org/jboss/seam/example/spring/test/selenium/SpringChangePasswordTest.java
trunk/src/test/ftest/src/main/org/jboss/seam/example/common/test/booking/selenium/ChangePasswordTest.java
trunk/src/test/ftest/src/main/org/jboss/seam/example/common/test/booking/selenium/RegistrationTest.java
trunk/src/test/ftest/src/main/org/jboss/seam/example/common/test/booking/selenium/SeleniumBookingTest.java
trunk/src/test/ftest/src/main/org/jboss/seam/example/common/test/selenium/SeamSelenium.java
trunk/src/test/ftest/src/main/org/jboss/seam/example/common/test/selenium/SeamSeleniumTest.java
Log:
JBSEAM-3690
Modified: trunk/src/test/ftest/examples/dvdstore/src/org/jboss/seam/example/dvd/test/selenium/LoginTest.java
===================================================================
--- trunk/src/test/ftest/examples/dvdstore/src/org/jboss/seam/example/dvd/test/selenium/LoginTest.java 2009-01-22 01:10:16 UTC (rev 9968)
+++ trunk/src/test/ftest/examples/dvdstore/src/org/jboss/seam/example/dvd/test/selenium/LoginTest.java 2009-01-22 09:45:30 UTC (rev 9969)
@@ -36,9 +36,10 @@
*/
public class LoginTest extends SeleniumDvdTest {
+ @Override
@BeforeMethod
public void setUp() {
- startBrowser();
+ browser = startBrowser();
}
@Test(groups = { "login.basic" })
Modified: trunk/src/test/ftest/examples/dvdstore/src/org/jboss/seam/example/dvd/test/selenium/RegistrationTest.java
===================================================================
--- trunk/src/test/ftest/examples/dvdstore/src/org/jboss/seam/example/dvd/test/selenium/RegistrationTest.java 2009-01-22 01:10:16 UTC (rev 9968)
+++ trunk/src/test/ftest/examples/dvdstore/src/org/jboss/seam/example/dvd/test/selenium/RegistrationTest.java 2009-01-22 09:45:30 UTC (rev 9969)
@@ -43,11 +43,13 @@
// suffix is needed to allow test to be run repeatedly
private String suffix = Long.toString(new Date().getTime() % 10000000);
+ @Override
@BeforeMethod
public void setUp() {
- startBrowser();
+ browser = startBrowser();
browser.open(CONTEXT_PATH + getProperty("HOME_PAGE"));
new Wait() {
+ @Override
public boolean until() {
return browser.isElementPresent(getProperty("REGISTRATION"));
}
Modified: trunk/src/test/ftest/examples/dvdstore/src/org/jboss/seam/example/dvd/test/selenium/SeleniumDvdTest.java
===================================================================
--- trunk/src/test/ftest/examples/dvdstore/src/org/jboss/seam/example/dvd/test/selenium/SeleniumDvdTest.java 2009-01-22 01:10:16 UTC (rev 9968)
+++ trunk/src/test/ftest/examples/dvdstore/src/org/jboss/seam/example/dvd/test/selenium/SeleniumDvdTest.java 2009-01-22 09:45:30 UTC (rev 9969)
@@ -41,15 +41,17 @@
protected final String DEFAULT_USERNAME = "user1";
protected final String DEFAULT_PASSWORD = "password";
+ @Override
@BeforeMethod
public void setUp() {
- startBrowser();
+ super.setUp();
login(DEFAULT_USERNAME, DEFAULT_PASSWORD);
}
public boolean login(String username, String password) {
browser.open(CONTEXT_PATH + getProperty("HOME_PAGE"));
new Wait() {
+ @Override
public boolean until() {
return browser.isElementPresent(getProperty("LOGIN_SUBMIT"));
}
@@ -64,10 +66,11 @@
return isLoggedIn(browser);
}
+ @Override
@AfterMethod
public void tearDown() {
logout(browser);
- stopBrowser();
+ super.tearDown();
}
public void logout(Selenium browser) {
Modified: trunk/src/test/ftest/examples/spring/src/org/jboss/seam/example/spring/test/selenium/SpringChangePasswordTest.java
===================================================================
--- trunk/src/test/ftest/examples/spring/src/org/jboss/seam/example/spring/test/selenium/SpringChangePasswordTest.java 2009-01-22 01:10:16 UTC (rev 9968)
+++ trunk/src/test/ftest/examples/spring/src/org/jboss/seam/example/spring/test/selenium/SpringChangePasswordTest.java 2009-01-22 09:45:30 UTC (rev 9969)
@@ -42,9 +42,10 @@
private final String USERNAME = "gavin";
private final String PASSWORD = "foobar";
+ @Override
@BeforeMethod
public void setUp() {
- startBrowser();
+ super.setUp();
assertTrue("Login failed.", login(USERNAME, PASSWORD));
}
Modified: trunk/src/test/ftest/src/main/org/jboss/seam/example/common/test/booking/selenium/ChangePasswordTest.java
===================================================================
--- trunk/src/test/ftest/src/main/org/jboss/seam/example/common/test/booking/selenium/ChangePasswordTest.java 2009-01-22 01:10:16 UTC (rev 9968)
+++ trunk/src/test/ftest/src/main/org/jboss/seam/example/common/test/booking/selenium/ChangePasswordTest.java 2009-01-22 09:45:30 UTC (rev 9969)
@@ -44,7 +44,7 @@
@Override
@BeforeMethod
public void setUp() {
- startBrowser();
+ browser = startBrowser();
assertTrue("Login failed.", login(USERNAME, PASSWORD));
}
Modified: trunk/src/test/ftest/src/main/org/jboss/seam/example/common/test/booking/selenium/RegistrationTest.java
===================================================================
--- trunk/src/test/ftest/src/main/org/jboss/seam/example/common/test/booking/selenium/RegistrationTest.java 2009-01-22 01:10:16 UTC (rev 9968)
+++ trunk/src/test/ftest/src/main/org/jboss/seam/example/common/test/booking/selenium/RegistrationTest.java 2009-01-22 09:45:30 UTC (rev 9969)
@@ -52,7 +52,7 @@
@Override
@BeforeMethod
public void setUp() {
- startBrowser();
+ browser = startBrowser();
}
@Override
Modified: trunk/src/test/ftest/src/main/org/jboss/seam/example/common/test/booking/selenium/SeleniumBookingTest.java
===================================================================
--- trunk/src/test/ftest/src/main/org/jboss/seam/example/common/test/booking/selenium/SeleniumBookingTest.java 2009-01-22 01:10:16 UTC (rev 9968)
+++ trunk/src/test/ftest/src/main/org/jboss/seam/example/common/test/booking/selenium/SeleniumBookingTest.java 2009-01-22 09:45:30 UTC (rev 9969)
@@ -44,7 +44,7 @@
@Override
@BeforeMethod
public void setUp() {
- startBrowser();
+ super.setUp();
assertTrue("Login failed.", login());
}
@@ -52,7 +52,7 @@
@AfterMethod
public void tearDown() {
logout();
- stopBrowser();
+ super.tearDown();
}
public boolean login() {
Modified: trunk/src/test/ftest/src/main/org/jboss/seam/example/common/test/selenium/SeamSelenium.java
===================================================================
--- trunk/src/test/ftest/src/main/org/jboss/seam/example/common/test/selenium/SeamSelenium.java 2009-01-22 01:10:16 UTC (rev 9968)
+++ trunk/src/test/ftest/src/main/org/jboss/seam/example/common/test/selenium/SeamSelenium.java 2009-01-22 09:45:30 UTC (rev 9969)
@@ -61,5 +61,12 @@
super.waitForPageToLoad(timeout);
}
+ /**
+ * Simulates a user pressing "refresh" button and waits for page to load. Default timeout can be changed by setTimeout() method.
+ */
+ public void refreshAndWait() {
+ super.refresh();
+ super.waitForPageToLoad(timeout);
+ }
}
Modified: trunk/src/test/ftest/src/main/org/jboss/seam/example/common/test/selenium/SeamSeleniumTest.java
===================================================================
--- trunk/src/test/ftest/src/main/org/jboss/seam/example/common/test/selenium/SeamSeleniumTest.java 2009-01-22 01:10:16 UTC (rev 9968)
+++ trunk/src/test/ftest/src/main/org/jboss/seam/example/common/test/selenium/SeamSeleniumTest.java 2009-01-22 09:45:30 UTC (rev 9969)
@@ -32,8 +32,6 @@
import org.testng.annotations.Optional;
import org.testng.annotations.Parameters;
-import com.thoughtworks.selenium.Selenium;
-
/**
* Base class for all Seam based selenium tests.
* @author jbalunas
More information about the seam-commits
mailing list