Class SmartCucumberUiScenarioContext
java.lang.Object
org.uitnet.testing.smartfwk.ui.core.SmartCucumberUiScenarioContext
- All Implemented Interfaces:
SmartCucumberScenarioContext
public class SmartCucumberUiScenarioContext extends Object implements SmartCucumberScenarioContext
This class is used as cucumber scenario context to keep the information for
the running scenario. using this class we can pass the information from one
scenario to another scenario.
This class must be injected in the cucumber step definition constructor.
After that any step definition as part of one scenarion can access the
information from this class.
NOTE: We must have cucumber-picocontainer jar dependency in our Maven or
gradle build configuration (as part of cucumber documentation).
- Author:
- Madhav Krishna
-
Constructor Summary
Constructors Constructor Description SmartCucumberUiScenarioContext() -
Method Summary
Modifier and Type Method Description voidaddParamValue(String paramName, Object value)voidcaptureScreenshot()voidcaptureScreenshot(String fileNameHint)voidcaptureScreenshotOfApp(String appName)voidcaptureScreenshotOfAppWithScenarioStatus(String appName, String status)voidcaptureScreenshotWithScenarioStatus(String status)voidclose()voidcloseAllChildWindows()AbstractAppConnectorconnectOrSwitch(String appName)Connect or switch to application.SmartAppDriverconnectOrSwitch(String appName, String userProfileName)Connect or switch to specified application and set the user profile.AppConfiggetActiveAppConfig()AbstractAppConnectorgetActiveAppConnector()SmartAppDrivergetActiveAppDriver()StringgetActiveAppName()StringgetActiveUserProfileName(String appName)StringgetActiveUserProfileNameOfActiveApp()AppConfiggetAppConfig(String appName)AbstractAppConnectorgetAppConnector(String appName)SmartAppDrivergetAppDriver(String appName)ObjectgetParamValue(String paramName)io.cucumber.java.ScenariogetScenario()TestConfigManagergetTestConfigManager()voidlog(String message)voidremoveParam(String paramName)SmartAppDriversetActiveUserProfile(String appName, String userProfileName)Sets the active user profile on the application.SmartAppDriversetActiveUserProfileOnActiveApp(String userProfileName)voidsetScenario(io.cucumber.java.Scenario scenario)voidswitchToDefaultContent()Switches all apps to default contents.voidswitchToDefaultContent(String appName)Switches the specified app to default content.voidswitchToFrame(int index)voidswitchToFrame(String nameOrId)voidswitchToFrame(UIObject pageElement)voidswitchToNewWindow(org.openqa.selenium.WindowType typeHint)It creates the new window and switches the focus on it for future commands.voidswitchToWindow(String nameOrHandle)voidswitchToWindow(String appName, String nameOrHandle)voidwaitForSeconds(int seconds)
-
Constructor Details
-
SmartCucumberUiScenarioContext
public SmartCucumberUiScenarioContext()
-
-
Method Details
-
getScenario
public io.cucumber.java.Scenario getScenario()- Specified by:
getScenarioin interfaceSmartCucumberScenarioContext
-
setScenario
public void setScenario(io.cucumber.java.Scenario scenario)- Specified by:
setScenarioin interfaceSmartCucumberScenarioContext
-
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:
-
getActiveAppName
- Specified by:
getActiveAppNamein interfaceSmartCucumberScenarioContext
-
setActiveUserProfileOnActiveApp
-
getActiveUserProfileNameOfActiveApp
-
getActiveUserProfileName
-
getActiveAppDriver
-
getAppDriver
-
getActiveAppConnector
-
getAppConnector
-
captureScreenshot
public void captureScreenshot() -
captureScreenshot
-
captureScreenshotWithScenarioStatus
-
captureScreenshotOfApp
-
captureScreenshotOfAppWithScenarioStatus
-
getTestConfigManager
- Specified by:
getTestConfigManagerin interfaceSmartCucumberScenarioContext
-
getActiveAppConfig
- Specified by:
getActiveAppConfigin interfaceSmartCucumberScenarioContext
-
getAppConfig
- Specified by:
getAppConfigin interfaceSmartCucumberScenarioContext
-
log
- Specified by:
login interfaceSmartCucumberScenarioContext
-
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() -
waitForSeconds
public void waitForSeconds(int seconds) -
close
public void close()- Specified by:
closein interfaceSmartCucumberScenarioContext
-
addParamValue
- Specified by:
addParamValuein interfaceSmartCucumberScenarioContext
-
getParamValue
- Specified by:
getParamValuein interfaceSmartCucumberScenarioContext
-
removeParam
- Specified by:
removeParamin interfaceSmartCucumberScenarioContext
-