diff --git a/src/com/qmetry/qaf/automation/step/CommonStep.java b/src/com/qmetry/qaf/automation/step/CommonStep.java index 38f3b76..65451cd 100644 --- a/src/com/qmetry/qaf/automation/step/CommonStep.java +++ b/src/com/qmetry/qaf/automation/step/CommonStep.java @@ -42,6 +42,7 @@ import org.hamcrest.Matchers; import org.openqa.selenium.Cookie; +import org.openqa.selenium.interactions.Actions; import com.qmetry.qaf.automation.core.TestBaseProvider; import com.qmetry.qaf.automation.data.MetaData; @@ -50,6 +51,7 @@ import com.qmetry.qaf.automation.ui.WebDriverTestBase; import static com.qmetry.qaf.automation.ui.webdriver.ElementFactory.$; import com.qmetry.qaf.automation.ui.webdriver.QAFExtendedWebElement; +import com.qmetry.qaf.automation.ui.webdriver.QAFWebElement; import com.qmetry.qaf.automation.util.StringUtil; import com.qmetry.qaf.automation.ws.rest.RestTestBase; import com.sun.jersey.api.client.ClientResponse; @@ -323,12 +325,12 @@ public static void get(String url) { * current thread. Note that it will not tear-down the current driver * session. *
- * It is useful for some use cases involving browser and device - * - There are some use cases involving more than 2 devices/browsers (ex.: - * video conference) + * It is useful for some use cases involving browser and device - There are + * some use cases involving more than 2 devices/browsers (ex.: video + * conference) *
- * For single driver in entire test case you don't required to use
- * this method.
+ * For single driver in entire test case you don't required to use this
+ * method.
*
* @since 2.1.11
* @param driverName
@@ -414,9 +416,7 @@ public static void requestForResource(String resource, Map
+ * Example:
+ *
+ * BDD
+ *
+ * KWD
+ *
@@ -2198,8 +2221,7 @@ public static void getCookieValue(String name) {
@QAFTestStep(description = "mouse move on {loc}")
public static void mouseOver(String loc) {
- new WebDriverTestBase().getDriver().getMouse()
- .mouseMove(((QAFExtendedWebElement)$(loc)).getCoordinates());
+ new WebDriverTestBase().getDriver().getMouse().mouseMove(((QAFExtendedWebElement) $(loc)).getCoordinates());
}
/**
@@ -2241,8 +2263,7 @@ public static void stopTransaction() {
*/
@QAFTestStep(stepName = "switchToFrame", description = "switch to frame {0}")
public static Object switchToFrame(String locator) {
- return new WebDriverTestBase().getDriver().switchTo()
- .frame(new QAFExtendedWebElement(locator));
+ return new WebDriverTestBase().getDriver().switchTo().frame(new QAFExtendedWebElement(locator));
}
/**
+ * drag 'source.ele.loc' and drop on 'target.ele.loc'
+ *
+ *
+ * dragAndDrop|['source.ele.loc','target.ele.loc']|
+ *
+ * @param source
+ * : {0} : source element locator to emulate button down at.
+ * @param target
+ * : {1} : target element locator to move to and release the
+ * mouse at.
+ */
+ @QAFTestStep(description = "drag {source} and drop on {target}")
+ public static void dragAndDrop(String source, String target) {
+ QAFExtendedWebElement src = (QAFExtendedWebElement) $(source);
+ Actions actions = new Actions(src.getWrappedDriver());
+ actions.dragAndDrop(src, $(target));
+ }
+
/**
* Wait for the specified element is visible Determines if the specified
* element is visible. An element can be rendered invisible by setting the
@@ -792,7 +821,8 @@ public static void waitForEnabled(String loc, long sec) {
*/
@QAFTestStep(description = "wait until {loc} to be present")
public static void waitForPresent(String loc) {
- $(loc).waitForPresent();;
+ $(loc).waitForPresent();
+ ;
}
@@ -1098,8 +1128,7 @@ public static void waitForNotAttribute(String loc, String attr, String value) {
// @QAFTestStep(stepName = "waitForNotAttributeWithTimeout", description =
// "wait {3}sec for {0} attribute {1} value is not {2}")
- public static void waitForNotAttribute(String loc, String attr, String value,
- long sec) {
+ public static void waitForNotAttribute(String loc, String attr, String value, long sec) {
$(loc).waitForAttribute(attr, value, sec * 1000);
}
@@ -1235,8 +1264,7 @@ public static void waitForNotCssStyle(String loc, String prop, String value) {
// @QAFTestStep(stepName = "waitForNotCssStyleWithTimeout", description =
// "wait {3}sec for {0} css property {1} vaule is {2} ")
- public static void waitForNotCssStyle(String loc, String prop, String value,
- long sec) {
+ public static void waitForNotCssStyle(String loc, String prop, String value, long sec) {
$(loc).waitForNotCssStyle(prop, value, sec * 1000);
}
@@ -1281,18 +1309,12 @@ public static void waitForAjaxToComplete() {
* Will check and wait until in-progress AJAX call get completed from
* provide toolkit. Following are supported toolkit:
*
- *