Package dev.aherscu.qa.jgiven.webdriver
Class ApplicationPerClassWebSessionTest<C extends WebDriverConfiguration,GIVEN extends WebDriverFixtures<?>,WHEN extends WebDriverActions<?>,THEN extends WebDriverVerifications<?>>
- java.lang.Object
-
- com.tngtech.jgiven.base.ScenarioTestBase<GIVEN,WHEN,THEN>
-
- dev.aherscu.qa.jgiven.commons.utils.ScenarioTestEx<GIVEN,WHEN,THEN>
-
- dev.aherscu.qa.jgiven.commons.model.TypedScenarioTest<T,GIVEN,WHEN,THEN>
-
- dev.aherscu.qa.jgiven.commons.utils.ConfigurableScenarioTest<C,WebDriverScenarioType,GIVEN,WHEN,THEN>
-
- dev.aherscu.qa.jgiven.webdriver.ApplicationUnmanagedSessionTest<C,GIVEN,WHEN,THEN>
-
- dev.aherscu.qa.jgiven.webdriver.ApplicationPerMethodWebSessionTest<C,GIVEN,WHEN,THEN>
-
- dev.aherscu.qa.jgiven.webdriver.ApplicationPerClassWebSessionTest<C,GIVEN,WHEN,THEN>
-
- Type Parameters:
C
- type of WebDriverConfigurationGIVEN
- type of fixturesWHEN
- type of actionsTHEN
- type of verification
public abstract class ApplicationPerClassWebSessionTest<C extends WebDriverConfiguration,GIVEN extends WebDriverFixtures<?>,WHEN extends WebDriverActions<?>,THEN extends WebDriverVerifications<?>> extends ApplicationPerMethodWebSessionTest<C,GIVEN,WHEN,THEN>
Manages the application lifecycle (WebDriver) to span the entire testcase. This requires all test methods to run on same thread.IMPORTANT: running all test methods on same WebDriver instance means holding a long session, hence more susceptible to emulator/application crashes or network drops. We provide here the means to recover from such failures via
continuing_section(Runnable)
- Author:
- Adrian Herscu
-
-
Field Summary
-
Fields inherited from class dev.aherscu.qa.jgiven.webdriver.ApplicationPerMethodWebSessionTest
webDriver
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
ApplicationPerClassWebSessionTest(Class<C> configurationType)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
afterClassQuitWebDriver()
Closes the managed WebDriver after all test methods finished.protected void
afterMethodQuitWebDriver()
Disables per method WebDriver management.protected void
beforeClassOpenWebDriver()
Opens the managed WebDriver before any test method begins running.protected void
beforeMethodOpenWebDriver()
Disables per method WebDriver management.protected void
continuing_section()
Continues on same device session without recovery.protected void
continuing_section(Runnable recoveryProcedure)
Continues on same device with specified recovery procedure.-
Methods inherited from class dev.aherscu.qa.jgiven.webdriver.ApplicationPerMethodWebSessionTest
starting_section
-
Methods inherited from class dev.aherscu.qa.jgiven.webdriver.ApplicationUnmanagedSessionTest
starting_section, starting_section
-
Methods inherited from class dev.aherscu.qa.jgiven.commons.utils.ConfigurableScenarioTest
afterMethodKeepJenkinsAlive, beforeClassInitializeSession, beforeMethodInitializeSession, configuration, generateRandomId, randomId
-
-
-
-
Method Detail
-
afterClassQuitWebDriver
@AfterClass(alwaysRun=true) protected void afterClassQuitWebDriver()
Closes the managed WebDriver after all test methods finished.
-
afterMethodQuitWebDriver
protected final void afterMethodQuitWebDriver()
Disables per method WebDriver management.- Overrides:
afterMethodQuitWebDriver
in classApplicationPerMethodWebSessionTest<C extends WebDriverConfiguration,GIVEN extends WebDriverFixtures<?>,WHEN extends WebDriverActions<?>,THEN extends WebDriverVerifications<?>>
- See Also:
beforeMethodOpenWebDriver()
-
beforeMethodOpenWebDriver
protected final void beforeMethodOpenWebDriver()
Disables per method WebDriver management.- Overrides:
beforeMethodOpenWebDriver
in classApplicationPerMethodWebSessionTest<C extends WebDriverConfiguration,GIVEN extends WebDriverFixtures<?>,WHEN extends WebDriverActions<?>,THEN extends WebDriverVerifications<?>>
- See Also:
afterMethodQuitWebDriver()
-
beforeClassOpenWebDriver
@BeforeClass protected void beforeClassOpenWebDriver()
Opens the managed WebDriver before any test method begins running.
-
continuing_section
protected void continuing_section()
Continues on same device session without recovery.- See Also:
continuing_section(Runnable)
-
continuing_section
protected void continuing_section(Runnable recoveryProcedure)
Continues on same device with specified recovery procedure.- Parameters:
recoveryProcedure
- recovery procedure to run in case of Selenium server failure
-
-