Author: vuthelinh
Date: 2010-10-05 00:30:14 -0400 (Tue, 05 Oct 2010)
New Revision: 4486
Modified:
portal/trunk/testsuite/selenium-snifftests/src/main/java/org/exoplatform/portal/selenium/SeleniumTestCaseGenerator.java
Log:
add waitForCheck, waitForLocation, doubleClickAt and verifySelectLabel
Modified:
portal/trunk/testsuite/selenium-snifftests/src/main/java/org/exoplatform/portal/selenium/SeleniumTestCaseGenerator.java
===================================================================
---
portal/trunk/testsuite/selenium-snifftests/src/main/java/org/exoplatform/portal/selenium/SeleniumTestCaseGenerator.java 2010-10-04
23:20:52 UTC (rev 4485)
+++
portal/trunk/testsuite/selenium-snifftests/src/main/java/org/exoplatform/portal/selenium/SeleniumTestCaseGenerator.java 2010-10-05
04:30:14 UTC (rev 4486)
@@ -384,7 +384,42 @@
sb.append("(\"");
sb.append(param2);
sb.append("\"));\n");
- } else if (param1.equals("assertNotVisible")) {
+
+
+ //-----------------add by linh_vu------------
+ } else if (param1.equals("waitForChecked")) {
+ sb.append("for (int second = 0;; second++) {\n");
+ sb.append(getTimeoutMessage(param1));
+ sb.append("try {\nif (!selenium.isChecked(\"");
+ sb.append(param2);
+ sb.append("\"))\n break;\n }\n catch (Exception e) {}\n");
+ sb.append("Thread.sleep(1000);\n");
+ sb.append("}\n");
+ } else if (param1.equals("waitForLocation")) {
+ sb.append("for (int second = 0;; second++) {\n");
+ sb.append(getTimeoutMessage(param1));
+ sb.append("try {\n");
+ sb.append("if (selenium.getLocation().equals(\"");
+ sb.append(param2);
+ sb.append("\")) {\nbreak;\n}\n}\ncatch (Exception e) {\n}\n");
+ sb.append("Thread.sleep(1000);\n");
+ sb.append("}\n");
+ } else if (param1.equals("doubleClickAt")) {
+ sb.append("selenium.");
+ sb.append(param1);
+ sb.append("(\"");
+ sb.append(param2);
+ sb.append("\", \"1,1\");\n");
+ } else if (param1.equals("verifySelectedLabel")) {
+ sb.append("TestCase.assertTrue");
+ sb.append("(selenium.getSelectedLabel(\"");
+ sb.append(param2);
+ sb.append("\").equals(\"");
+ sb.append(param3);
+ sb.append("\"));\n");
+ }
+ //-----------------------------
+ else if (param1.equals("assertNotVisible")) {
sb.append("TestCase.assertFalse(selenium.isVisible");
sb.append("(\"");
sb.append(param2);
Show replies by date