Author: lfryc(a)redhat.com
Date: 2011-01-19 12:56:38 -0500 (Wed, 19 Jan 2011)
New Revision: 21096
Added:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richComponentControl/ComponentControlAttributes.java
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richComponentControl/ComponentControlDataScroller.java
Log:
rich:componentControl - fixed the test after added select for attributes selection
Added:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richComponentControl/ComponentControlAttributes.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richComponentControl/ComponentControlAttributes.java
(rev 0)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richComponentControl/ComponentControlAttributes.java 2011-01-19
17:56:38 UTC (rev 21096)
@@ -0,0 +1,42 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ *******************************************************************************/
+package org.richfaces.tests.metamer.ftest.richComponentControl;
+
+import org.richfaces.tests.metamer.ftest.AbstractComponentAttributes;
+
+/**
+ * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
+ * @version $Revision$
+ */
+public class ComponentControlAttributes extends AbstractComponentAttributes {
+ public void setOperation(String operation) {
+ setProperty("operation", operation);
+ }
+
+ public void setSelector(String selector) {
+ setProperty("selector", selector);
+ }
+
+ public void setTarget(String target) {
+ setProperty("target", target);
+ }
+}
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richComponentControl/ComponentControlDataScroller.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richComponentControl/ComponentControlDataScroller.java 2011-01-19
17:55:59 UTC (rev 21095)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richComponentControl/ComponentControlDataScroller.java 2011-01-19
17:56:38 UTC (rev 21096)
@@ -21,14 +21,13 @@
*******************************************************************************/
package org.richfaces.tests.metamer.ftest.richComponentControl;
-import org.jboss.test.selenium.dom.Event;
+import static org.jboss.test.selenium.guard.request.RequestTypeGuardFactory.guardXhr;
+import static org.jboss.test.selenium.locator.LocatorFactory.jq;
+import static org.testng.Assert.assertEquals;
+
import org.jboss.test.selenium.locator.JQueryLocator;
import org.richfaces.tests.metamer.ftest.model.AssertingDataScroller;
-import static org.jboss.test.selenium.locator.LocatorFactory.*;
-import static org.jboss.test.selenium.guard.request.RequestTypeGuardFactory.*;
-import static org.testng.Assert.*;
-
/**
* @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
* @version $Revision$
@@ -36,8 +35,9 @@
public class ComponentControlDataScroller extends AssertingDataScroller {
JQueryLocator button = jq(":submit[id$=button]");
- JQueryLocator selectOperation =
jq(":radio[name$=operationInput][value={0}]");
+ ComponentControlAttributes attributes = new ComponentControlAttributes();
+
public ComponentControlDataScroller() {
super(jq("span.rf-ds[id$=scroller]"));
}
@@ -63,11 +63,7 @@
}
private void doOperation(String operation) {
- JQueryLocator locator = selectOperation.format(operation);
- if (!"on".equals(selenium.getValue(locator))) {
- selenium.check(locator);
- guardHttp(selenium).fireEvent(locator, Event.CHANGE);
- }
+ attributes.setOperation(operation);
guardXhr(selenium).click(button);
}