@vasily.strelyaev/tcd-screenshot-updater
v0.3.0
Published
Copy updated baseline screenshots to your layout testing project
Downloads
33
Maintainers
Readme
tcd-screenshot-updater
Use this module to download and update baseline images in your local project's layout tests after you complete the review on TestCafe Dashboard.
Setup
Ask the TestCafe Dashboard team for an authentication token.
Create a
.dashboardrc.json
configuration file in your project's root directory. Specify the authentication token in thejwtToken
property. If you use a TestCafe Dashboard deployment that is nothttps://dashboard.testcafe.io
, specify its URL in thedashboardUrl
property.{ "jwtToken": "<authentication_token>", "dashboardUrl": "https://local.dashboard.mycorp.com" }
Usage
Study the test report on TestCafe Dashboard. Mark baseline screenshots that need to be updated. After you finish, copy the review ID.
Run the
tcd-update
command in the console and pass the review ID as the first parameter:tcd-update '<review-id>'
Alternatively, use the
updateLayoutScreenshots
function to update screenshots from code. ThegetOptions
function can read settings from the configuration file.import { updateLayoutScreenshots, getOptions } from 'tcd-screenshot-updater'; const { jwtToken, dashboardUrl } = await getOptions(); await updateLayoutScreenshots(dashboardUrl, jwtToken, '<review-id>');