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 Details

    • SmartCucumberUiScenarioContext

      public SmartCucumberUiScenarioContext()
  • Method Details

    • getScenario

      public io.cucumber.java.Scenario getScenario()
      Specified by:
      getScenario in interface SmartCucumberScenarioContext
    • setScenario

      public void setScenario​(io.cucumber.java.Scenario scenario)
      Specified by:
      setScenario in interface SmartCucumberScenarioContext
    • 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:
    • getActiveAppName

      public String getActiveAppName()
      Specified by:
      getActiveAppName in interface SmartCucumberScenarioContext
    • setActiveUserProfileOnActiveApp

      public SmartAppDriver setActiveUserProfileOnActiveApp​(String userProfileName)
    • getActiveUserProfileNameOfActiveApp

      public String getActiveUserProfileNameOfActiveApp()
    • getActiveUserProfileName

      public String getActiveUserProfileName​(String appName)
    • getActiveAppDriver

      public SmartAppDriver getActiveAppDriver()
    • getAppDriver

      public SmartAppDriver getAppDriver​(String appName)
    • getActiveAppConnector

      public AbstractAppConnector getActiveAppConnector()
    • getAppConnector

      public AbstractAppConnector getAppConnector​(String appName)
    • 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)
    • getTestConfigManager

      public TestConfigManager getTestConfigManager()
      Specified by:
      getTestConfigManager in interface SmartCucumberScenarioContext
    • getActiveAppConfig

      public AppConfig getActiveAppConfig()
      Specified by:
      getActiveAppConfig in interface SmartCucumberScenarioContext
    • getAppConfig

      public AppConfig getAppConfig​(String appName)
      Specified by:
      getAppConfig in interface SmartCucumberScenarioContext
    • log

      public void log​(String message)
      Specified by:
      log in interface SmartCucumberScenarioContext
    • 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)
    • close

      public void close()
      Specified by:
      close in interface SmartCucumberScenarioContext
    • addParamValue

      public void addParamValue​(String paramName, Object value)
      Specified by:
      addParamValue in interface SmartCucumberScenarioContext
    • getParamValue

      public Object getParamValue​(String paramName)
      Specified by:
      getParamValue in interface SmartCucumberScenarioContext
    • removeParam

      public void removeParam​(String paramName)
      Specified by:
      removeParam in interface SmartCucumberScenarioContext