Package dev.aherscu.qa.jgiven.webdriver
Class ApplicationPerMethodWebSessionTest<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>
-
- Type Parameters:
C
- type of WebDriverConfigurationGIVEN
- type of fixturesWHEN
- type of actionsTHEN
- type of verification
- Direct Known Subclasses:
ApplicationPerClassWebSessionTest
public abstract class ApplicationPerMethodWebSessionTest<C extends WebDriverConfiguration,GIVEN extends WebDriverFixtures<?>,WHEN extends WebDriverActions<?>,THEN extends WebDriverVerifications<?>> extends ApplicationUnmanagedSessionTest<C,GIVEN,WHEN,THEN>
Support for multi-threaded application tests. Manages WebDriver per test method by opening it with default provider and device types per
WebDriverConfiguration
. This enables each test method to run in its own thread.Eventually, multiple support classes may be derived from this one and override above behaviors as needed.
- Author:
- aherscu
-
-
Field Summary
Fields Modifier and Type Field Description protected ThreadLocal<dev.aherscu.qa.jgiven.commons.utils.WebDriverEx>
webDriver
WebDriver client to be managed by this scenario.
-
Constructor Summary
Constructors Modifier Constructor Description protected
ApplicationPerMethodWebSessionTest(Class<C> configurationType)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
afterMethodQuitWebDriver()
After each test method finishes, closes the managed WebDriver.protected void
beforeMethodOpenWebDriver()
Before each test method begins execution, opens the managed WebDriver usingWebDriverConfiguration
.protected void
starting_section()
Scenario starting section that uses the managed WebDriver.-
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
-
-
-
-
Field Detail
-
webDriver
protected final ThreadLocal<dev.aherscu.qa.jgiven.commons.utils.WebDriverEx> webDriver
WebDriver client to be managed by this scenario.
-
-
Method Detail
-
afterMethodQuitWebDriver
@AfterMethod(alwaysRun=true) protected void afterMethodQuitWebDriver()
After each test method finishes, closes the managed WebDriver.
-
beforeMethodOpenWebDriver
@BeforeMethod protected void beforeMethodOpenWebDriver()
Before each test method begins execution, opens the managed WebDriver usingWebDriverConfiguration
.
-
starting_section
protected final void starting_section()
Scenario starting section that uses the managed WebDriver.
-
-