Package org.uitnet.testing.smartfwk
Class SmartCucumberScenarioContext
java.lang.Object
org.uitnet.testing.smartfwk.SmartCucumberScenarioContext
public class SmartCucumberScenarioContext extends Object
Generic interface for cucumber scenario context.
- Author:
- Madhav Krishna
-
Field Summary
Fields Modifier and Type Field Description protected StringactiveAppNameprotected Map<String,Boolean>conditionsprotected booleanisUiScenarioprotected Map<String,Object>paramsprotected io.cucumber.java.Scenarioscenarioprotected StringscreenCaptureFailedStatus -
Constructor Summary
Constructors Constructor Description SmartCucumberScenarioContext() -
Method Summary
-
Field Details
-
params
-
conditions
-
scenario
protected io.cucumber.java.Scenario scenario -
isUiScenario
protected boolean isUiScenario -
screenCaptureFailedStatus
-
activeAppName
-
-
Constructor Details
-
SmartCucumberScenarioContext
public SmartCucumberScenarioContext()
-
-
Method Details
-
connectOrSwitch
Connect or switch to application.- Parameters:
appName-
-
connectOrSwitch
Connect or switch to specified application and set the user profile.- Parameters:
appName-userProfileName-- Returns:
-
setActiveUserProfile
Sets the active user profile on the application. If application is not connected then it will connect to application first and then set the user profile.- Parameters:
appName-userProfileName-- Returns:
-
setActiveUserProfileOnActiveApp
-
getActiveUserProfileNameOfActiveApp
-
getActiveUserProfileName
-
getActiveAppDriver
-
getAppDriver
-
getActiveAppConnector
-
getAppConnector
-
overrideDriverProps
-
getOverriddenDriverProps
-
captureScreenshot
public void captureScreenshot() -
captureScreenshot
-
captureScreenshotWithScenarioStatus
-
captureScreenshotOfApp
-
captureScreenshotOfAppWithScenarioStatus
-
switchToDefaultContent
public void switchToDefaultContent()Switches all apps to default contents. -
switchToDefaultContent
Switches the specified app to default content.- Parameters:
appName-
-
switchToWindow
-
switchToWindow
-
switchToFrame
-
switchToFrame
-
switchToFrame
public void switchToFrame(int index) -
switchToNewWindow
public void switchToNewWindow(org.openqa.selenium.WindowType typeHint)It creates the new window and switches the focus on it for future commands.- Parameters:
typeHint-
-
closeAllChildWindows
public void closeAllChildWindows() -
close
public void close() -
close
public void close(boolean captureScreenshot) -
getScenario
public io.cucumber.java.Scenario getScenario() -
setScenario
public void setScenario(io.cucumber.java.Scenario scenario) -
getActiveAppName
-
getTestConfigManager
-
getActiveAppConfig
-
getAppConfig
-
log
-
addParamValue
-
getParamValue
This method returns param value. If does not exist then returns as null.- Parameters:
paramName-- Returns:
-
getParamValueAsString
-
getParamValueAsInteger
-
getParamValueAsLong
-
getParamValueAsDouble
-
getParamValueAsBoolean
-
getMultiValueParamValueAsString
public String getMultiValueParamValueAsString(String paramName, String delimitter, String valueEnclosingChars)MultiValue params are like Array, List, Set- Parameters:
paramName-delimitter- - could be , or any string, if null then it will use default as ,valueEnclosingChars- like ' or " or empty/null (denotes no enclosing)- Returns:
-
getAllParams
-
getEntriesForParamsEndsWithText
-
getEntriesForParamsStartsWithText
-
getParamValueNullAsParamName
This method returns param value. If does not exist then returns paramName as value.- Parameters:
paramName-- Returns:
-
removeParam
-
getDatabaseManager
-
getApiTestManager
-
getRemoteMachineManager
-
isUiScenario
public boolean isUiScenario() -
setCondition
-
isConditionSet
-
unsetCondition
-
unsetAllConditions
public void unsetAllConditions() -
isLastConditionSetToTrue
public boolean isLastConditionSetToTrue() -
getLastConditionName
-
applyParamsValueOnText
It will apply all params value to the text. It will convert param value to string then apply. Apply order: 1. First applies the DefaultSmartCache params. 2. Then applies the scenarioContext params.- Parameters:
text-- Returns:
- the updated text
-
waitForSeconds
public void waitForSeconds(int seconds)
-