Permalink
Browse files

Add contains support

  • Loading branch information...
1 parent a0c68f4 commit 1152b5c0abfe0a86226d3d751619e5f3c8ff6e66 @altus34 altus34 committed Oct 20, 2011
@@ -30,6 +30,7 @@
import java.util.Arrays;
import java.util.List;
+import static java.lang.Boolean.FALSE;
import static org.testatoo.core.ComponentType.*;
public class SeleniumFlexEvaluator extends AbstractEvaluator<Selenium> implements FlexEvaluator {
@@ -498,11 +499,19 @@ public boolean until() {
// + "'].flexComponentType('" + id + "');"));
// }
//
-// public Boolean contains(Container container, Component component) {
-// return Boolean.valueOf(selenium.getEval("window.document['" + flexObjectId() + "'].contain('"
-// + ((Component) container).id() + "', '" + component.id() + "');"));
-// }
-//
+ @Override
+ public Boolean contains(Container container, Component... component) {
+ boolean containsAllElements = true;
+ for (Component cmp : component) {
+ if (!Boolean.valueOf(selenium.getEval("window.document['" + flexObjectId() + "'].contain('"
+ + ((Component) container).id() + "', '" + cmp.id() + "');"))) {
+ containsAllElements = false;
+ }
+ }
+ return containsAllElements;
+ }
+
+
// public void unselect(String value, ListModel listModel) {
// }
//

0 comments on commit 1152b5c

Please sign in to comment.