-
Notifications
You must be signed in to change notification settings - Fork 5
takeScreenshot
Philipp Stracker edited this page Aug 12, 2021
·
2 revisions
takeScreenshot(imageName[, which[, element]])
Takes a screenshot of the current viewport and saves it as a PNG image in the defined path (usually tests/output
or tests/screenshots/base
)
Filename of the generated screenshot. If a file with the given name exists, it will be overwritten. The .png
extension is optional.
Optional. Define the type of the screenshot. Possible values are actual
and expected
.
Default is "actual"
Optional. Take a screenshot of a single element on the page, instead of the entire viewport.
Default is null
, which clips the entire viewport.
// Take a screenshot of the entire viewport and
// save it as output/dashboard.png.
await I.takeScreenshot("dashboard");
// Take a screenshot of the entire viewport and
// save it as screenshots/base/dashboard.png.
await I.takeScreenshot("dashboard", "expected");
// Take a screenshot of the #menu element and
// save it as output/dashboard-menu.png.
await I.takeScreenshot("dashboard-menu.png", "", "#menu");
Manual
Methods
Data Structures
Appendix
Development