public interface TestSessionListener
WARNING : the before and after are executed by the proxy on the remote, and the action taken in those method are not isolated, and can have consequences on other sessions.
If some changes are made that can impact all running tests, the before / after implementation should take care of checking that no test are currently running to avoid collateral damages
For the case when a single remote handles multiple test sessions ( typical web driver ) using before / after will impact ALL the tests on that remote.
Modifier and Type | Method and Description |
---|---|
void |
afterSession(TestSession session)
Will be run after the last command is forwarded, but before the proxy slot is released.
|
void |
beforeSession(TestSession session)
Will be run after the proxy slot is reserved for the test, but before the first command is
forwarded to the remote.
|
void beforeSession(TestSession session)
Gives a chance to do a setup on the remote before the test start.
WARNING : beforeSession should NOT throw exception. If an exception is thrown, the session is considered invalid and the resources will be freed.
session
- sessionif the setup applies to all the tests.
void afterSession(TestSession session)
If the test crashes before a session is provided by the remote, session.externalKey will be null.
WARNING : after session should NOT throw exception. If an exception is thrown, the resources will NOT be released, as it could mean the remote is now corrupted.
session
- session