public class SeleniumContext
extends io.inkstand.scribble.rules.ExternalResource
| Modifier and Type | Class and Description |
|---|---|
static class |
SeleniumContext.SeleniumContextBuilder
Builder for creating a Selenium test context
|
| Constructor and Description |
|---|
SeleniumContext() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
after() |
protected void |
before() |
static SeleniumContext.SeleniumContextBuilder |
builder()
Creates a new context builder for fluent setup and instantiation.
|
static Optional<SeleniumContext> |
currentContext()
Returns the current context.
|
static Optional<org.openqa.selenium.WebDriver> |
currentDriver()
Returns the currentContext driver.
|
String |
getBaseUrl()
The base URL of the application to test
|
Optional<org.openqa.selenium.WebDriver> |
getDriver()
Returns the driver of this context.
|
Duration |
getLoginTime()
Returns the duration of the login process
|
boolean |
isLoggedIn()
Indicates if a user is logged in to the application
|
void |
login(User user)
Performs the login action with the specified user
|
void |
logout()
Performs the logout action
|
static String |
resolve(String relativePath)
Resolves the URL path relative to the base URL.
|
afterClass, apply, beforeClassprotected void before()
throws Throwable
before in class io.inkstand.scribble.rules.ExternalResourceThrowableprotected void after()
after in class io.inkstand.scribble.rules.ExternalResourcepublic final void login(User user)
user - the user to loginpublic final void logout()
public boolean isLoggedIn()
public Duration getLoginTime()
public Optional<org.openqa.selenium.WebDriver> getDriver()
public String getBaseUrl()
public static Optional<SeleniumContext> currentContext()
public static String resolve(String relativePath)
relativePath - the relative path within the applicationpublic static Optional<org.openqa.selenium.WebDriver> currentDriver()
public static SeleniumContext.SeleniumContextBuilder builder()
Copyright © 2016 DevCon5 GmbH. All rights reserved.