Class 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
    • Constructor Detail

      • SmartCucumberUiScenarioContext

        public SmartCucumberUiScenarioContext()
    • 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()
      • getActiveUserProfileName

        public String getActiveUserProfileName​(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)
      • switchToWindow

        public void switchToWindow​(String appName,
                                   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)