Skip to content

Commit

Permalink
added steps related to frame
Browse files Browse the repository at this point in the history
  • Loading branch information
[email protected] committed Mar 6, 2017
1 parent 02cad9d commit b19a34c
Showing 1 changed file with 35 additions and 5 deletions.
40 changes: 35 additions & 5 deletions src/com/qmetry/qaf/automation/step/CommonStep.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
* For any inquiry or need additional information, please contact [email protected]
*******************************************************************************/


package com.qmetry.qaf.automation.step;

import static com.qmetry.qaf.automation.core.ConfigurationManager.getBundle;
Expand Down Expand Up @@ -463,7 +462,7 @@ public static void response_should_have_status(String status) {
assertThat("Response Status", new RestTestBase().getResponse().getStatus().name(),
Matchers.equalToIgnoringCase(status));
}

/**
* This method check for the response status of web service
* <p>
Expand All @@ -480,7 +479,7 @@ public static void response_should_have_status(String status) {
*
* @param status
* : {0} : Status code, for example 200, 301
* @see Status
* @see Status
*/
@QAFTestStep(description = "response should have status code {statusCode}")
public static void response_should_have_statuscode(int statusCode) {
Expand Down Expand Up @@ -2142,11 +2141,11 @@ public static void mouseOver(String loc) {
* @param threshold
*/
@MetaData("{'qafstep-transaction':true}")
@QAFTestStep(stepName="startTransactionWithThreshold", description = "start (transaction|time-tracker) for {task-name} with {second}s threshold")
@QAFTestStep(stepName = "startTransactionWithThreshold", description = "start (transaction|time-tracker) for {task-name} with {second}s threshold")
public static void startTransaction(String name, int threshold) {

}

/**
* Start time tracking which can be stopped by subsequent call to
* {@link #stopTransaction()}. It will group all steps and track time.
Expand All @@ -2165,4 +2164,35 @@ public static void stopTransaction() {

}

/**
*
* @param locator
* - locator of frame
* @return
*/
@QAFTestStep(stepName = "switchToFrame", description = "switch to frame {0}")
public static Object switchToFrame(String locator) {
return new WebDriverTestBase().getDriver().switchTo().frame(new QAFExtendedWebElement(locator));
}

/**
* switches the webdriver context to the parent frame
* @return
*/
@QAFTestStep(stepName = "switchToParentFrame", description = "switch to parent frame")
public static Object switchToParentFrame() {
return new WebDriverTestBase().getDriver().switchTo().parentFrame();
}

/**
* switched to the defult window. Generally used to come out of any frame
* context
*
* @return
*/
@QAFTestStep(stepName = "switchToDefaultWindow", description = "switch to default window")
public static Object switchToDefaultWindow() {
return new WebDriverTestBase().getDriver().switchTo().defaultContent();
}

}

0 comments on commit b19a34c

Please sign in to comment.