Author: Alex.Kolonitsky
Date: 2009-09-14 05:45:52 -0400 (Mon, 14 Sep 2009)
New Revision: 15549
Modified:
branches/community/3.3.X/examples/photoalbum/tests/src/test/java/org/richfaces/photoalbum/RealWorldHelper.java
Log:
Investigate and fix photoalbum tests
https://jira.jboss.org/jira/browse/RFPL-86
Modified:
branches/community/3.3.X/examples/photoalbum/tests/src/test/java/org/richfaces/photoalbum/RealWorldHelper.java
===================================================================
---
branches/community/3.3.X/examples/photoalbum/tests/src/test/java/org/richfaces/photoalbum/RealWorldHelper.java 2009-09-13
23:43:17 UTC (rev 15548)
+++
branches/community/3.3.X/examples/photoalbum/tests/src/test/java/org/richfaces/photoalbum/RealWorldHelper.java 2009-09-14
09:45:52 UTC (rev 15549)
@@ -200,13 +200,30 @@
if (isLogined(selenium)) {
logout(selenium);
}
- selenium.click(HtmlConstants.LogInOutArea.LOGIN_ID);
- try {
- Thread.sleep(5000);
- }catch (Exception e) {
- Assert.fail("Test failed caused by: " + e);
- }
+ for (int i = 0; i < 3; i++) {
+ try {
+ selenium.click(HtmlConstants.LogInOutArea.LOGIN_ID);
+ try {
+ Thread.sleep(5000);
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ Assert.fail("Error : " + e.getMessage());
+ }
+ break;
+ } catch (Exception e) {
+ // Do nothing.
+ System.out.println("RealWorldHelper.login -1- ");
+ }
+
+ try {
+
selenium.click("//*[@id='mainform:bodyPanel_body']/a");
+ } catch (Exception e) {
+ // Do nothing.
+ System.out.println("RealWorldHelper.login -2- ");
+ }
+ }
+
Assert.assertTrue(selenium.isVisible(HtmlConstants.LoginPanel.usernameId), "Input
for username in not visible");
Assert.assertTrue(selenium.isVisible(HtmlConstants.LoginPanel.passwordId), "Input
for password in not visible");