@vasily.strelyaev/tcd-screenshot-updater
v0.3.0
Published
Copy updated baseline screenshots to your layout testing project
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.jsonconfiguration file in your project's root directory. Specify the authentication token in thejwtTokenproperty. If you use a TestCafe Dashboard deployment that is nothttps://dashboard.testcafe.io, specify its URL in thedashboardUrlproperty.{ "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-updatecommand in the console and pass the review ID as the first parameter:tcd-update '<review-id>'Alternatively, use the
updateLayoutScreenshotsfunction to update screenshots from code. ThegetOptionsfunction 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>');
