@vasily.strelyaev/tcd-screenshot-updater

0.3.0 • Public • Published

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

  1. Ask the TestCafe Dashboard team for an authentication token.

  2. Create a .dashboardrc.json configuration file in your project's root directory. Specify the authentication token in the jwtToken property. If you use a TestCafe Dashboard deployment that is not https://dashboard.testcafe.io, specify its URL in the dashboardUrl property.

    {
        "jwtToken": "<authentication_token>",
        "dashboardUrl": "https://local.dashboard.mycorp.com"
    }

Usage

  1. Study the test report on TestCafe Dashboard. Mark baseline screenshots that need to be updated. After you finish, copy the review ID.

  2. Run the tcd-update command in the console and pass the review ID as the first parameter:

    tcd-update '<review-id>'
  3. Alternatively, use the updateLayoutScreenshots function to update screenshots from code. The getOptions 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>');

Package Sidebar

Install

npm i @vasily.strelyaev/tcd-screenshot-updater

Weekly Downloads

4

Version

0.3.0

License

MIT

Unpacked Size

8.85 kB

Total Files

7

Last publish

Collaborators

  • vasily.strelyaev