Skip to main content
AI agents are now live in Website Scanner! Enter your URL and fix website issues 3x faster with AI. Explore now!
No Result Found
Connect & Get help from fellow developers on our Discord community. Ask the CommunityAsk the Community

Integrating Tricentis Tosca with Percy

Learn how to integrate Tricentis Tosca with Percy to run visual tests.

Percy now works directly with Tricentis Tosca, allowing you to add visual testing to your existing Tosca test cases without creating or maintaining separate test suites.

This integration currently supports Percy Web through the Percy Snapshot Special Execution Task, which lets you capture visual snapshots as part of your Tosca workflow.

Percy-Tosca integration workflow

The following diagram illustrates how Percy integrates with Tosca to capture and process visual snapshots during test execution.

Screenshot displaying Percy TOSCA integration workflow

Getting started

Percy’s Tosca integration is a DLL extension that allows users to call PercySnapshot method. Before you begin, ensure you have the following:

Tosca supports Windows environments only.

Steps

Follow these steps to set up Percy Tosca integration:

Step 1: Install or update the @percy/cli development dependency using the following command:

npm install --save-dev @percy/cli

Step 2: Sign in to Percy and create a new Percy project. After the project is created, Percy generates a unique project token. Use this token and run the following commands to set the token and start the Percy CLI:

set PERCY_TOKEN=<YOUR PERCY PROJECT TOKEN>
percy exec:start

Step 3: Download the appropriate PercyTosca dll file, use this PercyTosca dll for Tosca v16 and this PercyTosca dll for Tosca v23 and above. Copy it to the following location:

C:\Program Files (x86)\TRICENTIS\Tosca Testsuite\Percy

Step 4: In Tosca Commander, navigate to:

Project settings → TBox → Extension loading → Extensions Folders

Add the previously copied path to the Extensions list.

Screenshot showing the Extensions field location in Tosca Commander project settings

Step 5: Create a new module in Tosca Commander and configure it by manually entering the following parameters:

  • Engine → Percy
  • SpecialExecutionTask → PercySnapshot

Screenshot showing Percy added in the Engine field and PercySnapshot added in SpecialExecutionTask in the newly created module

Step 6: Define the parameters for the PercySnapshot module. The SnapshotName parameter is required. All other parameters are optional. For each parameter you add, enter Parameter as the key and True as the value.

The PercySnapshot method supports the following parameters:

Parameter Description Example
SnapshotName (String) (Required) Unique name for the snapshot. Snapshot 1
Caption (String) Title of the webpage for the snapshot. (Default: “*”) *
Widths (Integer) Comma-separated values to take screenshots at. 375,1280
MinHeight (Integer) Minimum viewport height for screenshots. 1024
EnableJavaScript (Boolean) Enable JavaScript in Percy’s rendering environment. False
PercyCSS (String) Percy-specific CSS applied only in Percy’s rendering environment. For more information, check Percy specific CSS iframe { display: none; }
Scope (String) CSS selector to scope the screenshot to a specific area. .selector

Screenshot displaying the PercySnapshot method configured in Tosca Commander module settings

Step 7: Import the module into your Tosca test cases. After import, the module displays in Tosca as shown in this example.

Screenshot showing the Percy module successfully imported into the Tosca project

Step 8: Restart Tosca Commander and run your tests.

Screenshot showing a Percy visual test successfully executed within a Tosca project

Step 9: A build link will appear in the CLI output. Click the link to view your Percy snapshots.

Screenshot showing a Percy build link

When you run another build with visual changes to your application, Percy takes new snapshots. You can then see the comparisons between the two runs on the new build.

Screenshot showing a Percy visual test successfully executed on Percy dashboard

Step 10: Stop the Percy CLI using the following command:

percy exec:stop

Once set up, Tosca test cases that include the Percy Snapshot module will automatically capture and upload visual snapshots to Percy, allowing you to review visual changes alongside your functional tests in the Percy dashboard.

We're sorry to hear that. Please share your feedback so we can do better

Contact our Support team for immediate help while we work on improving our docs.

We're continuously improving our docs. We'd love to know what you liked





Thank you for your valuable feedback

Is this page helping you?

Yes
No

We're sorry to hear that. Please share your feedback so we can do better

Contact our Support team for immediate help while we work on improving our docs.

We're continuously improving our docs. We'd love to know what you liked





Thank you for your valuable feedback!

Talk to an Expert
Download Copy Check Circle