Class: WebdriverIOAdapter
@mugshot/webdriverio.WebdriverIOAdapter
Adapter over WebdriverIO to be used with WebdriverScreenshotter.
example
#
Implements#
Constructors#
constructor+ new WebdriverIOAdapter(client
: BrowserAsync): WebdriverIOAdapter
#
Parameters:Name | Type | Description |
---|---|---|
client | BrowserAsync | The return value from remote() . |
Returns: WebdriverIOAdapter
Defined in: packages/webdriverio/src/index.ts:53
#
Methods#
execute▸ execute<R, A>(func
: (...args
: A) => R, ...args
: A): Promise<R>
Execute a function in the current page context.
#
Type parameters:Name | Type |
---|---|
R | - |
A | any[] |
#
Parameters:Name | Type |
---|---|
func | (...args : A) => R |
...args | A |
Returns: Promise<R>
Implementation of: Webdriver.execute
Defined in: packages/webdriverio/src/index.ts:107
#
getElementRect▸ getElementRect(selector
: string): Promise<null
| { height
: number ; width
: number ; x
: number ; y
: number }[] | { height
: number ; width
: number ; x
: number ; y
: number }>
Get the dimensions and coordinates of an element.
#
Parameters:Name | Type |
---|---|
selector | string |
Returns: Promise<null
| { height
: number ; width
: number ; x
: number ; y
: number }[] | { height
: number ; width
: number ; x
: number ; y
: number }>
Implementation of: Webdriver.getElementRect
Defined in: packages/webdriverio/src/index.ts:61
#
setViewportSize▸ setViewportSize(width
: number, height
: number): Promise<void>
Set the size of the viewport (meaning window minus chrome).
This is unlike setWindowRect which doesn't take the chrome into account.
#
Parameters:Name | Type |
---|---|
width | number |
height | number |
Returns: Promise<void>
Implementation of: Webdriver.setViewportSize
Defined in: packages/webdriverio/src/index.ts:88
#
takeViewportScreenshot▸ takeViewportScreenshot(): Promise<string>
Take a viewport screenshot and return a base64 string.
Returns: Promise<string>
Implementation of: Webdriver.takeViewportScreenshot
Defined in: packages/webdriverio/src/index.ts:59