screenshotter

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 29, 2018 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package screenshotter provides a client-side API for accessing the google/screenshot Web Test Launcher endpoint.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Screenshot

type Screenshot []byte

Screenshot is a PNG-encoded screenshot.

func (Screenshot) AsImage

func (s Screenshot) AsImage() (image.Image, error)

AsImage converts s into an Image object.

type Screenshotter

type Screenshotter interface {
	// Of returns a copy of Screenshotter configured to crop the screenshot using the given WebElement.
	Of(selenium.WebElement) Screenshotter
	// Excluding returns a copy of Screenshotter configured to exclude the given WebElement by covering it with a black box.
	Excluding(selenium.WebElement) Screenshotter
	// TakeScreenshot returns the screenshot.
	TakeScreenshot() (Screenshot, error)
}

Screenshotter allows configurable screenshotting.

func New

func New(driver selenium.WebDriver) (Screenshotter, error)

New creates a new Screenshotter. It looks up the address of the WebDriver remote end in the WEB_TEST_WEBDRIVER_SERVER environment variable, and use driver to get the session id that will be used for screenshotting.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL