Class SmartCucumberUiScenarioContext
- java.lang.Object
-
- org.uitnet.testing.smartfwk.SmartCucumberScenarioContext
-
- org.uitnet.testing.smartfwk.ui.core.SmartCucumberUiScenarioContext
-
public class SmartCucumberUiScenarioContext extends 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
-
-
Field Summary
-
Fields inherited from class org.uitnet.testing.smartfwk.SmartCucumberScenarioContext
activeAppName, params, scenario
-
-
Constructor Summary
Constructors Constructor Description SmartCucumberUiScenarioContext()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.AbstractAppConnectorgetActiveAppConnector()SmartAppDrivergetActiveAppDriver()StringgetActiveUserProfileName(String appName)StringgetActiveUserProfileNameOfActiveApp()AbstractAppConnectorgetAppConnector(String appName)SmartAppDrivergetAppDriver(String appName)com.jayway.jsonpath.DocumentContextgetOverriddenDriverProps(String applicationName, String browserType)voidoverrideDriverProps(String applicationName, String browserType, String propsAsJson)SmartAppDriversetActiveUserProfile(String appName, String userProfileName)Sets the active user profile on the application.SmartAppDriversetActiveUserProfileOnActiveApp(String userProfileName)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)-
Methods inherited from class org.uitnet.testing.smartfwk.SmartCucumberScenarioContext
addParamValue, applyParamsValueOnText, getActiveAppConfig, getActiveAppName, getAllParams, getAppConfig, getEntriesForParamsEndsWithText, getEntriesForParamsStartsWithText, getMultiValueParamValueAsString, getParamValue, getParamValueAsBoolean, getParamValueAsDouble, getParamValueAsInteger, getParamValueAsLong, getParamValueAsString, getParamValueNullAsParamName, getScenario, getTestConfigManager, log, removeParam, setScenario
-
-
-
-
Method Detail
-
connectOrSwitch
public AbstractAppConnector connectOrSwitch(String appName)
Connect or switch to application.- Parameters:
appName-
-
connectOrSwitch
public SmartAppDriver connectOrSwitch(String appName, String userProfileName)
Connect or switch to specified application and set the user profile.- Parameters:
appName-userProfileName-- Returns:
-
setActiveUserProfile
public SmartAppDriver setActiveUserProfile(String appName, String userProfileName)
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
public SmartAppDriver setActiveUserProfileOnActiveApp(String userProfileName)
-
getActiveUserProfileNameOfActiveApp
public String getActiveUserProfileNameOfActiveApp()
-
getActiveAppDriver
public SmartAppDriver getActiveAppDriver()
-
getAppDriver
public SmartAppDriver getAppDriver(String appName)
-
getActiveAppConnector
public AbstractAppConnector getActiveAppConnector()
-
getAppConnector
public AbstractAppConnector getAppConnector(String appName)
-
overrideDriverProps
public void overrideDriverProps(String applicationName, String browserType, String propsAsJson)
-
getOverriddenDriverProps
public com.jayway.jsonpath.DocumentContext getOverriddenDriverProps(String applicationName, String browserType)
-
captureScreenshot
public void captureScreenshot()
-
captureScreenshot
public void captureScreenshot(String fileNameHint)
-
captureScreenshotWithScenarioStatus
public void captureScreenshotWithScenarioStatus(String status)
-
captureScreenshotOfApp
public void captureScreenshotOfApp(String appName)
-
captureScreenshotOfAppWithScenarioStatus
public void captureScreenshotOfAppWithScenarioStatus(String appName, String status)
-
switchToDefaultContent
public void switchToDefaultContent()
Switches all apps to default contents.
-
switchToDefaultContent
public void switchToDefaultContent(String appName)
Switches the specified app to default content.- Parameters:
appName-
-
switchToWindow
public void switchToWindow(String nameOrHandle)
-
switchToFrame
public void switchToFrame(String nameOrId)
-
switchToFrame
public void switchToFrame(UIObject pageElement)
-
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()
- Overrides:
closein classSmartCucumberScenarioContext
-
-