Package com.privalia.qa.specs
Class HookGSpec
- java.lang.Object
-
- com.privalia.qa.specs.BaseGSpec
-
- com.privalia.qa.specs.HookGSpec
-
public class HookGSpec extends BaseGSpec
This class contains functions that are executed before and after each test. For this, it makes use of cucumber hooks- Author:
- Jose Fernandez
- See Also:
- https://cucumber.io/docs/cucumber/api/#hooks
-
-
Field Summary
Fields Modifier and Type Field Description protected org.openqa.selenium.WebDriver
driver
static int
IMPLICITLY_WAIT
static int
PAGE_LOAD_TIMEOUT
static int
SCRIPT_TIMEOUT
-
Fields inherited from class com.privalia.qa.specs.BaseGSpec
commonspec
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
AppiumSetup()
If the feature has the @mobile annotation, creates a new Appium driver before each scenariovoid
globalSetup()
Clean the exception list before each scenario.void
remoteSSHConnectionTeardown()
Disconnect any remaining open SSH connection after each scenario is completedvoid
restClientSetup()
If the feature has the @rest annotation, creates a new REST client before each scenariovoid
restClientTeardown()
If the feature has the @rest annotation, closes the REST client after each scenario is completedvoid
seleniumSetup()
If the feature has the @web annotation, creates a new selenium web driver before each scenariovoid
seleniumTeardown(cucumber.api.Scenario scenario)
If the feature has the @web or @mobile annotation, closes selenium web driver after each scenario is completed.void
sqlConnectionClose()
If the feature has the @sql annotation, closes any open connection to a database after each scenario is completed-
Methods inherited from class com.privalia.qa.specs.BaseGSpec
getCommonSpec
-
-
-
-
Field Detail
-
PAGE_LOAD_TIMEOUT
public static final int PAGE_LOAD_TIMEOUT
- See Also:
- Constant Field Values
-
IMPLICITLY_WAIT
public static final int IMPLICITLY_WAIT
- See Also:
- Constant Field Values
-
SCRIPT_TIMEOUT
public static final int SCRIPT_TIMEOUT
- See Also:
- Constant Field Values
-
driver
protected org.openqa.selenium.WebDriver driver
-
-
Constructor Detail
-
HookGSpec
public HookGSpec(CommonG spec)
Default constructor.- Parameters:
spec
- commonG object
-
-
Method Detail
-
globalSetup
public void globalSetup()
Clean the exception list before each scenario.
-
seleniumSetup
public void seleniumSetup() throws Exception
If the feature has the @web annotation, creates a new selenium web driver before each scenario- Throws:
MalformedURLException
- MalformedURLExceptionException
-
AppiumSetup
public void AppiumSetup() throws IOException
If the feature has the @mobile annotation, creates a new Appium driver before each scenario- Throws:
MalformedURLException
- MalformedURLExceptionIOException
-
seleniumTeardown
public void seleniumTeardown(cucumber.api.Scenario scenario) throws IOException
If the feature has the @web or @mobile annotation, closes selenium web driver after each scenario is completed.- Parameters:
scenario
- Instance of the scenario just executed- Throws:
IOException
- The IOException
-
restClientSetup
public void restClientSetup()
If the feature has the @rest annotation, creates a new REST client before each scenario
-
restClientTeardown
public void restClientTeardown()
If the feature has the @rest annotation, closes the REST client after each scenario is completed
-
remoteSSHConnectionTeardown
public void remoteSSHConnectionTeardown()
Disconnect any remaining open SSH connection after each scenario is completed
-
-