Class: WebdriverScreenshotter
mugshot.WebdriverScreenshotter
Take screenshots from a Webdriver compatible client.
#
Implements#
Constructors#
constructor+ new WebdriverScreenshotter(client
: Webdriver, __namedParameters?
: WebdriverScreenshotterOptions): WebdriverScreenshotter
#
Parameters:Name | Type | Default value | Description |
---|---|---|---|
client | Webdriver | - | |
__namedParameters | WebdriverScreenshotterOptions | {} | WebdriverScreenshotterOptions |
Returns: WebdriverScreenshotter
Defined in: packages/mugshot/src/lib/webdriver-screenshotter.ts:46
#
Methods#
takeScreenshot▸ takeScreenshot(selectorOrOptions?
: MugshotSelector | ScreenshotOptions, options?
: ScreenshotOptions): Promise<Buffer>
Take screenshots of selectors by first taking a viewport screenshot and then cropping the element out.
The element's bounding rectangle will be used to crop it out of the viewport screenshot.
#
Parameters:Name | Type | Default value |
---|---|---|
selectorOrOptions? | MugshotSelector | ScreenshotOptions | - |
options | ScreenshotOptions | {} |
Returns: Promise<Buffer>
Implementation of: Screenshotter
Defined in: packages/mugshot/src/lib/webdriver-screenshotter.ts:70