Constructor
new module:WebDriverManager(browser, config)
Creates a manager.
Parameters:
Name | Type | Default | Description |
---|---|---|---|
browser |
String | chrome | Browser to use. Valid value includes |
config |
object | Manager configuration. |
- Source:
Methods
getBaseUrl() → {String}
Get base URL from manager's configuration.
- Source:
Returns:
Base URL from manager's configuration.
- Type
- String
getConfigScreenSize() → {String}
Get screen size from manager's configuration.
- Source:
Returns:
Screen size like 'desktop' or 'mobile'.
- Type
- String
getDriver() → {WebDriver}
Returns instance of WebDriver.
- Source:
Returns:
Instance of WebDriver.
- Type
- WebDriver
Example
import { WebDriverManager } from 'wp-e2e-webdriver';
const manager = new WebDriverManager( 'chrome' );
const driver = manager.getDriver();
getPageUrl(pagePath) → {String}
Get page url given a pagePath
without the hostname.
Parameters:
Name | Type | Default | Description |
---|---|---|---|
pagePath |
String | / | Page path. |
- Source:
Returns:
Full URL. Joined base URL with pagePath
.
- Type
- String
getScreenSizeAsObject(screenSize) → {object}
Get object representation of screenSize
.
Parameters:
Name | Type | Description |
---|---|---|
screenSize |
String | Screen size like 'desktop' or 'mobile'. |
- Source:
Returns:
Object representation of screen size.
- Type
- object
quitBrowser(waitForMs) → {Promise}
Quit currently running browser.
Parameters:
Name | Type | Default | Description |
---|---|---|---|
waitForMs |
Number | 0 | Wait time in millisecond before quit. |
- Source:
Returns:
A promise that will be resolved once browser quitted.
- Type
- Promise
resizeBrowser(screenSize)
Resize the browser to screenSize
.
Parameters:
Name | Type | Description |
---|---|---|
screenSize |
String | Screen size like 'desktop' or 'mobile'. |
- Source: