# Percy > Skip to main content[Explore now](https://scanner.browserstack.com?utm_source=hello+bar&utm_medium=website)[Documentation](https://www.browserstack.com/docs/)[Ask the Community](https --- # Source: https://www.browserstack.com/docs/percy/advanced-snapshots/percy-css [Skip to main content](#main-content)[Explore now](https://scanner.browserstack.com?utm_source=hello+bar&utm_medium=website)[Documentation](https://www.browserstack.com/docs/)[Ask the Community](https://www.browserstack.com/discord?ref=docsArticle&source=docs_article_page) # Percy specific CSS Learn how to apply Percy-specific CSS to ignore areas from being rendered by Percy Percy provides a powerful way to take control of rendering to do whatever you want – ignore regions, stabilize dynamic elements, etc. Percy’s way to do this is something we call “Percy-specific CSS”, which is only applied in the Percy rendering environment. You can use any CSS and it’ll only be rendered in Percy’s rendering environment. This can be very helpful for ignoring regions, hiding areas that produce false-positive visual diffs, or when you’d like more specific control over the state of UI elements like visualizations and animations. - This applies to both BrowserStack SDK and Percy SDK. - Usepercy_snapshotfunction if you’re using the Percy SDK for web projects. For Automate projects with the Percy SDK or when using the BrowserStack SDK, usepercy_screenshotfunction. `percy_snapshot``percy_screenshot`You can apply Percy specific CSS in most SDKs without editing your site or applications CSS files. This can be done by passing apercyCSSoption via the options object. For example: `percyCSS` ``` await percySnapshot('Home page', { percyCSS: `iframe { display: none; }` }); ``` `await percySnapshot('Home page', { percyCSS: `iframe { display: none; }` });` ## Percy snapshot You can also configure global Percy CSS via the.percy.ymlfile: `.percy.yml` ``` version: 1 snapshot: percy-css: | iframe { display: none; } ``` `version: 1 snapshot: percy-css: | iframe { display: none; }` ### Priority between snapshot level Percy CSS and global Percy CSS There can be the case when we want certain CSS to get applied on all snapshots and particular CSS on specific snapshot. For this in Percy user can provide both the global CSS and snapshot level CSS by providing the configurations mentioned above. In these cases we merge the Percy CSS from both the configs to be applied on the snapshot. - Snapshot Level Percy CSS:p { font-size: 2em; } `p { font-size: 2em; }`- Global Percy CSS :p { color: purple; } `p { color: purple; }`The final Percy CSS that would be applied on snapshot would look like : ``` p { color: purple; } p { font-size: 2rem; } ``` `p { color: purple; } p { font-size: 2rem; }`We give priority to snapshot level CSS over global CSS in the case where same selector is modifying same property. - Snapshot Level Percy CSS :p { background-color: yellow !important; } `p { background-color: yellow !important; }`- Global Percy CSS :p { background-color: green !important; } `p { background-color: green !important; }`The final Percy CSS that would be applied on snapshot would look like: ``` p { background-color: green !important; } p { background-color: yellow !important; } ``` `p { background-color: green !important; } p { background-color: yellow !important; }`In this case we merged Snapshot Level CSS later which leads to higher priority according to CSS Specificity Rules an hence in final rendered snapshotbackground-colorofptag would be Yellow. `background-color` ### Percy CSS does not change specificity Percy CSS is appended to the bottom of thetag to help with order, but it’s likely you will need to out-specify your applications CSS (with!importantor otherwise). ```!important`Consider an example to understand specificity rules: - Snapshot level Percy CSS:p { background-color: yellow; } `p { background-color: yellow; }`- Global Percy CSS:p { background-color: green !important; } `p { background-color: green !important; }`Now in this case although snapshot level CSS has higher priority, but due to!importantkeyword in Global CSS that would take priority over Snapshot Level CSS according to CSS specificity rules and hence in final rendered snapshot,background-colorofptag would be Green. `!important``background-color`Final merged Percy CSS would look like : ``` p { background-color: green !important; } p { background-color: yellow; } ``` `p { background-color: green !important; } p { background-color: yellow; }` ## Percy CSS @media query You can do so using the@media only percyCSS media query. CSS that is nested under this media query will only apply in Percy and will not affect your normal pages outside of Percy. `@media only percy`For example, you might have an element that renders differently each time and you want Percy to ignore that element. You can use Percy specific styles to achieve this. Let’s say you want to apply ahide-in-percyclass to elements you want hidden in Percy. Here’s how you can do that: `hide-in-percy` ``` @media only percy { .hide-in-percy { visibility: hidden; } } ``` `@media only percy { .hide-in-percy { visibility: hidden; } }`And your page would have HTML like this: ```
an element we know we want to ignore in visual tests
``` `
an element we know we want to ignore in visual tests
`The class names don’t have to be Percy specific, you can put any normal CSS selectors and rules that you want in the media query and they will only be applied when rendering in Percy. `@media only percy {...}` ### Percy CSS @media query for Storybook When usingStorybook, you can providepercyCSSalong with othercommon optionseither withstorypercy parameters or using a Percy config file. [Storybook](https://storybook.js.org/)`percyCSS`[common options](https://www.browserstack.com/docs/percy/take-percy-snapshots/overview#configuration-file)`story`In order to use the Percy CSS media query with Storybook snapshots, you need to modify the Storybook’spreview-head.htmlfile to serve static CSS overrides. This is because Percy uses a content-type-based system to apply styles to HTML and CSS files, and CSS-in-JS breaks this paradigm. See thestorybook documentationfor how to add custom head tags to your project. Here’s an example of apreview-head.htmlfile that includes a default stylesheet, and adds a.hide-in-percyclass styling: `preview-head.html`[storybook documentation](https://storybook.js.org/configurations/add-custom-head-tags/)`preview-head.html``.hide-in-percy` ``` ``` You would then add a percy-specificclassNameattribute to your component the example showclassNameas per React syntax: `className``className` ```
Bom dia
``` You can see a complete example of this technique in thispull request. [pull request](https://github.com/percy/percy-storybook/pull/42/files) #### Debugging Storybook Percy-Specific CSS It may be helpful to render your storybook project to a static build in order to debug any changes. See theStorybook documentationfor details on how to do this. Once you have generated a static version of your app, you can remove the surrounding@media only percyblock in the markup to preview your Percy-specific styles in your browser. [Storybook documentation](https://storybook.js.org/basics/exporting-storybook/)`@media only percy` ## Screenshot Issue If an animated element isn’t rendering correctly in Percy, it may be because Percy disables animations initially to maintain page stability. If the element is hidden or hasopacity: 0at the start, it might not render since the animation is blocked. To fix this, use Percy-specific CSS to make the element visible or display it in its final state. `opacity: 0`Here’s an example to illustrate this approach: ``` Fade-In Animation Example }); ``` The element starts with opacity: 0 and gradually changes to opacity: 1 during the animation. However, because Percy disables animations, this element won’t be visible in Percy. Now, apply the following percyCSS code to the animated element to make it visible (or in its final state). ``` await percySnapshot(driver, 'Fading_element', {       percyCSS: `.hidden {           opacity: 1           }`     }) ``` After applying the percyCSS code, the element will render in its final state and be visible. #### We're sorry to hear that. Please share your feedback so we can do better Contact ourSupport teamfor immediate help while we work on improving our docs. [Support team](https://www.browserstack.com/support) #### We're continuously improving our docs. We'd love to know what you liked - This page has exactly what I am looking for - This content & code samples are accurate and up-to-date - The content on this page is easy to understand - Other (please tell us more below) Thank you for your valuable feedback - ON THIS PAGE Is this page helping you? [Support team](https://www.browserstack.com/support)Thank you for your valuable feedback! [Talk to an Expert](https://www.browserstack.com/contact?ref=docs-page-floating-contact)Welcome to Percy New to Percy? [View Documentation](https://www.browserstack.com/docs/percy/get-started-without-code-or-automation-script)Select your framework and language to proceed - Selenium - Playwright - Cypress [Cypress](https://www.browserstack.com/docs/percy/cypress/get-started)- Puppeteer [Puppeteer](https://www.browserstack.com/docs/percy/puppeteer/get-started)- Ember [Ember](https://www.browserstack.com/docs/percy/ember/get-started)- Storybook [Storybook](https://www.browserstack.com/docs/percy/storybook/get-started)- Gatsby [Gatsby](https://www.browserstack.com/docs/percy/gatsby/get-started)- Jekyll [Jekyll](https://www.browserstack.com/docs/percy/jekyll/get-started)- Appium [Appium](https://www.browserstack.com/docs/percy/appium/get-started)- Tricentis Tosca [Tricentis Tosca](https://www.browserstack.com/docs/percy/tosca/get-started)- Build your own SDK [Build your own SDK](https://www.browserstack.com/docs/percy/build-your-own-SDK/get-started) --- # Source: https://www.browserstack.com/docs/percy/api-reference/authentication # Authentication The Percy API is based on theJSONAPI standard and organized around theRESTdesign. [JSON](https://jsonapi.org/)[REST](https://developer.mozilla.org/en-US/docs/Glossary/REST)Note:API base URLhttps://percy.io/api/v1 `https://percy.io/api/v1`The Percy API uses API tokens to authenticate. They are passed in asHTTPAuthorizationrequest headers. [HTTP](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization)`Authorization`Note:Authorization header formatAuthorization: Token ${PERCY_TOKEN} `Authorization: Token ${PERCY_TOKEN}`Percy currently authenticates with three project token types: | Write-only | Read-only | Full-access | | Create builds | Read builds | | | Create snapshots | Download snapshots | All project read and write functions | | SDK use | API use | | [SDK use](https://www.browserstack.com/docs/percy/integrate/overview)The tokens for a particular project can be found on its Project Settings page. #### We're sorry to hear that. Please share your feedback so we can do better Contact ourSupport teamfor immediate help while we work on improving our docs. [Support team](https://www.browserstack.com/support) #### We're continuously improving our docs. We'd love to know what you liked - This page has exactly what I am looking for - This content & code samples are accurate and up-to-date - The content on this page is easy to understand - Other (please tell us more below) Thank you for your valuable feedback --- # Source: https://www.browserstack.com/docs/percy/appium/get-started [Skip to main content](#main-content)[Explore now](https://scanner.browserstack.com?utm_source=hello+bar&utm_medium=website)[Documentation](https://www.browserstack.com/docs/)[Ask the Community](https://www.browserstack.com/discord?ref=docsArticle&source=docs_article_page) # Appium mobile browser testing Running Percy with Appium mobile browser testing is possible if you select the matching SDK for your test suite and language. Since Appium builds upon theW3C Webdriver spec, you can pick amatching percy-selenium-language SDK. For example, if you’re using theAppium Python clientyou would match that with ourpercy-selenium-python SDK. [W3C Webdriver spec](https://w3c.github.io/webdriver/)[matching percy-selenium-language SDK](https://www.browserstack.com/docs/percy/integrate/overview)[Appium Python client](https://github.com/appium/python-client)[percy-selenium-python SDK](https://www.browserstack.com/docs/percy/integrate/selenium/python)Percy supports visual testing fordesktop browsers, real-mobile browsersandnative mobile applications. Continue on this page if you want to use Percy for testing your mobile website, visithereto know more about Percy for native mobile applications. [desktop browsers, real-mobile browsers](https://docs.percy.io/docs)[native mobile applications](https://docs.percy.io/v2-app/docs/getting-started)[here](https://docs.percy.io/v2-app/docs/getting-started) | Appium SDK | Matching Percy SDK | | Ruby | percy-selenium-ruby | | Python | percy-selenium-python | | Java | percy-selenium-java | | C# (.NET) | percy-selenium-dotnet | | JavaScript (WebdriverIO) | @percy/webdriverio | [Ruby](https://github.com/appium/ruby_lib)[percy-selenium-ruby](https://www.browserstack.com/docs/percy/integrate/selenium/ruby)[Python](https://github.com/appium/python-client)[percy-selenium-python](https://www.browserstack.com/docs/percy/integrate/selenium/python)[Java](https://github.com/appium/java-client)[percy-selenium-java](https://www.browserstack.com/docs/percy/integrate/selenium/java)[C# (.NET)](https://github.com/appium/appium-dotnet-driver)[percy-selenium-dotnet](https://www.browserstack.com/docs/percy/integrate/selenium/dotnet)[WebdriverIO](https://github.com/webdriverio/webdriverio)[@percy/webdriverio](https://www.browserstack.com/docs/percy/integrate/webdriverio) #### We're sorry to hear that. Please share your feedback so we can do better Contact ourSupport teamfor immediate help while we work on improving our docs. [Support team](https://www.browserstack.com/support) #### We're continuously improving our docs. We'd love to know what you liked - This page has exactly what I am looking for - This content & code samples are accurate and up-to-date - The content on this page is easy to understand - Other (please tell us more below) Thank you for your valuable feedback - ON THIS PAGE Is this page helping you? [Support team](https://www.browserstack.com/support)Thank you for your valuable feedback! [Talk to an Expert](https://www.browserstack.com/contact?ref=docs-page-floating-contact)Welcome to Percy New to Percy? [View Documentation](https://www.browserstack.com/docs/percy/get-started-without-code-or-automation-script)Select your framework and language to proceed - Selenium - Playwright - Cypress [Cypress](https://www.browserstack.com/docs/percy/cypress/get-started)- Puppeteer [Puppeteer](https://www.browserstack.com/docs/percy/puppeteer/get-started)- Ember [Ember](https://www.browserstack.com/docs/percy/ember/get-started)- Storybook [Storybook](https://www.browserstack.com/docs/percy/storybook/get-started)- Gatsby [Gatsby](https://www.browserstack.com/docs/percy/gatsby/get-started)- Jekyll [Jekyll](https://www.browserstack.com/docs/percy/jekyll/get-started)- Appium [Appium](https://www.browserstack.com/docs/percy/appium/get-started)- Tricentis Tosca [Tricentis Tosca](https://www.browserstack.com/docs/percy/tosca/get-started)- Build your own SDK [Build your own SDK](https://www.browserstack.com/docs/percy/build-your-own-SDK/get-started) --- # Source: https://www.browserstack.com/docs/percy/baseline-management/git [Skip to main content](#main-content)[Explore now](https://scanner.browserstack.com?utm_source=hello+bar&utm_medium=website)[Documentation](https://www.browserstack.com/docs/)[Ask the Community](https://www.browserstack.com/discord?ref=docsArticle&source=docs_article_page) # Git Git baseline management strategy for your visual test workflow. The Git strategy works like Git-based branching comparisons when code changes in a branch are merged with the main or production branch. In this case, Percy relies on Git commit information to find the right base build. The base build for a particular build in Git-based branching comparisons in Percy is the build forked from that branch. The following diagram shows how the base build is selected with this strategy: Git Strategy Example: Developers handle releases using a full CI/CD setup. Developer A works on a new feature in a dedicated branch. They create 10 builds during development and compare changes against the current production version using theGitstrategy. Once development is finished, they initiate a PR to merge into the main branch. CI/CD conducts functional and visual checks. If successful, changes deploy to production. ## How are the base builds selected with Git? The following describes how your base builds are selected with the Git strategy: When you push changes to your codebase and have Percy generate screenshots, Percy groups the screenshots in snapshots, and snapshots into a build. New screenshots are compared to baseline screenshots from a previous build. This previous build is also known as the base build. Percy uses a variety of strategies to determine the optimal base build for comparison on every build you create. The particular strategy used depends on several factors, including any installedSCM integrations, the default branch of the project, and which commits have previously finished builds. [SCM integrations](https://www.browserstack.com/docs/percy/ci-cd/overview)Percy takes a lot of care in automatically selecting the best base build to give you clean, accurate diffs. The chart below demonstrates a simplified view of Percy’s base build selection logic. Click the thumbnail below to view the full-size diagram. (a) Is the build attached to a pull request?(c) Is there a merge base commit present, and a Percy build for the merge base commit?If your project has an active source control management integration, like GitHub or GitLab, then Percy will always try to compare builds created in conjunction with pull (or merge) requests to the base branch for the pull request. This ensures that only the changes relevant to the pull request are visible in the Percy diff. If there have been changes on the base branch (e.g.,master) since the pull request was opened, the visual diff will not reflect those changes. `master`(b) Has Percy attempted to find a build on the “master” branch?(d) Is there any previous Percy build on this branch?Percy’s fallback behavior, when no merge base commit build is present, is to compare a build to the latest build on the default base branch. This is the “master” branch by default, but you can override it when creating new builds (see “Overriding the default base branch”). If there are no builds present on the default base branch, then Percy will fall back to using any previous build on the same branch as the build’s commit. (e) Has Percy tried every branch strategy?If Percy has exhausted all the prior options and has not found a viable candidate for the base build, then no base build will be chosen, and all snapshots will be treated as new. This generally only happens on the first build for a new project, but can also occur when the default base branch is misconfigured (see “Overriding the default base branch” above). ### The common cases In almost all cases, Percy’s defaults ‘just work,’ but if you are looking to select only the ‘latest approved build/snapshot’ as the base build for comparisons, then utilize theApproval Required Branchesfeature from project settings, which is designed to work for the use cases where builds are getting created from a single branch. This section explains the three common types of Percy builds, and the common base build selection for them. The description below assumes you’re using Percy from a CI service we support and have our source code repository integration in place. #### Pull request builds The most common use case for Percy is visual reviews associated with pull requests. To select the base build, Percy will first determine the target branch of the pull request (often master). It will then determine the common ancestor commit (the merge base) between the source branch and target branch. Once it has that target branch and common ancestor commit, it will choose the Percy build associated with them as the base build. This provides you with the best visual review, showing only the changes introduced by this pull request, avoiding any other changes that may have occurred on the target branch in the interim. #### Feature branch builds Feature branch builds are similar to pull request builds, with the exception that they don’t have a pull request specifying the target branch. In this case, the ‘master’ branch is picked as the target branch. The target commit and the base build are subsequently determined in the same way as the pull request builds described above. If you typically merge into a ‘development’ branch rather than the ‘master’ branch, you may want to setPERCY_TARGET_BRANCHto ‘development’ in your environment variables, to specify development as the default base branch. `PERCY_TARGET_BRANCH` #### Master branch builds Percy uses the most recent finished build on the master branch as the base build for new master branch builds. We encourage you to run Percy builds for every commit on the master branch, as these provide the baseline builds for the pull request and feature builds described above. ## Approval workflow During project creation, selecting the baseline management strategy is essential for identifying the appropriate base snapshot for comparison. After completing this step, it is necessary to familiarize yourself with Percy’s approval workflow options. The Percy approval workflow is integral to the visual review process. Understand the different approval types and the complexities of how base build selection collaborates with various approval workflow options. A solid understanding of these interrelated processes is essential for effectively overseeing your projects and builds. You cannot undo a snapshot approval. For more information, seeApproval workflow. [Approval workflow](https://www.browserstack.com/docs/percy/build-results/approval) ### Default base branch When Percy generates screenshots, it organizes the screenshots into snapshots, and the snapshots into a build. Subsequently, new screenshots undergo comparison with baseline screenshots from a prior build. By default, Percy uses “master” as the default base branch. You can configure a branch to serve as the default base for comparisons. If your Git project’s main branch has a different name, it’s important to update your Percy settings to match. This ensures smooth integration and accurate visual reviews. Configuring the default base branch ensures that all subsequent branches derive their baseline for comparisons from the specified default base branch. If the default branch is not set as ‘master’ and no branch is specified, Percy comparisons are not possible in that scenario. ### Setting the projects default base branch If git projects default branch is different frommaster, you will want to update your projects settings to mirror that. By default, usesmasteras the default branch, but it’s not uncommon for teams to use a branch likedevelopas the main development branch. `master``master``develop`To update this setting, you will need to go to your projects settings page. Once you’re on the settings page, look for a “Default base branch” heading under “Project Details”and update the “Default base branch” input. ### Overriding the default base branch Sometimes you will want to override the default baseline for certain builds. To do this, you will need to set aPERCY_TARGET_BRANCHenvironment variable. The value ofPERCY_TARGET_BRANCHwill be the branch that has a build which you want to use as a baseline. `PERCY_TARGET_BRANCH``PERCY_TARGET_BRANCH`For example, if you want to compare your current checked out branch to thestagingbranch, you would set toPERCY_TARGET_BRANCH=staging. That will use the last build onstagingas the baseline to generate comparisons. `staging``PERCY_TARGET_BRANCH=staging``staging`Note that if you have an SCM integration,PERCY_TARGET_BRANCHwill only be used for builds NOT associated with a pull request. A pull request’s target branch will take priority over the branch specified byPERCY_TARGET_BRANCH. To override a base build set with a PR, you will also need to setPERCY_TARGET_COMMITto a specific commit SHA. `PERCY_TARGET_BRANCH``PERCY_TARGET_BRANCH``PERCY_TARGET_COMMIT` ### Overriding the default base commit If you want to specify a specific commit to be used to selecting the base build, you can set thePERCY_TARGET_COMMITenvironment variable to the full commit SHA. This will only work if there is a finished build for that commit. `PERCY_TARGET_COMMIT` ### Auto-approve branches Auto-approve branches in Percy refer to a feature that enables builds generated on specific branches in a version control system to skip manual approval and automatically pass visual reviews in Percy. When you designate a branch for auto approval, builds on these branches automatically become “auto-approved” regardless of changes detected. This eliminates manual intervention, resulting in fewer false positives and saving time. Note: - By default commits on “master” branch are marked as auto-approve branch. - This project setting enables teams to filter and auto-approve specific branches viaregex. [regex](https://www.browserstack.com/docs/percy/base-selection/branch-selection)- If there are any missing snapshots in the build, we still auto-approve the build. - If there are fewer than 10% failed snapshots in the build, it is auto-approved. If there are more than 10% failed snapshots, the build is marked as failed. If you prefer not to auto-approve,contact usto enable the validation flag for you. [contact us](https://www.browserstack.com/contact?ref=docs) ### Approval required branches Approval required branches typically refer to branches where changes must be approved before they can be merged into another branch. Configuring the “Approval required branches” option means that builds on these branches will exclusively use the most recently approved build within the specified branch as their baseline. Once this configuration is in place, Percy’s intelligent base build selection logic will be disabled on these branches. This setting should only be used in special circumstances, such as for isolated branches used by a QA team who has a test suite in a disconnected repository. You can set approved snapshots as the baseline by utilizing the “Approval required branches” setting ## Base snapshot selection Percy’s snapshot-based approval feature enables you to review and make decisions on the visual changes detected in your application. By comparing the before and after snapshots in a build, you can validate and approve individual snapshots or the build as a whole. This means you can either approve or reject changes on a granular level, evaluating each snapshot separately, or choose to approve all the snapshots in the build collectively. This flexibility gives you control over the approval process, ensuring that only the desired and intentional visual changes are accepted. This approach is particularly beneficial for branches that are dedicated to Quality Assurance (QA) activities. Such isolated branches provide a dedicated environment for QA teams to conduct their testing activities without interfering with ongoing development work. It enables them to perform thorough and comprehensive testing without the risk of impacting the main development branch. By using the snapshot-based approval feature, QA teams can meticulously review and validate visual changes introduced in a specific branch or environment. ## Set approved snapshots as baseline To set approved snapshots as the baseline for comparison: - Login to Percy & navigate to your created Percy project. - Go toProject Settings»Advanced Options»Approval required branches. - In the Approval required branches field, specify the name of your testing branch. If you work with multiple branches, specify multiple branches with space and use a “*” as a wildcard match. These branches are subject to a formal approval process before changes can become baseline for future builds. Note:When you designate a branch (let’s sayqa-branch) as the approval required branch in your workflow, ensure not to set the same branch in the Auto Approval branch field. ### Check more details about how do build and snapshot approvals work The following workflow outlines Percy’s systematic approach to reviewing and approving changes, encompassing both the evaluation of the entire set of snapshots at the overall build level, the individual approval of each snapshot, and the decision-making process for new and missing snapshots. ### Build approval workflow Percy offers two approaches to capture and compare visual snapshots: Normal builds and partial builds. A normal build involves rendering and capturing the entire application or page as a visual snapshot, encompassing all elements and components present in the interface, whereas a partial build focuses on rendering and capturing specific elements or components of the application’s interface as visual snapshots. Based on the build type, Percy follows the below workflow: - Normal Build: If a normal build is approved, it becomes the base build for subsequent builds. However, if it is not approved, it cannot serve as the base build but any approved snapshots within the build can still become the base snapshots for future builds. - Partial Build: If a partial build is detected, it cannot be designated as the base build. However, approved snapshots from the partial build can still be considered as base snapshots. Note that in the case of partial builds, missing snapshots will not trigger notifications. For more information, seePartial builds. [Partial builds](https://www.browserstack.com/docs/percy/baseline-management/partial-builds) ### Snapshot approval workflow For Snapshot approval, Percy checks if the approved version of each snapshot is available on the same branch. If it is, Percy compares the snapshots to see if there are any differences. If yes, the user is asked to review the snapshot and decide whether to approve or request changes. If there are no differences, the snapshots are automatically approved. On the other hand, if the approved version of a snapshot is not present on the branch, Percy treats the snapshot in the current build as a new snapshot and notifies the same. ### Snapshot is missing in the build If a snapshot is not found in the current build, Percy verifies whether the snapshot exists in the base build. If it is present in the base build, Percy notifies the user that the snapshot is missing. However, if the snapshot is not found in the base build, the workflow comes to an end. ## Working with approval required branches - An example - Let’s consider a scenario where a user has generated the first build, called Build 1, which has been approved.Build 1 consists of three snapshots, namely A, B, and C.Since the build is in an approved state, all the snapshots within this build are also considered approved. - Build 1 consists of three snapshots, namely A, B, and C. - Since the build is in an approved state, all the snapshots within this build are also considered approved. - Now, the user proceeds to generate the second build, known as Build 2. Build 2 includes snapshots A, B, and D.At this point, Percy will perform a snapshot-level comparison between snapshots A and B from Build 1, as these snapshots were approved in the previous build.Also, during the comparison, Percy will notify that snapshot C is missing in Build 2, and it will recognize snapshot D as a new snapshot in this build.There are two possible outcomes of this comparison. First, if snapshot D is approved and there are no differences found between snapshots A and B, then Build 2 is considered approved. On the other hand, if snapshot D is either approved or unapproved and there are differences detected between snapshots A and B, then Build 2 is not approved and cannot serve as the baseline. - At this point, Percy will perform a snapshot-level comparison between snapshots A and B from Build 1, as these snapshots were approved in the previous build. - Also, during the comparison, Percy will notify that snapshot C is missing in Build 2, and it will recognize snapshot D as a new snapshot in this build. - There are two possible outcomes of this comparison. First, if snapshot D is approved and there are no differences found between snapshots A and B, then Build 2 is considered approved. On the other hand, if snapshot D is either approved or unapproved and there are differences detected between snapshots A and B, then Build 2 is not approved and cannot serve as the baseline. - Let’s break down the scenario where a user introduces a third build, Build 3, with snapshots A, C, and D. The next comparison depends on whether Build 2 is approved or not.If Build 2 is not approved, then snapshots A and C are compared with the snapshots from Build 1.In this case, snapshot B from Build 1 will be notified as missing, and if snapshot D was approved in Build 2, it will be compared; otherwise, it will be notified as new snapshot. - If Build 2 is not approved, then snapshots A and C are compared with the snapshots from Build 1. - In this case, snapshot B from Build 1 will be notified as missing, and if snapshot D was approved in Build 2, it will be compared; otherwise, it will be notified as new snapshot. - Moving forward, the user introduces Build 4, which is marked as a partial build, containing only snapshot A.In this case, Build 4 won’t complain for missing snapshot, and if this build is approved than only that snapshot A will be approved. However, now Build 4 cannot become a base build. - In this case, Build 4 won’t complain for missing snapshot, and if this build is approved than only that snapshot A will be approved. However, now Build 4 cannot become a base build. - Next, the user generates Build 5, with snapshots A, B, C and D and all snapshots in this build are approved, hence Build 5 now becomes the base build. The process of comparison continues in a similar manner for further builds. ### Identifying Whether a Snapshot is Not Derived from the Base Build Check the below example of Percy’s build, where in the left panel, Build 22 is specified as the baseline build, but during the comparison, it takes the base snapshot from Build 28. This means that this particular snapshot present in Build 28 is being used as the baseline for comparison instead of the snapshot from base Build 22. Note:This approved snapshot when considered from Build 28 indicates either it was approved in Build 28 or it has no changes since the last approved build until Build 28. #### We're sorry to hear that. Please share your feedback so we can do better Contact ourSupport teamfor immediate help while we work on improving our docs. [Support team](https://www.browserstack.com/support) #### We're continuously improving our docs. We'd love to know what you liked - This page has exactly what I am looking for - This content & code samples are accurate and up-to-date - The content on this page is easy to understand - Other (please tell us more below) Thank you for your valuable feedback - ON THIS PAGE [Join 10k+ QA leaders & scale testing with 20+ AI agentsRegister now](https://www.browserstack.com/events/qa-leadership-summit-winter-2025?ref=guide-page&utm_source=docs&utm_medium=website&utm_platform=&utm_content=guide&utm_campaign=QALS-winter-november-2025&utm_campaigncode=701OW00000WdkF3YAJ&utm_term=docs-banner)Join 10k+ QA leaders & scale testing with 20+ AI agents Is this page helping you? [Support team](https://www.browserstack.com/support)Thank you for your valuable feedback! [Talk to an Expert](https://www.browserstack.com/contact?ref=docs-page-floating-contact)Welcome to Percy New to Percy? [View Documentation](https://www.browserstack.com/docs/percy/get-started-without-code-or-automation-script)Select your framework and language to proceed - Selenium - Playwright - Cypress [Cypress](https://www.browserstack.com/docs/percy/cypress/get-started)- Puppeteer [Puppeteer](https://www.browserstack.com/docs/percy/puppeteer/get-started)- Ember [Ember](https://www.browserstack.com/docs/percy/ember/get-started)- Storybook [Storybook](https://www.browserstack.com/docs/percy/storybook/get-started)- Gatsby [Gatsby](https://www.browserstack.com/docs/percy/gatsby/get-started)- Jekyll [Jekyll](https://www.browserstack.com/docs/percy/jekyll/get-started)- Appium [Appium](https://www.browserstack.com/docs/percy/appium/get-started)- Tricentis Tosca [Tricentis Tosca](https://www.browserstack.com/docs/percy/tosca/get-started)- Build your own SDK [Build your own SDK](https://www.browserstack.com/docs/percy/build-your-own-SDK/get-started) --- # Source: https://www.browserstack.com/docs/percy/build-results/approval [Skip to main content](#main-content)[Explore now](https://scanner.browserstack.com?utm_source=hello+bar&utm_medium=website)[Documentation](https://www.browserstack.com/docs/)[Ask the Community](https://www.browserstack.com/discord?ref=docsArticle&source=docs_article_page) # Approval workflow Approve visual differences identified by Percy Percy approval workflow is an important part of the visual review process. By following this guide, you can understand the different approval types and the request change feature provided by Percy, the concept of auto-approved branches, and how Percy effectively handles the approval workflow. ## Approval types Percy provides you granular control over the approval process. You can manage approvals in different ways: - Approve build - Approve groups of matching visual changes - Approve individual snapshots - You can only approve snapshots, and not individual screenshots. This means that you can approve snapshots, which has screenshots captured across all browsers and width combination. However, it is not possible to approve individual screenshots taken on a specific browser for a specific width. You canrequest changesif a snapshot is not yet ready for approval. By doing this, the build status will be changed to “Changes requested.” [request changes](https://www.browserstack.com/docs/percy/build-results/change-request)Note:Once all snapshots in a build are approved, the whole build will be approved. If you have a source code integration installed, only marking a complete build as approved will mark your Percy check as “passed.” ## How approvals are carried forward Approved snapshots that were previously accepted will retain their approval status across builds throughout the lifespan of the branch. Essentially, identical snapshots will only require approval once per branch, as they are “carried forward.” For further information, refer tobase build selectionlogic. [base build selection](https://www.browserstack.com/docs/percy/base-selection/base-build)Note: This is only applicable for multi-branch or Git style workflow. If you are working on approval required branches workflow, you can refer to ourBase snapshots selection. [Base snapshots selection](https://www.browserstack.com/docs/percy/base-selection/base-snapshot) ## An example ### Scenario 1: Snapshot exists in the main branch Percy always compares first with the main branch, if there are differences, then it will check if the same differences were approved in the immediate previous build in same branch. - Let’s consider a scenario in which you have a snapshot A in the main branch. The snapshot has a button which is blue in color. - Create a feature branch (F1) from the main branch. - Create Build 1 in F1. In this build, the color of button in snapshot A is changed from blue to green. In this case the build gets compared with the base build in the main branch and you approve the changes in Build.Pre state - 1 Changed, 1 Unreviewed, and 0: Approved.Post state - 1 Changed, 0 Unreviewed, and 1: Approved. - Pre state - 1 Changed, 1 Unreviewed, and 0: Approved. - Post state - 1 Changed, 0 Unreviewed, and 1: Approved. - Next, create another build Build 2, in F1 . The snapshot in Build 2 remains exactly the same as the one in Build 1. In this case, the approval from Build 1 is carried forward to Build 2.Pre state - 1 Changed, 0 Unreviewed, and 1: Approved.Post state - 1 Changed, 0 Unreviewed, and 1: Approved. - Pre state - 1 Changed, 0 Unreviewed, and 1: Approved. - Now, let’s say you create another build, Build 3 in which the button color changes from green to red. This snapshot has a change that is not approved in Build 2 in F1 and in the base build in the main branch. In this case, the approval is not carried forward. - Now, a user requests changes in Build 3 to change the color red.Pre state - 1 Changed, 1 Unreviewed, and 0: Approved.Post state - 1 Changed, 1 Changed Requested, and 1: Approved. - Post state - 1 Changed, 1 Changed Requested, and 1: Approved. - In the next build Build 4, the user changes the color from red to green, so the new Build 4 is submitted for review again. In this case also, the approval is not carried forward.Pre state - 1 Changed, 1 Unreviewed, and 0: Approved.Post state - 1 Changed, 0 Changed Requested, and 1: Approved. - Post state - 1 Changed, 0 Changed Requested, and 1: Approved. ### Scenario 2: Snapshot does not exist in the main branch - Let’s consider a snapshot B which is not present in the base build in the main branch, you create a new feature branch (F2) and add a new feature on this branch in Build 1. - This snapshot will be identified as a new snapshot in Build 1 and it will never be compared with main branch as the snapshot does not exist in the main branch. - This new snapshot has a green color button and you have approved this snapshot.Pre state - 1 Changed, 1 Unreviewed, and 0: Approved.Post state - 1 Changed, 0 Unreviewed, and 1: Approved. - You create another build in the feature branch Build 2. The snapshot in Build 2 remains exactly the same as the one in Build 1. In this case, the approval from Build 1 is carried forward to Build 2.Pre state - 1 Changed, 0 Unreviewed, and 1: Approved.Post state - 1 Changed, 0 Unreviewed, and 1: Approved. - Now, let’s say you create another build, Build 3 in which the button color changes from green to red. This snapshot has a change that is not approved in Build 2 in F2. In this case, the approval is not carried forward. - Now, a user requests changes in Build 3 to change the color.Pre state - 1 Changed, 1 Unreviewed, and 0: Approved.Post state - 1 Changed, 1 Changed Requested, and 1: Approved. #### We're sorry to hear that. Please share your feedback so we can do better Contact ourSupport teamfor immediate help while we work on improving our docs. [Support team](https://www.browserstack.com/support) #### We're continuously improving our docs. We'd love to know what you liked - This page has exactly what I am looking for - This content & code samples are accurate and up-to-date - The content on this page is easy to understand - Other (please tell us more below) Thank you for your valuable feedback - ON THIS PAGE Is this page helping you? [Support team](https://www.browserstack.com/support)Thank you for your valuable feedback! [Talk to an Expert](https://www.browserstack.com/contact?ref=docs-page-floating-contact)Welcome to Percy New to Percy? [View Documentation](https://www.browserstack.com/docs/percy/get-started-without-code-or-automation-script)Select your framework and language to proceed - Selenium - Playwright - Cypress [Cypress](https://www.browserstack.com/docs/percy/cypress/get-started)- Puppeteer [Puppeteer](https://www.browserstack.com/docs/percy/puppeteer/get-started)- Ember [Ember](https://www.browserstack.com/docs/percy/ember/get-started)- Storybook [Storybook](https://www.browserstack.com/docs/percy/storybook/get-started)- Gatsby [Gatsby](https://www.browserstack.com/docs/percy/gatsby/get-started)- Jekyll [Jekyll](https://www.browserstack.com/docs/percy/jekyll/get-started)- Appium [Appium](https://www.browserstack.com/docs/percy/appium/get-started)- Tricentis Tosca [Tricentis Tosca](https://www.browserstack.com/docs/percy/tosca/get-started)- Build your own SDK [Build your own SDK](https://www.browserstack.com/docs/percy/build-your-own-SDK/get-started) --- # Source: https://www.browserstack.com/docs/percy/build-results/build-lifecycle [Skip to main content](#main-content)[Explore now](https://scanner.browserstack.com?utm_source=hello+bar&utm_medium=website)[Documentation](https://www.browserstack.com/docs/)[Ask the Community](https://www.browserstack.com/discord?ref=docsArticle&source=docs_article_page) # Build lifecycle Explore the actions you can perform on builds and snapshots. This page explains the actions you can perform on builds and snapshots, including creating, reviewing, approving, or discarding changes, enabling you to effectively manage builds and streamline your visual testing workflow. ## Build actions You can perform the following actions on an approved build if the build is approved and at least one snapshot is marked as approved. - Unapprove build– Revert the approval status of the build. This option is available when at least one snapshot is approved. - Reject build– Mark the build as rejected to prevent it from becoming the base build for future builds. - Delete build– Permanently remove the build and its associated snapshots. ## Snapshot actions You can approve and unapprove snapshots: - Approve snapshot– Confirm the changes in the snapshot. - Unapprove snapshot– Revert the approval, marking the snapshot as unreviewed. Unapproving the build automatically unapproves all the snapshots within that build. For detailed information about the approval process, including how to review, approve, and manage snapshots, visit thePercy Approval workflow page. [Percy Approval workflow page](https://www.browserstack.com/docs/percy/build-results/approval) ### Additional actions for Visual Git For Visual Git, you have the following additional options: - Merge: Merge the changes from the current build into the baseline. - Unmerge– Undo the merge action, setting the previous merged build as the baseline. - Unmerge and unapprove build– Unmerge the build and change its status to unapproved. - Unmerge snapshot– Undo the merge action, setting the previous merged snapshot as the baseline. - Unmerging sets the previously merged snapshot as the baseline. - If you approve the build and want to unapprove a snapshot, a confirmation modal appears. For detailed information on managing baselines and performing actions with Git and Visual Git, refer to the following pages: - Git baseline management [Git baseline management](https://www.browserstack.com/docs/percy/baseline-management/git)- Visual Git Baseline Management [Visual Git Baseline Management](https://www.browserstack.com/docs/percy/baseline-management/visual-git) ## Build receiving State You can perform the following actions when receiving a build: - Finalize to review– Mark the build as ready for review, making snapshots available for approval. - Fail build– Mark the build as failed, indicating that it did not pass the required checks. ## History panel Click the history icon to view the snapshot history. You can filter snapshots by date and the following states: - All– Display all snapshots within the build. - Approved– Show snapshots that you approved. - Merged– Display snapshots that you merged into the baseline. - Unreviewed– List snapshots awaiting approval. - Changes requested– Show snapshots with requested changes. - Failed– Display snapshots that failed checks. - Auto-approved– Show snapshots automatically approved based on predefined rules. - Rejected– Display snapshots you marked as rejected. In summary, managing your builds and snapshots helps you maintain accurate visual test baselines. Use the available actions and explore Git and Visual Git features to streamline your workflow. #### We're sorry to hear that. Please share your feedback so we can do better Contact ourSupport teamfor immediate help while we work on improving our docs. [Support team](https://www.browserstack.com/support) #### We're continuously improving our docs. We'd love to know what you liked - This page has exactly what I am looking for - This content & code samples are accurate and up-to-date - The content on this page is easy to understand - Other (please tell us more below) Thank you for your valuable feedback - ON THIS PAGE Is this page helping you? [Support team](https://www.browserstack.com/support)Thank you for your valuable feedback! [Talk to an Expert](https://www.browserstack.com/contact?ref=docs-page-floating-contact)Welcome to Percy New to Percy? [View Documentation](https://www.browserstack.com/docs/percy/get-started-without-code-or-automation-script)Select your framework and language to proceed - Selenium - Playwright - Cypress [Cypress](https://www.browserstack.com/docs/percy/cypress/get-started)- Puppeteer [Puppeteer](https://www.browserstack.com/docs/percy/puppeteer/get-started)- Ember [Ember](https://www.browserstack.com/docs/percy/ember/get-started)- Storybook [Storybook](https://www.browserstack.com/docs/percy/storybook/get-started)- Gatsby [Gatsby](https://www.browserstack.com/docs/percy/gatsby/get-started)- Jekyll [Jekyll](https://www.browserstack.com/docs/percy/jekyll/get-started)- Appium [Appium](https://www.browserstack.com/docs/percy/appium/get-started)- Tricentis Tosca [Tricentis Tosca](https://www.browserstack.com/docs/percy/tosca/get-started)- Build your own SDK [Build your own SDK](https://www.browserstack.com/docs/percy/build-your-own-SDK/get-started) --- # Source: https://www.browserstack.com/docs/percy/build-results/comments [Skip to main content](#main-content)[Explore now](https://scanner.browserstack.com?utm_source=hello+bar&utm_medium=website)[Documentation](https://www.browserstack.com/docs/)[Ask the Community](https://www.browserstack.com/discord?ref=docsArticle&source=docs_article_page) # Comments and notifications Collaborate on the visual reviews with comments and notifications Percy allows faster collabotation by adding comments to the visual reviews. Leave notes for your team mates on your observations. Percy also sends email notifications when such comments are added. When commenting on snapshots, keep these considerations in mind: - You can only comment on snapshots, not individual screenshots. - Any snapshot can have comments—with or without diffs, unreviewed or approved. - A comment is automatically generated when changes are requested on a snapshot. - Snapshots can have multiple comments and comment threads. - Once a comment is added to a snapshot, it will reappear on that snapshot in all future builds on the same branch until it is “Archived.” - Comments and replies only appear in current and future builds. - Comments must be manually “Archived.” Overriding the “Changes requested” dialog to approve a build will not automatically resolve the blocking comment(s). ## Adding/replying to comments To add a comment and start a comment thread, select the icon in the snapshot header. NoteSelecting the snapshot icon in the header for matching diffs will expand the group and prompt you to comment on the first snapshot. You can @mention users in your Percy organization and use emojis in comments. Comments will show up next to snapshots by default, and snapshots with comments will be ordered before snapshots without comments. ## Closing comments You can “Archive” comments with or without changes requested. Archiving a comment on a “Changes requested” snapshot will not change the snapshot’s status. Comments and their replies will reappear in future builds until they are “Archived” and they will never be automatically closed. Overriding the “Changes requested” dialog to approve a build will not automatically resolve the blocking comment(s). ## Notifications By default, email notifications are sent when: - Someone @mentions you in a comment - Someone adds a comment to a snapshot you have an open comment on You can customize your notification preferences and change your email address in yourprofile settings. [profile settings](https://percy.io/settings/notifications) #### We're sorry to hear that. Please share your feedback so we can do better Contact ourSupport teamfor immediate help while we work on improving our docs. [Support team](https://www.browserstack.com/support) #### We're continuously improving our docs. We'd love to know what you liked - This page has exactly what I am looking for - This content & code samples are accurate and up-to-date - The content on this page is easy to understand - Other (please tell us more below) Thank you for your valuable feedback - ON THIS PAGE Is this page helping you? [Support team](https://www.browserstack.com/support)Thank you for your valuable feedback! [Talk to an Expert](https://www.browserstack.com/contact?ref=docs-page-floating-contact)Welcome to Percy New to Percy? [View Documentation](https://www.browserstack.com/docs/percy/get-started-without-code-or-automation-script)Select your framework and language to proceed - Selenium - Playwright - Cypress [Cypress](https://www.browserstack.com/docs/percy/cypress/get-started)- Puppeteer [Puppeteer](https://www.browserstack.com/docs/percy/puppeteer/get-started)- Ember [Ember](https://www.browserstack.com/docs/percy/ember/get-started)- Storybook [Storybook](https://www.browserstack.com/docs/percy/storybook/get-started)- Gatsby [Gatsby](https://www.browserstack.com/docs/percy/gatsby/get-started)- Jekyll [Jekyll](https://www.browserstack.com/docs/percy/jekyll/get-started)- Appium [Appium](https://www.browserstack.com/docs/percy/appium/get-started)- Tricentis Tosca [Tricentis Tosca](https://www.browserstack.com/docs/percy/tosca/get-started)- Build your own SDK [Build your own SDK](https://www.browserstack.com/docs/percy/build-your-own-SDK/get-started) --- # Source: https://www.browserstack.com/docs/percy/build-results/diff-highlighter [Skip to main content](#main-content)[Explore now](https://scanner.browserstack.com?utm_source=hello+bar&utm_medium=website)[Documentation](https://www.browserstack.com/docs/)[Ask the Community](https://www.browserstack.com/discord?ref=docsArticle&source=docs_article_page) # Diff highlighter Quickly identify where your visual differences appear on a page The diff highlighter is a static bar alongside a new image showing where changed areas are located. Very small changes or elements that match the diff overlay color may be difficult to spot. The highlighter can help identify where differences are at quick glance instead of having to zoom in or enable the diff overlay. ## Zoom functionality Easily zoom in and out of snapshots to inspect differences in detail while maintaining context. Use the zoom controls such as cursor magnification, zoom-in, and zoom-out buttons to adjust the view. - Click+to zoom in. - Click-to zoom out. - ClickFit widthto reset to the original size. The interface displays the zoom level, with predefined increments for precise adjustments. ## Diff Navigator Quickly navigate between detected differences using dedicated controls. Click theUI buttons or press Shift + Left/Right keyboard arrow keys to move between highlighted changes. The navigator auto-zooms on each difference, providing a focused view while keeping surrounding context visible. #### We're sorry to hear that. Please share your feedback so we can do better Contact ourSupport teamfor immediate help while we work on improving our docs. [Support team](https://www.browserstack.com/support) #### We're continuously improving our docs. We'd love to know what you liked - This page has exactly what I am looking for - This content & code samples are accurate and up-to-date - The content on this page is easy to understand - Other (please tell us more below) Thank you for your valuable feedback - ON THIS PAGE Is this page helping you? [Support team](https://www.browserstack.com/support)Thank you for your valuable feedback! [Talk to an Expert](https://www.browserstack.com/contact?ref=docs-page-floating-contact)Welcome to Percy New to Percy? [View Documentation](https://www.browserstack.com/docs/percy/get-started-without-code-or-automation-script)Select your framework and language to proceed - Selenium - Playwright - Cypress [Cypress](https://www.browserstack.com/docs/percy/cypress/get-started)- Puppeteer [Puppeteer](https://www.browserstack.com/docs/percy/puppeteer/get-started)- Ember [Ember](https://www.browserstack.com/docs/percy/ember/get-started)- Storybook [Storybook](https://www.browserstack.com/docs/percy/storybook/get-started)- Gatsby [Gatsby](https://www.browserstack.com/docs/percy/gatsby/get-started)- Jekyll [Jekyll](https://www.browserstack.com/docs/percy/jekyll/get-started)- Appium [Appium](https://www.browserstack.com/docs/percy/appium/get-started)- Tricentis Tosca [Tricentis Tosca](https://www.browserstack.com/docs/percy/tosca/get-started)- Build your own SDK [Build your own SDK](https://www.browserstack.com/docs/percy/build-your-own-SDK/get-started) --- # Source: https://www.browserstack.com/docs/percy/build-results/ignore-regions # Redirecting… [Click here if you are not redirected.](https://www.browserstack.com/docs/percy/set-regions/define-regions#region-settings) --- # Source: https://www.browserstack.com/docs/percy/build-results/labels [Skip to main content](#main-content)[Explore now](https://scanner.browserstack.com?utm_source=hello+bar&utm_medium=website)[Documentation](https://www.browserstack.com/docs/)[Ask the Community](https://www.browserstack.com/discord?ref=docsArticle&source=docs_article_page) # Create labels/tags Learn how to use labels/tags to organize projects, builds, and snapshots. Labels/Tags are essential for categorizing and organizing projects, builds and snapshots. They improve the ability to filter and search for specific builds and snapshots, enhancing overall project management. By using labels/tags, teams streamline workflows, facilitate better tracking and management, and enhance collaboration, ensuring everyone stays on the same page. Minimum required @percy/cli version is 1.28.8. ## Create project labels/tags You can create project labels/tags while setting up a Percy project. Navigate toCreate Project, select the type of project, enter the name and add your own label/tags or choose from the available options. Once the build is generated, you will see the added labels/tags in your build on theProjectspage. ## Create builds with labels/tags You can create new builds with labels/tags using the--labelsoption in Percy CLI commands. Add multiple labels/tags by separating them with commas. To include spaces in labels/tags, use double quotes. `--labels` ### Example CLI command: ### Example with multi-word labels/tags: ### Defining labels/tags in Percy configuration file Labels/Tags can also be defined in the Percy configuration file (percy.yml) under the percy key using thelabelskey. `labels`Example percy.yml file: ## Associating snapshots with labels/tags You can associate snapshots with labels/tags by utilizing thepercySnapshotorpercyScreenshotfunctions and including the labels/tags as a key in the options parameter. `percySnapshot``percyScreenshot`Use thepercySnapshotmethod for Percy Web projects and thepercyScreenshotmethod for Percy on Automate projects. `percySnapshot``percyScreenshot`Example: This enables you to effectively manage and filter your snapshots and builds using labels/tags, improving organization and workflow efficiency. ## Search using labels/tags TheProjectsandBuildspages now include a newly introduced search text box that enables you to search using labels/tags. Additionally, you can search snapshots using labels and names for individual snapshots on the review page by clicking thesearchicon. - Clicking the search text box will automatically populate a dropdown menu with all valid labels/tags used across the organization, including those in projects, builds, and snapshots. - You can select one or more labels/tags and optionally add a search term to search within the project, build or snapshot name on those pages. #### We're sorry to hear that. Please share your feedback so we can do better Contact ourSupport teamfor immediate help while we work on improving our docs. [Support team](https://www.browserstack.com/support) #### We're continuously improving our docs. We'd love to know what you liked - This page has exactly what I am looking for - This content & code samples are accurate and up-to-date - The content on this page is easy to understand - Other (please tell us more below) Thank you for your valuable feedback - ON THIS PAGE Is this page helping you? [Support team](https://www.browserstack.com/support)Thank you for your valuable feedback! [Talk to an Expert](https://www.browserstack.com/contact?ref=docs-page-floating-contact)Welcome to Percy New to Percy? [View Documentation](https://www.browserstack.com/docs/percy/get-started-without-code-or-automation-script)Select your framework and language to proceed - Selenium - Playwright - Cypress [Cypress](https://www.browserstack.com/docs/percy/cypress/get-started)- Puppeteer [Puppeteer](https://www.browserstack.com/docs/percy/puppeteer/get-started)- Ember [Ember](https://www.browserstack.com/docs/percy/ember/get-started)- Storybook [Storybook](https://www.browserstack.com/docs/percy/storybook/get-started)- Gatsby [Gatsby](https://www.browserstack.com/docs/percy/gatsby/get-started)- Jekyll [Jekyll](https://www.browserstack.com/docs/percy/jekyll/get-started)- Appium [Appium](https://www.browserstack.com/docs/percy/appium/get-started)- Tricentis Tosca [Tricentis Tosca](https://www.browserstack.com/docs/percy/tosca/get-started)- Build your own SDK [Build your own SDK](https://www.browserstack.com/docs/percy/build-your-own-SDK/get-started) --- # Source: https://www.browserstack.com/docs/percy/build-results/layout-testing [Skip to main content](#main-content)[Explore now](https://scanner.browserstack.com?utm_source=hello+bar&utm_medium=website)[Documentation](https://www.browserstack.com/docs/)[Ask the Community](https://www.browserstack.com/discord?ref=docsArticle&source=docs_article_page) # Layout testing Learn how layout testing works in Percy Layout testing is a process to check the arrangement and positioning of UI elements to confirm they match the expected design or layout guidelines. It helps identify issues such as misaligned elements, incorrect spacing, or any discrepancies in the visual presentation. This is particularly effective for cross-environment testing providing a reliable validation of page structure. Percy’s layout testing focuses on validating the structure of page layout. It identifies page elements from baseline such as text, images, buttons, divs and columns, ensuring their relative positions remain consistent. The visual comparison is executed by providing a meticulous examination of layout changes without verifying content alterations. It’s a powerful tool for cross-environment testing, providing reassurance that the page structure remains intact across different operating systems, browsers, and devices. - Currently, the Layout testing feature currently works only with Percy SDK and@percy/cliversion 1.27.4 and higher. `@percy/cli`- Use thepercySnapshotmethod for Percy Web projects and thepercyScreenshotmethod for Percy on Automate projects. `percySnapshot``percyScreenshot` ### To enable layout testing in Percy, follow these steps: Set up Percy and have builds running actively using thepercySnapshotcommand. [percySnapshot](https://www.browserstack.com/docs/percy/take-percy-snapshots/snapshots-via-scripts)Enable layout testing while capturing the screenshots. Run and review buildsOnce the build is completed, go to the Percy dashboard and locate the layout icon on snapshot thumbnails to recognize the snapshots that underwent layout diffing process. ## Things to keep in mind - Base snapshots must exist, and any base snapshots dated before November 1, 2023, will not be considered. In such scenarios, we will have standard Percy behaviour. - Layout testing will not function with commands such asnpx percy snapshotor if utilized within a configuration file (e.g. ‘xyz.yml’ file). `npx percy snapshot`- iframes with the same domain or subdomain which is accessible JavaScript will be considered along with its content. - iframes from different domains are verified for their existence, not their content. - The difference in text layout wouldn’t be emphasized if the text is present but remains unseen due to its color blending into the background. - Only differences are highlighted within the head image (or the image currently compared to the base/image on the right side of the review screen). For example, if a specific region is removed from the base image, the difference will only be highlighted within the head image. ## Limitations - Only works forpercySnapshotcommand. `percySnapshot`- If you have set “enableJS” to true while testing dynamic websites to capture dynamic animations, images, etc., it may cause inconsistent layout testing in such scenarios. - Snapshots throughpercy uploadwill not work for layout testing. `percy upload`- Pop-ups differences may not be accurate. - Shadow DOM elements are not supported. #### We're sorry to hear that. Please share your feedback so we can do better Contact ourSupport teamfor immediate help while we work on improving our docs. [Support team](https://www.browserstack.com/support) #### We're continuously improving our docs. We'd love to know what you liked - This page has exactly what I am looking for - This content & code samples are accurate and up-to-date - The content on this page is easy to understand - Other (please tell us more below) Thank you for your valuable feedback - ON THIS PAGE Is this page helping you? [Support team](https://www.browserstack.com/support)Thank you for your valuable feedback! [Talk to an Expert](https://www.browserstack.com/contact?ref=docs-page-floating-contact)Welcome to Percy New to Percy? [View Documentation](https://www.browserstack.com/docs/percy/get-started-without-code-or-automation-script)Select your framework and language to proceed - Selenium - Playwright - Cypress [Cypress](https://www.browserstack.com/docs/percy/cypress/get-started)- Puppeteer [Puppeteer](https://www.browserstack.com/docs/percy/puppeteer/get-started)- Ember [Ember](https://www.browserstack.com/docs/percy/ember/get-started)- Storybook [Storybook](https://www.browserstack.com/docs/percy/storybook/get-started)- Gatsby [Gatsby](https://www.browserstack.com/docs/percy/gatsby/get-started)- Jekyll [Jekyll](https://www.browserstack.com/docs/percy/jekyll/get-started)- Appium [Appium](https://www.browserstack.com/docs/percy/appium/get-started)- Tricentis Tosca [Tricentis Tosca](https://www.browserstack.com/docs/percy/tosca/get-started)- Build your own SDK [Build your own SDK](https://www.browserstack.com/docs/percy/build-your-own-SDK/get-started) --- # Source: https://www.browserstack.com/docs/percy/build-results/overview [Skip to main content](#main-content)[Explore now](https://scanner.browserstack.com?utm_source=hello+bar&utm_medium=website)[Documentation](https://www.browserstack.com/docs/)[Ask the Community](https://www.browserstack.com/discord?ref=docsArticle&source=docs_article_page) # Percy build results overview Overview page for viewing Percy build results Percy build results streamline the visual testing process with several key features. Approve builds by validating visual changes and request changes if discrepancies arise. Use comments and notifications for collaboration, and specify ignore regions to focus on significant changes. Responsive visual testing ensures UI consistency across screen sizes. Snapshot grouping with matching diffs simplifies comparison, while test case grouping helps in organizing snapshots. The diff highlighter highlights differences between snapshots. Additionally, Intelli Ignore and contextual diff help refine comparisons, and layout testing confirms UI elements align with design guidelines. This page presents a list of the key features available for viewing in Percy build results, making it easier to understand and utilize the tool effectively. ## Key Features - Approve a Build [Approve a Build](https://www.browserstack.com/docs/percy/build-results/approval)- Request Changes [Request Changes](https://www.browserstack.com/docs/percy/build-results/change-request)- Snapshot Grouping with Matching Diffs [Snapshot Grouping with Matching Diffs](https://www.browserstack.com/docs/percy/build-results/snapshot-grouping-with-matching-diffs)- Group Snapshots by Test Case Name [Group Snapshots by Test Case Name](https://www.browserstack.com/docs/percy/build-results/group-snapshot-by-test-case-name)- Diff Highlighter [Diff Highlighter](https://www.browserstack.com/docs/percy/build-results/diff-highlighter)- Ignore Regions [Ignore Regions](https://www.browserstack.com/docs/percy/build-results/ignore-regions)- Comments and Notifications [Comments and Notifications](https://www.browserstack.com/docs/percy/build-results/comments)- Boost performance with image optimization [Boost performance with image optimization](https://www.browserstack.com/docs/percy/build-results/performance)- Build finalization features [Build finalization features](https://www.browserstack.com/docs/percy/build-results/manual-automatic-build-finalisation)- Build lifecycle [Build lifecycle](https://www.browserstack.com/docs/percy/build-results/build-lifecycle)- Create labels [Create labels](https://www.browserstack.com/docs/percy/build-results/labels)- Apply on-demand snapshot rules [Apply on-demand snapshot rules](https://www.browserstack.com/docs/percy/build-results/snapshot-rules)- Responsive Visual Testing [Responsive Visual Testing](https://www.browserstack.com/docs/percy/build-results/responsive-testing)- Visual Testing on Mobile Browsers [Visual Testing on Mobile Browsers](https://www.browserstack.com/docs/percy/build-results/visual-testing)- Intelli Ignore [Intelli Ignore](https://www.browserstack.com/docs/percy/build-results/intelli-ignore)- Layout testing [Layout testing](https://www.browserstack.com/docs/percy/build-results/layout-testing)- Root cause analysis [Root cause analysis](https://www.browserstack.com/docs/percy/build-results/root-cause-analysis) #### We're sorry to hear that. Please share your feedback so we can do better Contact ourSupport teamfor immediate help while we work on improving our docs. [Support team](https://www.browserstack.com/support) #### We're continuously improving our docs. We'd love to know what you liked - This page has exactly what I am looking for - This content & code samples are accurate and up-to-date - The content on this page is easy to understand - Other (please tell us more below) Thank you for your valuable feedback - ON THIS PAGE Is this page helping you? [Support team](https://www.browserstack.com/support)Thank you for your valuable feedback! [Talk to an Expert](https://www.browserstack.com/contact?ref=docs-page-floating-contact)Welcome to Percy New to Percy? [View Documentation](https://www.browserstack.com/docs/percy/get-started-without-code-or-automation-script)Select your framework and language to proceed - Selenium - Playwright - Cypress [Cypress](https://www.browserstack.com/docs/percy/cypress/get-started)- Puppeteer [Puppeteer](https://www.browserstack.com/docs/percy/puppeteer/get-started)- Ember [Ember](https://www.browserstack.com/docs/percy/ember/get-started)- Storybook [Storybook](https://www.browserstack.com/docs/percy/storybook/get-started)- Gatsby [Gatsby](https://www.browserstack.com/docs/percy/gatsby/get-started)- Jekyll [Jekyll](https://www.browserstack.com/docs/percy/jekyll/get-started)- Appium [Appium](https://www.browserstack.com/docs/percy/appium/get-started)- Tricentis Tosca [Tricentis Tosca](https://www.browserstack.com/docs/percy/tosca/get-started)- Build your own SDK [Build your own SDK](https://www.browserstack.com/docs/percy/build-your-own-SDK/get-started) --- # Source: https://www.browserstack.com/docs/percy/build-results/responsive-testing [Skip to main content](#main-content)[Explore now](https://scanner.browserstack.com?utm_source=hello+bar&utm_medium=website)[Documentation](https://www.browserstack.com/docs/)[Ask the Community](https://www.browserstack.com/discord?ref=docsArticle&source=docs_article_page) # Responsive Visual Testing Learn how responsive visual testing works in Percy A powerful feature of Percy is visual testing for responsive user interfaces, allowing you to automatically detect visual regressions on mobile, tablet, and desktop screens at once. You provide a list of responsive breakpoint widths and we take care of the rest. ## How it works Because Percy stores the original DOM snapshot and page assets, we simply render the same page at different widths by resizing the browser when generating page screenshots. This is handled entirely server-side and has no effect on the speed of your tests since all rendering and diffing takes place in Percy. ### Configuring responsive snapshots Configuring Percy for responsive visual testing is as easy as specifying your desired responsive breakpoint widths when you call Percy snapshots. NOTE: Check the documentation forthe specific SDK you’re usingto learn how to add responsive widths to your snapshot calls. [the specific SDK you’re using](https://www.browserstack.com/docs/percy/integrate/overview) ### Usage Each responsive width counts as a separate screenshot that counts towards your monthly screenshot usage. For example, a snapshot of your homepage at 375px and 1280px will count as 2 screenshots. ## Reference topic - Browser compatibility and maximum page dimensions with Percy [Browser compatibility and maximum page dimensions with Percy](https://www.browserstack.com/docs/percy/common-issue/browser-compatibility) #### We're sorry to hear that. Please share your feedback so we can do better Contact ourSupport teamfor immediate help while we work on improving our docs. [Support team](https://www.browserstack.com/support) #### We're continuously improving our docs. We'd love to know what you liked - This page has exactly what I am looking for - This content & code samples are accurate and up-to-date - The content on this page is easy to understand - Other (please tell us more below) Thank you for your valuable feedback - ON THIS PAGE Is this page helping you? [Support team](https://www.browserstack.com/support)Thank you for your valuable feedback! [Talk to an Expert](https://www.browserstack.com/contact?ref=docs-page-floating-contact)Welcome to Percy New to Percy? [View Documentation](https://www.browserstack.com/docs/percy/get-started-without-code-or-automation-script)Select your framework and language to proceed - Selenium - Playwright - Cypress [Cypress](https://www.browserstack.com/docs/percy/cypress/get-started)- Puppeteer [Puppeteer](https://www.browserstack.com/docs/percy/puppeteer/get-started)- Ember [Ember](https://www.browserstack.com/docs/percy/ember/get-started)- Storybook [Storybook](https://www.browserstack.com/docs/percy/storybook/get-started)- Gatsby [Gatsby](https://www.browserstack.com/docs/percy/gatsby/get-started)- Jekyll [Jekyll](https://www.browserstack.com/docs/percy/jekyll/get-started)- Appium [Appium](https://www.browserstack.com/docs/percy/appium/get-started)- Tricentis Tosca [Tricentis Tosca](https://www.browserstack.com/docs/percy/tosca/get-started)- Build your own SDK [Build your own SDK](https://www.browserstack.com/docs/percy/build-your-own-SDK/get-started) --- # Source: https://www.browserstack.com/docs/percy/build-results/root-cause-analysis [Skip to main content](#main-content)[Explore now](https://scanner.browserstack.com?utm_source=hello+bar&utm_medium=website)[Documentation](https://www.browserstack.com/docs/)[Ask the Community](https://www.browserstack.com/discord?ref=docsArticle&source=docs_article_page) # Root cause analysis Use the Root cause analysis feature to identify the cause of visual differences in your tests quickly. The Root cause analysis feature in Percy helps you investigate visual differences effectively. If there are differences associated with a particular snapshot, root cause analysis mode displays only those differences where DOM changes are identified. If you do not see any differences, you can assume that there are no DOM differences associated with the build. ## Explore Root cause analysis Activate Root cause analysis mode to interactively explore differences within snapshots and click on specific regions to identify their root causes. Normal differences are highlighted in red color, and when this feature is turned on, a purple color bounding box appears around them. Use this feature to streamline your debugging process. To activate Root cause analysis for a snapshot, follow these steps: Step 1: Go to your project build review screen and click the Root cause analysisicon. The head image (current snapshot) transforms to display the differences interactively, with each difference region becoming clickable for detailed inspection. Step 2: Click on a specific difference within the snapshot. This information will be displayed on the same review screen underRoot cause analysissection. You can use the Diff navigator (<,>) to navigate through previous and next differences. The review screen displays different types of differences, see the following section. ## Types of differences With Root cause analysis, you can view different types of differences, as follows: - DOM elements - CSS attributes - Position related differences DOM element differences occur when there are changes to the structure or attributes of elements in the DOM. This can include the addition, removal, or modification of tags or attributes. CSS attribute differences include changes in style properties, such as color, font, padding, margin, border, box shadow, opacity, background, and hover/active states. Currently, only commonly used CSS attributes are supported. Position-related differences include changes in an element’s position, size, or alignment, such as variations in width, height, aspect ratio, or spacing between elements. Misalignments within containers can also cause visual discrepancies. These differences can significantly impact the layout and overall appearance of a page. ## Focus mode Focusmode helps you concentrate on one visual difference at a time. It highlights a single diff using a purple bounding box along with the red pixels, making it easier to review changes in detail. While in focus mode, hover states remain active so you can still navigate between diffs without turning the mode off. ## Visualizing changes between snapshots - The text color or background indicates the differences between the current and baseline snapshots. Green highlights values added in the current DOM, while red shows values that were removed. Identical values, such as element paths, box dimensions, or CSS rules, are not colored, emphasizing only the changes between the two snapshots. - When you hover over RCA regions, a tooltip appears showing the class of the end element that has changed or been added. If the element does not have a class, the tooltip displays the tag name. ## Things to keep in mind - This feature does not capture differences when the DOM structure does not change, even if visual differences exist. This applies to elements like:Carousels: The DOM stays the same while images rotate.iFrames: The outer DOM remains static, even when the content inside an iFrame updates. - Carousels: The DOM stays the same while images rotate. - iFrames: The outer DOM remains static, even when the content inside an iFrame updates. - If there are two types of differences in the head image, general differences and intelli-ignore, these differences appear in different colors in Root cause analysis mode.When intelli-ignore is enabled, ignored differences appear in amber color. Root cause analysis mode shows these differences only if they have an associated DOM and intelli ignore is on.If the same component or element has both a normal and an intelli-ignore difference, everything is shown in red color without differentiation. - When intelli-ignore is enabled, ignored differences appear in amber color. Root cause analysis mode shows these differences only if they have an associated DOM and intelli ignore is on. - If the same component or element has both a normal and an intelli-ignore difference, everything is shown in red color without differentiation. - Currently, if an ignore region is added and there is an actual DOM difference in that area, the difference appears in root cause analysis mode. - This feature does not work when images are uploaded via Percy Upload, on Figma builds, or on snapshots. #### We're sorry to hear that. Please share your feedback so we can do better Contact ourSupport teamfor immediate help while we work on improving our docs. [Support team](https://www.browserstack.com/support) #### We're continuously improving our docs. We'd love to know what you liked - This page has exactly what I am looking for - This content & code samples are accurate and up-to-date - The content on this page is easy to understand - Other (please tell us more below) Thank you for your valuable feedback - ON THIS PAGE Is this page helping you? [Support team](https://www.browserstack.com/support)Thank you for your valuable feedback! [Talk to an Expert](https://www.browserstack.com/contact?ref=docs-page-floating-contact)Welcome to Percy New to Percy? [View Documentation](https://www.browserstack.com/docs/percy/get-started-without-code-or-automation-script)Select your framework and language to proceed - Selenium - Playwright - Cypress [Cypress](https://www.browserstack.com/docs/percy/cypress/get-started)- Puppeteer [Puppeteer](https://www.browserstack.com/docs/percy/puppeteer/get-started)- Ember [Ember](https://www.browserstack.com/docs/percy/ember/get-started)- Storybook [Storybook](https://www.browserstack.com/docs/percy/storybook/get-started)- Gatsby [Gatsby](https://www.browserstack.com/docs/percy/gatsby/get-started)- Jekyll [Jekyll](https://www.browserstack.com/docs/percy/jekyll/get-started)- Appium [Appium](https://www.browserstack.com/docs/percy/appium/get-started)- Tricentis Tosca [Tricentis Tosca](https://www.browserstack.com/docs/percy/tosca/get-started)- Build your own SDK [Build your own SDK](https://www.browserstack.com/docs/percy/build-your-own-SDK/get-started) --- # Source: https://www.browserstack.com/docs/percy/build-results/visual-testing [Skip to main content](#main-content)[Explore now](https://scanner.browserstack.com?utm_source=hello+bar&utm_medium=website)[Documentation](https://www.browserstack.com/docs/)[Ask the Community](https://www.browserstack.com/discord?ref=docsArticle&source=docs_article_page) # Visual Testing on mobile browsers Learn all about visual testing on mobile Browsers Percy is an all-in-one visual testing and review platform that allows you to run visual tests using either the BrowserStack SDK or the Percy SDK. Cross-browser visual testing is available for all Percy customers to effortlessly see visual changes across different mobile browsers. You can manage browsers through either Automate or Percy. For more information, seeCreate a project. [Create a project](https://www.browserstack.com/docs/percy/get-started/create-project)Based on your browser selection management, refer to the appropriate section: Percy runs visual tests for all major mobile browsers specified in your BrowserStack configuration file. Set the browser version by integrating your test with theBrowserStack SDK with Automate. Use theAutomate capability builderto configure various mobile browser names and versions. [BrowserStack SDK with Automate](https://www.browserstack.com/docs/percy/integrate/percy-with-browserstack-sdk)[Automate capability builder](https://www.browserstack.com/docs/automate/capabilities)In your BrowserStack configuration file, include the following mobile browser details under theplatformattribute: `platform`- os name - osVersion - browserName - browserVersion All specified browsers appear under theDevice & Browsersdrop-down. Select a device, and the build displays separate screenshots for that device and browser, highlighting the visual differences specific to each. ## Important changes for mobile browsers Behavior differences to note when running Percy tests on mobile browsers. ### Screenshot width The width parameter passed while running Percy tests will be ignored for mobile browsers as Percy uses real mobile devices and the screenshot width is fixed for these. Please note that the behavior on desktop browsers remains unchanged. ### Portrait mode All screenshots on mobile browsers will be taken in portrait mode by default. Please refer to these pages to read more about changes in mobile browsers’ behavior: - Text stability in iOS [Text stability in iOS](https://www.browserstack.com/docs/percy/troubleshoot/text-stability)- Autoplay videos here [Autoplay videos here](https://www.browserstack.com/docs/percy/stabilize-screenshots/videos#handling-videos-on-mobile-browsers)Currently, Percy supports the following combinations for mobile browsers: - Safari with iOS - Chrome with Android (Beta) We’ll soon add more combinations to this list.Contact usif you’re looking for something specific. [Contact us](https://www.browserstack.com/contact) ## How to access mobile browsers To access mobile browsers, you will have to upgrade to thePercy Desktop & Mobileplan. If you do not have access to the mobile plan: [Percy Desktop & Mobile](https://www.browserstack.com/pricing?product=percy)- Reach out to your Percy account owner and ask them to upgrade. - If you don’t know the account owner, fill outthisform and we will reach out to your account owner. [this](https://www.browserstack.com/contact?ref=footer#sales)- Alternatively, you can request a free trial of the mobile plan using thesame form. [same form](https://www.browserstack.com/contact#sales)If you already have a Percy Desktop & Mobile plan, you can turn mobile browsers on or off using either of the following options: - Browser Settings Page: Use this page to view and change the browser coverage for all your Percy projects. [Browser Settings Page](https://percy.io/dashboard/browsers)- Project settings: You can also use the project settings page to toggle browsers on/off While reviewing diffs, Percy will show separate screenshots for each browser, highlighting the visual diffs specific to each. ## Differences between desktop and mobile plans All features in Desktop and Desktop & Mobile plans are same, except the support for mobile browsers. Please visit thepricingpage for a detailed comparison between the desktop and mobile plans. [pricing](https://www.browserstack.com/pricing?product=percy)[Text stability in iOS](https://www.browserstack.com/docs/percy/troubleshoot/text-stability)[Autoplay videos here](https://www.browserstack.com/docs/percy/stabilize-screenshots/videos#handling-videos-on-mobile-browsers) #### We're sorry to hear that. Please share your feedback so we can do better Contact ourSupport teamfor immediate help while we work on improving our docs. [Support team](https://www.browserstack.com/support) #### We're continuously improving our docs. We'd love to know what you liked - This page has exactly what I am looking for - This content & code samples are accurate and up-to-date - The content on this page is easy to understand - Other (please tell us more below) Thank you for your valuable feedback - ON THIS PAGE Is this page helping you? [Support team](https://www.browserstack.com/support)Thank you for your valuable feedback! [Talk to an Expert](https://www.browserstack.com/contact?ref=docs-page-floating-contact)Welcome to Percy New to Percy? [View Documentation](https://www.browserstack.com/docs/percy/get-started-without-code-or-automation-script)Select your framework and language to proceed - Selenium - Playwright - Cypress [Cypress](https://www.browserstack.com/docs/percy/cypress/get-started)- Puppeteer [Puppeteer](https://www.browserstack.com/docs/percy/puppeteer/get-started)- Ember [Ember](https://www.browserstack.com/docs/percy/ember/get-started)- Storybook [Storybook](https://www.browserstack.com/docs/percy/storybook/get-started)- Gatsby [Gatsby](https://www.browserstack.com/docs/percy/gatsby/get-started)- Jekyll [Jekyll](https://www.browserstack.com/docs/percy/jekyll/get-started)- Appium [Appium](https://www.browserstack.com/docs/percy/appium/get-started)- Tricentis Tosca [Tricentis Tosca](https://www.browserstack.com/docs/percy/tosca/get-started)- Build your own SDK [Build your own SDK](https://www.browserstack.com/docs/percy/build-your-own-SDK/get-started) --- # Source: https://www.browserstack.com/docs/percy/ci-cd/overview [Skip to main content](#main-content)[Explore now](https://scanner.browserstack.com?utm_source=hello+bar&utm_medium=website)[Documentation](https://www.browserstack.com/docs/)[Ask the Community](https://www.browserstack.com/discord?ref=docsArticle&source=docs_article_page) # Trigger visual tests from CI/CD Learn how to integrate Percy with a variety of available CI/CD tools Percy works best when integrated into your CI workflow, running continuously alongside your test suite. Percy integrates with all common CI providers and can be configured for custom environments. ## Supported CI integrations You can integrate Percy with the following CI services: [JenkinsIntegrate Percy with Jenkins.](https://www.browserstack.com/docs/percy/ci-cd/jenkins)Integrate Percy with Jenkins. [Azure PipelinesIntegrate Percy with Azure Pipelines.](https://www.browserstack.com/docs/percy/ci-cd/azure-pipelines)Integrate Percy with Azure Pipelines. [Circle CIIntegrate Percy with Circle CI.](https://www.browserstack.com/docs/percy/ci-cd/circleci)Integrate Percy with Circle CI. [Bitbucket PipelineIntegrate Percy with Bitbucket Pipeline.](https://www.browserstack.com/docs/percy/ci-cd/bitbucket-pipeline)Integrate Percy with Bitbucket Pipeline. [Travis CIIntegrate Percy with Travis CI.](https://www.browserstack.com/docs/percy/ci-cd/travis-ci)Integrate Percy with Travis CI. [GitHub ActionsIntegrate Percy with GitHub Actions.](https://www.browserstack.com/docs/percy/ci-cd/github-actions)Integrate Percy with GitHub Actions. [GitLab CIIntegrate Percy with GitLab CI.](https://www.browserstack.com/docs/percy/ci-cd/gitlab)Integrate Percy with GitLab CI. [AppVeyorIntegrate Percy with AppVeyor.](https://www.browserstack.com/docs/percy/ci-cd/appveyor)Integrate Percy with AppVeyor. [Harness CIIntegrate Percy with Harness CI.](https://www.browserstack.com/docs/percy/ci-cd/harness)Integrate Percy with Harness CI. [SemaphoreIntegrate Percy with Semaphore.](https://www.browserstack.com/docs/percy/ci-cd/semaphore)Integrate Percy with Semaphore. [BuildkiteIntegrate Percy with Buildkite.](https://www.browserstack.com/docs/percy/ci-cd/buildkite)Integrate Percy with Buildkite. [CodeShipIntegrate Percy with CodeShip.](https://www.browserstack.com/docs/percy/ci-cd/codeship)Integrate Percy with CodeShip. [NetlifyIntegrate Percy with Netlify.](https://www.browserstack.com/docs/percy/ci-cd/netlify)Integrate Percy with Netlify. [OthersIntegrate Percy with Other CI-CD tool.](https://www.browserstack.com/docs/percy/ci-cd/others)Integrate Percy with Other CI-CD tool. Click each CI service to see step-by-step integration instructions. ProtipDon’t see your CI service? We’re constantly adding support for CI services. Reach out tosupportto see if yours is on the way. [support](mailto:support@percy.io) ## How it works Percy is designed to integrate with your tests and CI environment to run continuous visual reviews. After you add Percy to your tests and your CI environment, Percy starts receiving and rendering screenshots every time a CI build runs. ## Configure CI environment variables To enable Percy, configure the environment variable, ‘PERCY_TOKEN’, in your CI service. This is our write-only API token unique for each Percy project and should be kept secret. You can findPERCY_TOKENin your project settings. `PERCY_TOKEN` ## Start and stop Percy CLI There are two ways to start and stop Percy CLI from your CI setup: ### Percy execution command Add thepercy execcommand in your configuration file (for example, make file, package.json, or req.txt) to start Percy, as shown below: [percy exec](https://www.browserstack.com/docs/percy/take-percy-snapshots/snapshots-via-scripts)In your pipeline script, make changes similar to the following: ### Percy start and stop commands If you cannot use thepercy execcommandin your configuration file, use thepercy exec:startandpercy exec:stopcommands. [command](https://www.browserstack.com/docs/percy/take-percy-snapshots/snapshots-via-scripts)In this case, your configuration file looks as follows: And your pipeline script should be similar to the following: The above script performs the following actions: - Install Percy CLI. - Start Percy CLI with PERCY_TOKEN. - Run your tests. - Stop Percy CLI. ## Parallel test suites Percy automatically supports most parallelized test environments. Snapshots are pushed from your tests to Percy and rendered for you to review in the same Percy build, no matter if your tests are run in different processes or even on different machines. You can also simply configure Percy to support complex parallelization setups. #### We're sorry to hear that. Please share your feedback so we can do better Contact ourSupport teamfor immediate help while we work on improving our docs. [Support team](https://www.browserstack.com/support) #### We're continuously improving our docs. We'd love to know what you liked - This page has exactly what I am looking for - This content & code samples are accurate and up-to-date - The content on this page is easy to understand - Other (please tell us more below) Thank you for your valuable feedback - ON THIS PAGE Is this page helping you? [Support team](https://www.browserstack.com/support)Thank you for your valuable feedback! [Talk to an Expert](https://www.browserstack.com/contact?ref=docs-page-floating-contact)Welcome to Percy New to Percy? [View Documentation](https://www.browserstack.com/docs/percy/get-started-without-code-or-automation-script)Select your framework and language to proceed - Selenium - Playwright - Cypress [Cypress](https://www.browserstack.com/docs/percy/cypress/get-started)- Puppeteer [Puppeteer](https://www.browserstack.com/docs/percy/puppeteer/get-started)- Ember [Ember](https://www.browserstack.com/docs/percy/ember/get-started)- Storybook [Storybook](https://www.browserstack.com/docs/percy/storybook/get-started)- Gatsby [Gatsby](https://www.browserstack.com/docs/percy/gatsby/get-started)- Jekyll [Jekyll](https://www.browserstack.com/docs/percy/jekyll/get-started)- Appium [Appium](https://www.browserstack.com/docs/percy/appium/get-started)- Tricentis Tosca [Tricentis Tosca](https://www.browserstack.com/docs/percy/tosca/get-started)- Build your own SDK [Build your own SDK](https://www.browserstack.com/docs/percy/build-your-own-SDK/get-started) --- # Source: https://www.browserstack.com/docs/percy/common-issue/asset-not-captured [Skip to main content](#main-content)[Explore now](https://scanner.browserstack.com?utm_source=hello+bar&utm_medium=website)[Documentation](https://www.browserstack.com/docs/)[Ask the Community](https://www.browserstack.com/discord?ref=docsArticle&source=docs_article_page) # Assets not captured Assets fail to capture refers to a situation where the capturing or rendering process of assets on a web page fails due to authentication issues. The most common reason assets fail to capture is due to authentication issues. As Percy re-renders the DOM in a browser outside of your test suite, providing authentication to the requests made by this browser may be necessary. Thediscoveryconfiguration key in Percy’s SDKs offers several methods for authenticating requests, such as: [discovery](https://www.browserstack.com/docs/percy/take-percy-snapshots/overview#all-configuration-options)`discovery`- request-headers: An object containing HTTP headers to be sent for each request made during asset discovery - authorization: A username/password combo to authenticate requests for Percy - cookies: Cookies to use for discovery’s browser session Need more support?Contact BrowserStack. [Contact BrowserStack](https://www.browserstack.com/contact?ref=docs) ## Reference Topic - Percy Common - FAQs [Percy Common - FAQs](https://www.browserstack.com/docs/percy/troubleshoot/percy-common-faqs) #### We're sorry to hear that. Please share your feedback so we can do better Contact ourSupport teamfor immediate help while we work on improving our docs. [Support team](https://www.browserstack.com/support) #### We're continuously improving our docs. We'd love to know what you liked - This page has exactly what I am looking for - This content & code samples are accurate and up-to-date - The content on this page is easy to understand - Other (please tell us more below) Thank you for your valuable feedback - ON THIS PAGE Is this page helping you? [Support team](https://www.browserstack.com/support)Thank you for your valuable feedback! [Talk to an Expert](https://www.browserstack.com/contact?ref=docs-page-floating-contact)Welcome to Percy New to Percy? [View Documentation](https://www.browserstack.com/docs/percy/get-started-without-code-or-automation-script)Select your framework and language to proceed - Selenium - Playwright - Cypress [Cypress](https://www.browserstack.com/docs/percy/cypress/get-started)- Puppeteer [Puppeteer](https://www.browserstack.com/docs/percy/puppeteer/get-started)- Ember [Ember](https://www.browserstack.com/docs/percy/ember/get-started)- Storybook [Storybook](https://www.browserstack.com/docs/percy/storybook/get-started)- Gatsby [Gatsby](https://www.browserstack.com/docs/percy/gatsby/get-started)- Jekyll [Jekyll](https://www.browserstack.com/docs/percy/jekyll/get-started)- Appium [Appium](https://www.browserstack.com/docs/percy/appium/get-started)- Tricentis Tosca [Tricentis Tosca](https://www.browserstack.com/docs/percy/tosca/get-started)- Build your own SDK [Build your own SDK](https://www.browserstack.com/docs/percy/build-your-own-SDK/get-started) --- # Source: https://www.browserstack.com/docs/percy/common-issue/common-errors/browser-spawn-failure [Skip to main content](#main-content)[Explore now](https://scanner.browserstack.com?utm_source=hello+bar&utm_medium=website)[Documentation](https://www.browserstack.com/docs/)[Ask the Community](https://www.browserstack.com/discord?ref=docsArticle&source=docs_article_page) # Error - Browser spawn failure Learn how to fix errors related to browser spawn failures in Percy Spawn failures usually occur on node when it is unable to spawn a child process. This can be due to permissions or environment issues in which the node process is running. Try these solutions to resolve this error: Solution 1: Spawn failures can occur if you run multiple CLI instances on the same machine simultaneously. We recommend using a single Percy CLI on a machine. For more information, seeParallel tests on same machine. [Parallel tests on same machine](https://www.browserstack.com/docs/percy/integrate/parallel-test-suites#parallel-tests-on-the-same-machine)To fix errors related to the port being in use already by killing the process, seekill the Percy process. [kill the Percy process](https://www.browserstack.com/docs/percy/common-issue/common-errors/percy-port-in-use)Solution 2: - For Mac, try installing Rosetta using the following command: ``` softwareupdate --install-rosetta ``` `softwareupdate --install-rosetta`- For WindowsDisable any antivirus software you have installed and check if the error persists. If the error is resolved, it indicates that your antivirus is blocking Percy from spawning a new browser instance. In this case, modify your antivirus settings to allow Percy to spawn a browser. - Disable any antivirus software you have installed and check if the error persists. If the error is resolved, it indicates that your antivirus is blocking Percy from spawning a new browser instance. In this case, modify your antivirus settings to allow Percy to spawn a browser. Need more support?Contact BrowserStack. [Contact BrowserStack](https://www.browserstack.com/contact?ref=docs) ## Reference Topic - Percy Common error messages [Percy Common error messages](https://www.browserstack.com/docs/percy/troubleshoot/percy-common-faqs#common-error-messages) #### We're sorry to hear that. Please share your feedback so we can do better Contact ourSupport teamfor immediate help while we work on improving our docs. [Support team](https://www.browserstack.com/support) #### We're continuously improving our docs. We'd love to know what you liked - This page has exactly what I am looking for - This content & code samples are accurate and up-to-date - The content on this page is easy to understand - Other (please tell us more below) Thank you for your valuable feedback - ON THIS PAGE Is this page helping you? [Support team](https://www.browserstack.com/support)Thank you for your valuable feedback! [Talk to an Expert](https://www.browserstack.com/contact?ref=docs-page-floating-contact)Welcome to Percy New to Percy? [View Documentation](https://www.browserstack.com/docs/percy/get-started-without-code-or-automation-script)Select your framework and language to proceed - Selenium - Playwright - Cypress [Cypress](https://www.browserstack.com/docs/percy/cypress/get-started)- Puppeteer [Puppeteer](https://www.browserstack.com/docs/percy/puppeteer/get-started)- Ember [Ember](https://www.browserstack.com/docs/percy/ember/get-started)- Storybook [Storybook](https://www.browserstack.com/docs/percy/storybook/get-started)- Gatsby [Gatsby](https://www.browserstack.com/docs/percy/gatsby/get-started)- Jekyll [Jekyll](https://www.browserstack.com/docs/percy/jekyll/get-started)- Appium [Appium](https://www.browserstack.com/docs/percy/appium/get-started)- Tricentis Tosca [Tricentis Tosca](https://www.browserstack.com/docs/percy/tosca/get-started)- Build your own SDK [Build your own SDK](https://www.browserstack.com/docs/percy/build-your-own-SDK/get-started) --- # Source: https://www.browserstack.com/docs/percy/common-issue/common-errors/missing-percy-token [Skip to main content](#main-content)[Explore now](https://scanner.browserstack.com?utm_source=hello+bar&utm_medium=website)[Documentation](https://www.browserstack.com/docs/)[Ask the Community](https://www.browserstack.com/discord?ref=docsArticle&source=docs_article_page) # Error - Missing Percy token Learn how to fix missing Percy token error in Percy A Percy token is a unique, secure authentication key used to integrate Percy with your projects for visual testing and to authorize API requests. If you encounter an error likemissing PERCY_TOKEN, it means the Percy command was executed via CLI, SDK, or CI without setting the PERCY_TOKEN environment variable. This project token should be set in the environment. For more information, seeSet environment variables. `missing PERCY_TOKEN`[Set environment variables](https://www.browserstack.com/docs/percy/get-started/set-env-var#Percy_SDK)Need more support?Contact BrowserStack. [Contact BrowserStack](https://www.browserstack.com/contact?ref=docs) ## Reference Topic - Percy Common error messages [Percy Common error messages](https://www.browserstack.com/docs/percy/troubleshoot/percy-common-faqs#common-error-messages) #### We're sorry to hear that. Please share your feedback so we can do better Contact ourSupport teamfor immediate help while we work on improving our docs. [Support team](https://www.browserstack.com/support) #### We're continuously improving our docs. We'd love to know what you liked - This page has exactly what I am looking for - This content & code samples are accurate and up-to-date - The content on this page is easy to understand - Other (please tell us more below) Thank you for your valuable feedback - ON THIS PAGE Is this page helping you? [Support team](https://www.browserstack.com/support)Thank you for your valuable feedback! [Talk to an Expert](https://www.browserstack.com/contact?ref=docs-page-floating-contact)Welcome to Percy New to Percy? [View Documentation](https://www.browserstack.com/docs/percy/get-started-without-code-or-automation-script)Select your framework and language to proceed - Selenium - Playwright - Cypress [Cypress](https://www.browserstack.com/docs/percy/cypress/get-started)- Puppeteer [Puppeteer](https://www.browserstack.com/docs/percy/puppeteer/get-started)- Ember [Ember](https://www.browserstack.com/docs/percy/ember/get-started)- Storybook [Storybook](https://www.browserstack.com/docs/percy/storybook/get-started)- Gatsby [Gatsby](https://www.browserstack.com/docs/percy/gatsby/get-started)- Jekyll [Jekyll](https://www.browserstack.com/docs/percy/jekyll/get-started)- Appium [Appium](https://www.browserstack.com/docs/percy/appium/get-started)- Tricentis Tosca [Tricentis Tosca](https://www.browserstack.com/docs/percy/tosca/get-started)- Build your own SDK [Build your own SDK](https://www.browserstack.com/docs/percy/build-your-own-SDK/get-started) --- # Source: https://www.browserstack.com/docs/percy/common-issue/handling-csp [Skip to main content](#main-content)[Explore now](https://scanner.browserstack.com?utm_source=hello+bar&utm_medium=website)[Documentation](https://www.browserstack.com/docs/)[Ask the Community](https://www.browserstack.com/discord?ref=docsArticle&source=docs_article_page) # Disable CSP for precise screenshots Learn how to use percyScreenshot for CSP enabled websites. Content Security Policy (CSP) is a browser security feature that restricts the loading of external resources on a webpage to prevent potential security vulnerabilities. To ensure thatpercyScreenshotcan capture accurate and complete screenshots, it is necessary to temporarily disable CSP. When taking screenshots, certain external resources are required, and disabling CSP facilitates the proper functioning ofpercyScreenshot. `percyScreenshot``percyScreenshot`Once the screenshots are taken, it is advisable to re-enable CSP to maintain the overall security of the website. Need more support?Contact BrowserStack. [Contact BrowserStack](https://www.browserstack.com/contact?ref=docs) ## Reference Topic - Percy Common - FAQs [Percy Common - FAQs](https://www.browserstack.com/docs/percy/troubleshoot/percy-common-faqs) #### We're sorry to hear that. Please share your feedback so we can do better Contact ourSupport teamfor immediate help while we work on improving our docs. [Support team](https://www.browserstack.com/support) #### We're continuously improving our docs. We'd love to know what you liked - This page has exactly what I am looking for - This content & code samples are accurate and up-to-date - The content on this page is easy to understand - Other (please tell us more below) Thank you for your valuable feedback - ON THIS PAGE Is this page helping you? [Support team](https://www.browserstack.com/support)Thank you for your valuable feedback! [Talk to an Expert](https://www.browserstack.com/contact?ref=docs-page-floating-contact)Welcome to Percy New to Percy? [View Documentation](https://www.browserstack.com/docs/percy/get-started-without-code-or-automation-script)Select your framework and language to proceed - Selenium - Playwright - Cypress [Cypress](https://www.browserstack.com/docs/percy/cypress/get-started)- Puppeteer [Puppeteer](https://www.browserstack.com/docs/percy/puppeteer/get-started)- Ember [Ember](https://www.browserstack.com/docs/percy/ember/get-started)- Storybook [Storybook](https://www.browserstack.com/docs/percy/storybook/get-started)- Gatsby [Gatsby](https://www.browserstack.com/docs/percy/gatsby/get-started)- Jekyll [Jekyll](https://www.browserstack.com/docs/percy/jekyll/get-started)- Appium [Appium](https://www.browserstack.com/docs/percy/appium/get-started)- Tricentis Tosca [Tricentis Tosca](https://www.browserstack.com/docs/percy/tosca/get-started)- Build your own SDK [Build your own SDK](https://www.browserstack.com/docs/percy/build-your-own-SDK/get-started) --- # Source: https://www.browserstack.com/docs/percy/common-issue/hover-state [Skip to main content](#main-content)[Explore now](https://scanner.browserstack.com?utm_source=hello+bar&utm_medium=website)[Documentation](https://www.browserstack.com/docs/)[Ask the Community](https://www.browserstack.com/discord?ref=docsArticle&source=docs_article_page) # Hover state not captured in screenshots Understand why hover states are not captured in Percy Web screenshots. When you use Percy on a local web browser, hovering over an element highlights the text as expected. However, Percy does not capture the highlighted (hover) state in the screenshot. This occurs because Percy Web does not support capturing hover states. Any visual changes triggered by hover interactions, such as text highlighting, color changes, or tooltips do not appear in the screenshots. Need more support?Contact BrowserStack. [Contact BrowserStack](https://www.browserstack.com/contact?ref=docs) ## Reference Topic - Percy Common - FAQs [Percy Common - FAQs](https://www.browserstack.com/docs/percy/troubleshoot/percy-common-faqs) #### We're sorry to hear that. Please share your feedback so we can do better Contact ourSupport teamfor immediate help while we work on improving our docs. [Support team](https://www.browserstack.com/support) #### We're continuously improving our docs. We'd love to know what you liked - This page has exactly what I am looking for - This content & code samples are accurate and up-to-date - The content on this page is easy to understand - Other (please tell us more below) Thank you for your valuable feedback - ON THIS PAGE Is this page helping you? [Support team](https://www.browserstack.com/support)Thank you for your valuable feedback! [Talk to an Expert](https://www.browserstack.com/contact?ref=docs-page-floating-contact)Welcome to Percy New to Percy? [View Documentation](https://www.browserstack.com/docs/percy/get-started-without-code-or-automation-script)Select your framework and language to proceed - Selenium - Playwright - Cypress [Cypress](https://www.browserstack.com/docs/percy/cypress/get-started)- Puppeteer [Puppeteer](https://www.browserstack.com/docs/percy/puppeteer/get-started)- Ember [Ember](https://www.browserstack.com/docs/percy/ember/get-started)- Storybook [Storybook](https://www.browserstack.com/docs/percy/storybook/get-started)- Gatsby [Gatsby](https://www.browserstack.com/docs/percy/gatsby/get-started)- Jekyll [Jekyll](https://www.browserstack.com/docs/percy/jekyll/get-started)- Appium [Appium](https://www.browserstack.com/docs/percy/appium/get-started)- Tricentis Tosca [Tricentis Tosca](https://www.browserstack.com/docs/percy/tosca/get-started)- Build your own SDK [Build your own SDK](https://www.browserstack.com/docs/percy/build-your-own-SDK/get-started) --- # Source: https://www.browserstack.com/docs/percy/common-issue/lazy-loading-elements [Skip to main content](#main-content)[Explore now](https://scanner.browserstack.com?utm_source=hello+bar&utm_medium=website)[Documentation](https://www.browserstack.com/docs/)[Ask the Community](https://www.browserstack.com/discord?ref=docsArticle&source=docs_article_page) # Capturing lazy-loaded elements in Percy snapshots Learn how to use beforeSnapshot option to scroll and capture lazy-loaded elements. Lazy-loaded elements (for example: a footer logo) are not captured in Percy snapshots when using thesnapshotcommand without a test browser. This happens because the asset-discovery browser doesn’t scroll, so elements outside the initial viewport are not requested or loaded. WhilewaitForSelectorandwindow.scrollTowork in test or renderer browsers, they don’t affect the asset-discovery browser. `snapshot``waitForSelector``window.scrollTo`To address this, use thebeforeSnapshotoption in yoursnapshots.ymlfile to scroll the page in the asset-discovery browser before the snapshot is taken. This ensures that lazy-loaded elements enter the viewport and get captured correctly. `beforeSnapshot``snapshots.yml`This scrolls to the bottom of the page before Percy captures the snapshot, allowing lazy-loaded elements like footer logos to load and appear correctly. Need more support?Contact BrowserStack. [Contact BrowserStack](https://www.browserstack.com/contact?ref=docs) ## Reference Topic - Percy Common - FAQs [Percy Common - FAQs](https://www.browserstack.com/docs/percy/troubleshoot/percy-common-faqs) #### We're sorry to hear that. Please share your feedback so we can do better Contact ourSupport teamfor immediate help while we work on improving our docs. [Support team](https://www.browserstack.com/support) #### We're continuously improving our docs. We'd love to know what you liked - This page has exactly what I am looking for - This content & code samples are accurate and up-to-date - The content on this page is easy to understand - Other (please tell us more below) Thank you for your valuable feedback - ON THIS PAGE Is this page helping you? [Support team](https://www.browserstack.com/support)Thank you for your valuable feedback! [Talk to an Expert](https://www.browserstack.com/contact?ref=docs-page-floating-contact)Welcome to Percy New to Percy? [View Documentation](https://www.browserstack.com/docs/percy/get-started-without-code-or-automation-script)Select your framework and language to proceed - Selenium - Playwright - Cypress [Cypress](https://www.browserstack.com/docs/percy/cypress/get-started)- Puppeteer [Puppeteer](https://www.browserstack.com/docs/percy/puppeteer/get-started)- Ember [Ember](https://www.browserstack.com/docs/percy/ember/get-started)- Storybook [Storybook](https://www.browserstack.com/docs/percy/storybook/get-started)- Gatsby [Gatsby](https://www.browserstack.com/docs/percy/gatsby/get-started)- Jekyll [Jekyll](https://www.browserstack.com/docs/percy/jekyll/get-started)- Appium [Appium](https://www.browserstack.com/docs/percy/appium/get-started)- Tricentis Tosca [Tricentis Tosca](https://www.browserstack.com/docs/percy/tosca/get-started)- Build your own SDK [Build your own SDK](https://www.browserstack.com/docs/percy/build-your-own-SDK/get-started) --- # Source: https://www.browserstack.com/docs/percy/common-issue/proxy-requests [Skip to main content](#main-content)[Explore now](https://scanner.browserstack.com?utm_source=hello+bar&utm_medium=website)[Documentation](https://www.browserstack.com/docs/)[Ask the Community](https://www.browserstack.com/discord?ref=docsArticle&source=docs_article_page) # Configuring Proxy Requests The role and benefits of proxying requests during the visual testing process. #### To Percy’s API Percy’s SDKs implement the industry convention for proxying requests viaHTTP_PROXY,HTTPS_PROXY, andNO_PROXYenvironment variables. `HTTP_PROXY``HTTPS_PROXY``NO_PROXY` ``` # unix example, set the env variable the way your OS/System expects $ export HTTP_PROXY=http://a-proxy.example.com:1234 $ export HTTPS_PROXY=https://another-proxy.example.com:1234 # general syntax for setting proxy $ export HTTPS_PROXY=https://username:password@proxyurl:proxyport $ export NO_PROXY=http://example.com:1234 ``` ``` # windows example, set the env variable the way your OS/System expects > $Env::HTTP_PROXY = 'http://a-proxy.example.com:1234' > $Env::HTTPS_PROXY = 'https://another-proxy.example.com:1234' # general syntax for setting proxy > $Env::HTTPS_PROXY = 'https://username:password@proxyurl:proxyport' > $Env::NO_PROXY = 'http://example.com:1234' ``` ``` # windows example, set the env variable the way your OS/System expects $ set HTTP_PROXY=http://a-proxy.example.com:1234 $ set HTTPS_PROXY=https://another-proxy.example.com:1234 # general syntax for setting proxy $ set HTTPS_PROXY=https://username:password@proxyurl:proxyport $ set NO_PROXY=http://example.com:1234 ``` By default, the values are set to empty. #### Asset discovery If you need to proxy requests that occur in asset discovery, you may need to pass a--proxy-serverCLI flag as a browser launch argument in the Percydiscoveryconfiguration. `--proxy-server``discovery`Need more support?Contact BrowserStack. [Contact BrowserStack](https://www.browserstack.com/contact?ref=docs) ## Reference Topic - Percy Common - FAQs [Percy Common - FAQs](https://www.browserstack.com/docs/percy/troubleshoot/percy-common-faqs) #### We're sorry to hear that. Please share your feedback so we can do better Contact ourSupport teamfor immediate help while we work on improving our docs. [Support team](https://www.browserstack.com/support) #### We're continuously improving our docs. We'd love to know what you liked - This page has exactly what I am looking for - This content & code samples are accurate and up-to-date - The content on this page is easy to understand - Other (please tell us more below) Thank you for your valuable feedback - ON THIS PAGE Is this page helping you? [Support team](https://www.browserstack.com/support)Thank you for your valuable feedback! [Talk to an Expert](https://www.browserstack.com/contact?ref=docs-page-floating-contact)Welcome to Percy New to Percy? [View Documentation](https://www.browserstack.com/docs/percy/get-started-without-code-or-automation-script)Select your framework and language to proceed - Selenium - Playwright - Cypress [Cypress](https://www.browserstack.com/docs/percy/cypress/get-started)- Puppeteer [Puppeteer](https://www.browserstack.com/docs/percy/puppeteer/get-started)- Ember [Ember](https://www.browserstack.com/docs/percy/ember/get-started)- Storybook [Storybook](https://www.browserstack.com/docs/percy/storybook/get-started)- Gatsby [Gatsby](https://www.browserstack.com/docs/percy/gatsby/get-started)- Jekyll [Jekyll](https://www.browserstack.com/docs/percy/jekyll/get-started)- Appium [Appium](https://www.browserstack.com/docs/percy/appium/get-started)- Tricentis Tosca [Tricentis Tosca](https://www.browserstack.com/docs/percy/tosca/get-started)- Build your own SDK [Build your own SDK](https://www.browserstack.com/docs/percy/build-your-own-SDK/get-started) --- # Source: https://www.browserstack.com/docs/percy/cypress/getting-started/integrate-your-tests [Skip to main content](#main-content)[Explore now](https://scanner.browserstack.com?utm_source=hello+bar&utm_medium=website)[Documentation](https://www.browserstack.com/docs/)[Ask the Community](https://www.browserstack.com/discord?ref=docsArticle&source=docs_article_page) # Integrate your Cypress tests with Percy A guide to integrating your Cypress automated tests with BrowserStack Percy. Catch visual differences in your web application on time. Percy integrates with your tests through both Percy and Automate TurboScale using BrowserStack Cypress CLI. To set up the integration, select the appropriate section and follow the instructions provided. This documentation applies to Percy Cypress SDK version 3.0.0 and above. Integrate Percy with your test suite to run visual tests. To do that, follow these steps: Create a Percy projectSign in toPercy. In Percy, create a project of the type, Web, and then name the project. After the project is created, Percy generates a token. Make a note of it. You have to use it set your environment variable in the next step. [Sign in to](https://percy.io/signup)For details on creating a project, seeCreate a Percy project. [Create a Percy project](https://www.browserstack.com/docs/percy/get-started/create-project)Set the project token as an environment variableRun the given command to set PERCY_TOKEN as an environment variable: To learn about environment variables in Percy, seePercy environment variables. [Percy environment variables](https://www.browserstack.com/docs/percy/get-started/set-env-var)Install Percy dependenciesInstall the components required to establish the integration environment for your test suite. To install the dependencies, run the following command: Update your test script Import the Percy library to use the method and attributes required to take screenshots. In order to add Percy snapshots to your Cypress tests, you have to first import the@percy/cypresspackage into yourcypress/support/e2e.jsfile: `@percy/cypress``cypress/support/e2e.js`If you’re usingTypeScript, include"types": ["cypress", "@percy/cypress"]in yourtsconfig.jsonfile. `TypeScript``"types": ["cypress", "@percy/cypress"]``tsconfig.json`This gives you access to the Percy snapshot command in any of your Cypress tests, viacy.percySnapshot(). You can now incorporate visual tests in your existing suite: `cy.percySnapshot()`The snapshot method arguments are: - name- The snapshot name; must be unique to each snapshot; defaults to the test title `name`- options-See per-snapshot configuration options `options`[See per-snapshot configuration options](https://www.browserstack.com/docs/percy/take-percy-snapshots/snapshots-via-scripts#per-snapshot-configuration)For example: To learn more, seePercy snapshot. [Percy snapshot](https://www.browserstack.com/docs/percy/take-percy-snapshots/overview)Run PercyRun your tests using thepercy execcommand as shown below: [percy exec](https://github.com/percy/cli/tree/master/packages/cli-exec#percy-exec)`percy exec`If you are unable to use thepercy:execcommand or prefer to run your tests using IDE run options, you can use thepercy exec:startandpercy exec:stopcommands. To learn more, visitRun Percy. `percy:exec``percy exec:start``percy exec:stop`[Run Percy](https://www.browserstack.com/docs/percy/take-percy-snapshots/snapshots-via-scripts#commands)–> ### Congratulations! You have successfully created your first build on Percy. To see the build with snapshots of your application, visit your project in Percy.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. ## Advanced topics ### Percy Snapshot command In the preceding steps, we used the Percy Snapshot command for capturing snapshots. Percy provides various configurations to use with Percy snapshot command. To learn more visit,Percy snapshot command. [Percy snapshot command](https://www.browserstack.com/docs/percy/take-percy-snapshots/overview) ### Base build selection By default, Percy uses the previous build for comparison however, you always have the option to configure the base build for comparison as needed. To learn more, visitbase build selection logic. [base build selection logic](https://www.browserstack.com/docs/percy/base-selection/base-build) ## Related topics - Simplify Percy CLI setup with executables [Simplify Percy CLI setup with executables](https://www.browserstack.com/docs/percy/common-issue/percy-executable)- Migrate to Percy CLI [Migrate to Percy CLI](https://www.browserstack.com/docs/percy/migration/migrate-to-cli)- Snapshot vs Screenshot [Snapshot vs Screenshot](https://www.browserstack.com/docs/percy/overview/basics#screenshots-and-snapshots)- CI/CD [CI/CD](https://www.browserstack.com/docs/percy/ci-cd/overview)In this tutorial, we will use Cypress’ Kitchen Sink sample app to run our tests. It is an example app provided by Cypress to learn how Cypress works. This integration works exclusively with BrowserStack TurboScale when used with Percy. When running tests on standard BrowserStack Automate, Percy does not work with the BrowserStack Cypress CLI. ## Prerequisites - Ensure that you understandCypress fundamentalsand how Cypress runs tests [Cypress fundamentals](https://www.cypress.io/how-it-works)- Cypress version 13.10 - BrowserStack Username and Access key, which you can find in youraccount settings. If you have not created an account yet, you cansign up for a Free Trialorpurchase a plan [account settings](https://www.browserstack.com/accounts/settings)[sign up for a Free Trial](https://www.browserstack.com/users/sign_up)[purchase a plan](https://www.browserstack.com/pricing)- NodeJSversion 20.9 [NodeJS](https://nodejs.org/en/download/) ## Run your first test Perform the following steps to run Cypress tests with Automate Turboscale using the sample Kitchen Sink project. ### Create a Percy project Sign in toPercy. In Percy, create a project of the type, Web, and then name the project. After the project is created, Percy generates a token. Make a note of it. You have to use it to set your environment variable in the next step. [Sign in to](https://percy.io/signup)[Create a Percy project](https://www.browserstack.com/docs/percy/get-started/create-project) ### Set the project token as an environment variable Run the given command to set PERCY_TOKEN as an environment variable: [Percy environment variables](https://www.browserstack.com/docs/percy/get-started/set-env-var) ### Install Percy and BrowserStack Cypress CLI dependencies Install the components required to establish the integration environment for your test suite. ``` # Install the BrowserStack Cypress CLI npm install -g browserstack-cypress-cli # Install the Percy and Cypress CLI npm install --save-dev @percy/cypress ``` ### Create the configuration file Create and configure thebrowserstack.jsonfile which contains configurations, such as BrowserStack credentials, capabilities, etc., that are required for running the tests. Use the followinginitcommand to initialize the app project folder and create a boilerplatebrowserstack.jsonfile: `browserstack.json``init``browserstack.json` ``` browserstack-cypress init ``` `browserstack-cypress init`After thebrowserstack.jsonfile is created, modify or add the mandatory configurations that are required to run the Cypress test as shown in the following sample code. The mandatory configurations are BrowserStack credentials, Turboscale parameters, Cypress configuration file, browser-device combinations, and the number of parallels: `browserstack.json` ``` // browserstack.json { "auth": { "username": "YOUR_USERNAME", "access_key": "YOUR_ACCESS_KEY" }, "browsers": [{ "browser": "chrome", "os": "linux", "versions": "latest" } ], "run_settings": { "cypress_config_file": "./cypress.config.js", "project_name": "new-project", "build_name": "new-build", "exclude": [], "parallels": "2", "system_env_vars": ["PERCY_TOKEN"] "npm_dependencies": { "react": "^18.2.0", "react-dom": "^18.2.0", "react-modal": "^3.16.1", "react-router-dom": "^6.15.0", "@percy/cypress": "^3.1.6" }, "record": true, "record-key": "87b774c4-a373-43fa-986e-0833a55dc6d7", "projectId": "2m6i88", "package_config_options": {}, "headless": true, "turboScale": true, "turboScaleOptions": { "gridName": "turboscale-trial-grid" } }, "disable_usage_reporting": true } ``` In the above sample code snippet, the following parameters are mandatory to run the test: - username,access_key `username``access_key`- browser,os `browser`- projectId,turboScale `projectId``turboScale`- PERCY_TOKEN `PERCY_TOKEN`For more information, seeRun your first Cypress test with Automate Turboscale. [Run your first Cypress test with Automate Turboscale](https://www.browserstack.com/docs/automate-turboscale/integrate-with-self-hosted-solution/cypress)`@percy/cypress``cypress/support/e2e.js``TypeScript``"types": ["cypress", "@percy/cypress"]``tsconfig.json``cy.percySnapshot()``name``options`[See per-snapshot configuration options](https://www.browserstack.com/docs/percy/take-percy-snapshots/snapshots-via-scripts#per-snapshot-configuration) ### Run tests Run the test using the following command: ``` npx browserstack-cypress run ``` `npx browserstack-cypress run` ## View your test results After you run your test, review visual changes in yourPercy project builds. ## Advanced scenario If you run tests across multiple browsers or use parallels, set thePERCY_PARALLEL_TOTALandPERCY_PARALLEL_NONCEenvironment variableso Percy knows how many parallel workers to expect, and which parallels to combine into a single build. For more information, see theParallel test suites. `PERCY_PARALLEL_TOTAL``PERCY_PARALLEL_NONCE`[environment variable](https://www.browserstack.com/docs/percy/get-started/set-env-var)[Parallel test suites](https://www.browserstack.com/docs/percy/integrate/parallel-test-suites)You must both export and setPERCY_PARALLEL_NONCEandPERCY_TOKENin the config file. `PERCY_PARALLEL_NONCE``PERCY_TOKEN` ### Example If you run tests with2 parallelsacross3 browsers, set:PERCY_PARALLEL_TOTAL=6andPERCY_PARALLEL_NONCE=12345. `PERCY_PARALLEL_TOTAL=6``PERCY_PARALLEL_NONCE=12345` #### We're sorry to hear that. Please share your feedback so we can do better Contact ourSupport teamfor immediate help while we work on improving our docs. [Support team](https://www.browserstack.com/support) #### We're continuously improving our docs. We'd love to know what you liked - This page has exactly what I am looking for - This content & code samples are accurate and up-to-date - The content on this page is easy to understand - Other (please tell us more below) Thank you for your valuable feedback - ON THIS PAGE Is this page helping you? [Support team](https://www.browserstack.com/support)Thank you for your valuable feedback! [Talk to an Expert](https://www.browserstack.com/contact?ref=docs-page-floating-contact)Welcome to Percy New to Percy? [View Documentation](https://www.browserstack.com/docs/percy/get-started-without-code-or-automation-script)Select your framework and language to proceed - Selenium - Playwright - Cypress [Cypress](https://www.browserstack.com/docs/percy/cypress/get-started)- Puppeteer [Puppeteer](https://www.browserstack.com/docs/percy/puppeteer/get-started)- Ember [Ember](https://www.browserstack.com/docs/percy/ember/get-started)- Storybook [Storybook](https://www.browserstack.com/docs/percy/storybook/get-started)- Gatsby [Gatsby](https://www.browserstack.com/docs/percy/gatsby/get-started)- Jekyll [Jekyll](https://www.browserstack.com/docs/percy/jekyll/get-started)- Appium [Appium](https://www.browserstack.com/docs/percy/appium/get-started)- Tricentis Tosca [Tricentis Tosca](https://www.browserstack.com/docs/percy/tosca/get-started)- Build your own SDK [Build your own SDK](https://www.browserstack.com/docs/percy/build-your-own-SDK/get-started) --- # Source: https://www.browserstack.com/docs/percy/cypress/getting-started [Skip to main content](#main-content)[Explore now](https://scanner.browserstack.com?utm_source=hello+bar&utm_medium=website)[Documentation](https://www.browserstack.com/docs/)[Ask the Community](https://www.browserstack.com/discord?ref=docsArticle&source=docs_article_page) # Run a sample Percy build with Cypress Get hands-on experience on running Percy with Cypress using our sample repository ## Prerequisites Before you start, ensure that you have the following installed: - Node 14 or later [Node 14 or later](https://nodejs.dev/en/download/)- Git [Git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git)Follow these steps to clone the sample web application, run a build, and view the results of the visual comparison: Clone the sample applicationClone theexample-percy-cypressapplication, change the directory, and compile the sample application by running these commands: `example-percy-cypress`You can explore the sample application by opening thesrc/main/resources/index.htmlfile. `src/main/resources/index.html`Create a Percy projectTo create a project, follow these steps: - Sign into Percy. [Sign in](https://percy.io/signup)- In Percy, create a project of the type, Web. - Name the project. After the project is created, Percy generates a token. - Note down the token. You have to use it to set your environment variable in the next step. For details on creating a project, seeCreate a Percy project. [Create a Percy project](https://www.browserstack.com/docs/percy/get-started/create-project)Set the project token as an environment variableRun the given command to setPERCY_TOKENas an environment variable: `PERCY_TOKEN`To learn about environment variables in Percy, seePercy environment variables. [Percy environment variables](https://www.browserstack.com/docs/percy/get-started/set-env-var)Generate the first buildIn this step, we run the sample test script to take a few snapshots using thepercy.snapshotmethod. The sample application contains an file in which the method is called. The goal is to have a visual build with which to compare a later build. [percy.snapshot](https://www.browserstack.com/docs/percy/take-percy-snapshots/overview)`percy.snapshot`On completion, you see logs from Percy confirming that the snapshots were successfully uploaded and a direct URL to the dashboard. There are no visual comparisons yet. Modify the sample application Edit thesrc/main/resources/index.htmlfile to introduce some visual changes. In our example, we are adding inline CSS to bold theClear Completedbutton on line 32 of the file. `src/main/resources/index.html`Commit your changes Commit the changes you made to the sample application by running the following command: Generate the second buildRun the test script again. This takes new screenshots of our modified application, uploads them to Percy, and compares them with the previous screenshots to show visual differences. View results - Open your project dashboard to view your builds. - Open the second build to view the visual differences in comparison to the first build. On the third pane, you see the screenshots from the first build on the left, and from the second, on the right. Percy highlights what’s changed visually in the application. Use the options on the screen toreview the changes on different browsers and widths. [review the changes on different browsers and widths.](https://www.browserstack.com/docs/percy/project-settings/cross-browser) ## Congratulations! You’ve successfully run the sample Percy build. As you’ve seen, Percy helps you capture visual differences in your application that go undetected with functional testing alone. This was just a sneak peek. Percy can do a lot more. To make the best out of it, integrate Percy with your test suite. To know more check out the related topics. ## Related topics - Integrate your test suite with Percy [Integrate your test suite with Percy](https://www.browserstack.com/docs/percy/integrate/overview)- Choose your base build selection strategy [Choose your base build selection strategy](https://www.browserstack.com/docs/percy/base-selection/base-build)- View Percy build results [View Percy build results](https://www.browserstack.com/docs/percy/build-results/approval) #### We're sorry to hear that. Please share your feedback so we can do better Contact ourSupport teamfor immediate help while we work on improving our docs. [Support team](https://www.browserstack.com/support) #### We're continuously improving our docs. We'd love to know what you liked - This page has exactly what I am looking for - This content & code samples are accurate and up-to-date - The content on this page is easy to understand - Other (please tell us more below) Thank you for your valuable feedback - ON THIS PAGE Is this page helping you? [Support team](https://www.browserstack.com/support)Thank you for your valuable feedback! [Talk to an Expert](https://www.browserstack.com/contact?ref=docs-page-floating-contact)Welcome to Percy New to Percy? [View Documentation](https://www.browserstack.com/docs/percy/get-started-without-code-or-automation-script)Select your framework and language to proceed - Selenium - Playwright - Cypress [Cypress](https://www.browserstack.com/docs/percy/cypress/get-started)- Puppeteer [Puppeteer](https://www.browserstack.com/docs/percy/puppeteer/get-started)- Ember [Ember](https://www.browserstack.com/docs/percy/ember/get-started)- Storybook [Storybook](https://www.browserstack.com/docs/percy/storybook/get-started)- Gatsby [Gatsby](https://www.browserstack.com/docs/percy/gatsby/get-started)- Jekyll [Jekyll](https://www.browserstack.com/docs/percy/jekyll/get-started)- Appium [Appium](https://www.browserstack.com/docs/percy/appium/get-started)- Tricentis Tosca [Tricentis Tosca](https://www.browserstack.com/docs/percy/tosca/get-started)- Build your own SDK [Build your own SDK](https://www.browserstack.com/docs/percy/build-your-own-SDK/get-started) --- # Source: https://www.browserstack.com/docs/percy/ember/getting-started [Skip to main content](#main-content)[Explore now](https://scanner.browserstack.com?utm_source=hello+bar&utm_medium=website)[Documentation](https://www.browserstack.com/docs/)[Ask the Community](https://www.browserstack.com/discord?ref=docsArticle&source=docs_article_page) # Run a sample Percy build with Ember Get hands-on experience on running Percy with Ember using our sample repository ## Prerequisites Before you start, ensure that you have the following installed: - Node 18 or later [Node 18 or later](https://nodejs.dev/en/download/)- Git [Git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git)Follow these steps to clone the sample web application, run a build, and view the results of the visual comparison: Clone the sample applicationClone theexample-percy-emberapplication, change the directory, and compile the sample application by running these commands: `example-percy-ember`You can explore the sample application by opening thesrc/main/resources/index.htmlfile. `src/main/resources/index.html`Create a Percy projectTo create a project, follow these steps: - Sign into Percy. [Sign in](https://percy.io/signup)- In Percy, create a project of the type, Web. - Name the project. After the project is created, Percy generates a token. - Note down the token. You have to use it to set your environment variable in the next step. For details on creating a project, seeCreate a Percy project. [Create a Percy project](https://www.browserstack.com/docs/percy/get-started/create-project)Set the project token as an environment variableRun the given command to setPERCY_TOKENas an environment variable: `PERCY_TOKEN`To learn about environment variables in Percy, seePercy environment variables. [Percy environment variables](https://www.browserstack.com/docs/percy/get-started/set-env-var)Generate the first buildIn this step, we run the sample test script to take a few snapshots using thepercy.snapshotmethod. The sample application contains an file in which the method is called. The goal is to have a visual build with which to compare a later build. [percy.snapshot](https://www.browserstack.com/docs/percy/take-percy-snapshots/overview)`percy.snapshot`On completion, you see logs from Percy confirming that the snapshots were successfully uploaded and a direct URL to the dashboard. There are no visual comparisons yet. Modify the sample application Edit theapp/templates/application.hbsfile to introduce some visual changes. In our example, we are adding inline CSS to bold theClear Completedbutton on line 18-20 of the file. `app/templates/application.hbs`Commit your changes Commit the changes you made to the sample application by running the following command: Generate the second buildRun the test script again. This takes new screenshots of our modified application, uploads them to Percy, and compares them with the previous screenshots to show visual differences. View results - Open your project dashboard to view your builds. - Open the second build to view the visual differences in comparison to the first build. On the third pane, you see the screenshots from the first build on the left, and from the second, on the right. Percy highlights what’s changed visually in the application. Use the options on the screen toreview the changes on different browsers and widths. [review the changes on different browsers and widths.](https://www.browserstack.com/docs/percy/project-settings/cross-browser) ## Congratulations! You’ve successfully run the sample Percy build. As you’ve seen, Percy helps you capture visual differences in your application that go undetected with functional testing alone. This was just a sneak peek. Percy can do a lot more. To make the best out of it, integrate Percy with your test suite. To know more check out the related topics. ## Related topics - Integrate your test suite with Percy [Integrate your test suite with Percy](https://www.browserstack.com/docs/percy/integrate/overview)- Choose your base build selection strategy [Choose your base build selection strategy](https://www.browserstack.com/docs/percy/base-selection/base-build)- View Percy build results [View Percy build results](https://www.browserstack.com/docs/percy/build-results/approval) #### We're sorry to hear that. Please share your feedback so we can do better Contact ourSupport teamfor immediate help while we work on improving our docs. [Support team](https://www.browserstack.com/support) #### We're continuously improving our docs. We'd love to know what you liked - This page has exactly what I am looking for - This content & code samples are accurate and up-to-date - The content on this page is easy to understand - Other (please tell us more below) Thank you for your valuable feedback - ON THIS PAGE Is this page helping you? [Support team](https://www.browserstack.com/support)Thank you for your valuable feedback! [Talk to an Expert](https://www.browserstack.com/contact?ref=docs-page-floating-contact)Welcome to Percy New to Percy? [View Documentation](https://www.browserstack.com/docs/percy/get-started-without-code-or-automation-script)Select your framework and language to proceed - Selenium - Playwright - Cypress [Cypress](https://www.browserstack.com/docs/percy/cypress/get-started)- Puppeteer [Puppeteer](https://www.browserstack.com/docs/percy/puppeteer/get-started)- Ember [Ember](https://www.browserstack.com/docs/percy/ember/get-started)- Storybook [Storybook](https://www.browserstack.com/docs/percy/storybook/get-started)- Gatsby [Gatsby](https://www.browserstack.com/docs/percy/gatsby/get-started)- Jekyll [Jekyll](https://www.browserstack.com/docs/percy/jekyll/get-started)- Appium [Appium](https://www.browserstack.com/docs/percy/appium/get-started)- Tricentis Tosca [Tricentis Tosca](https://www.browserstack.com/docs/percy/tosca/get-started)- Build your own SDK [Build your own SDK](https://www.browserstack.com/docs/percy/build-your-own-SDK/get-started) --- # Source: https://www.browserstack.com/docs/percy/figma/baseline-management [Skip to main content](#main-content)[Explore now](https://scanner.browserstack.com?utm_source=hello+bar&utm_medium=website)[Documentation](https://www.browserstack.com/docs/)[Ask the Community](https://www.browserstack.com/discord?ref=docsArticle&source=docs_article_page) # Baseline management for Figma comparison Learn how the baseline management works for Figma design comparisons and visual testing. Baseline management for Figma ensures consistent visual testing across different builds. By defining a stable baseline, you can track changes in your Figma designs and their impact on the visual quality. The baseline is typically established from a previous snapshot and serves as the reference for future comparisons. This page explains how baseline management works for Figma builds in the context of Git and Visual Git workflows. ## Git workflow - Builds B1 and B2 are created from the Master Build. - Build B3 consists of four snapshots, a, b, c, and d. - Build B4 builds upon B3 and includes six snapshots, a, b, c, d, e, and f. - Build B5 is a feature build from B3 and has three snapshots, a, b, and c. - Build B6 is a Figma build that has five snapshots, a, d, x, y, and z. - For Build B7, snapshots include a, b, c, and d. Snapshot ‘a’ and ‘d’ use B6 (the Figma build) as their baseline, while snapshots ‘b’ and ‘c’ use the last approved build as their baseline. ## Visual Git workflow - Buildes B1 and B2 are created from the Master Build. - Build B7 has four snapshots, a, b, c, and d. Snapshots ‘a’ and ‘d’ use Build B6, the Figma build, as their baseline, while snapshots ‘b’ and ‘c’ use the last approved build as their baseline. - Build B8 continues from Build B7 and inherits its baseline. Build B8 contains one snapshot, ‘a’. - Build B9 has three snapshots, a, c, and d. Snapshot ‘a’ uses Build B8 as the baseline, while snapshots ‘c’ and ‘d’ use the last approved snapshots for ‘c’ and ‘d’ as their baseline. ## Related topic - Git [Git](https://www.browserstack.com/docs/percy/baseline-management/git)- Visual Git [Visual Git](https://www.browserstack.com/docs/percy/baseline-management/visual-git) #### We're sorry to hear that. Please share your feedback so we can do better Contact ourSupport teamfor immediate help while we work on improving our docs. [Support team](https://www.browserstack.com/support) #### We're continuously improving our docs. We'd love to know what you liked - This page has exactly what I am looking for - This content & code samples are accurate and up-to-date - The content on this page is easy to understand - Other (please tell us more below) Thank you for your valuable feedback - ON THIS PAGE Is this page helping you? [Support team](https://www.browserstack.com/support)Thank you for your valuable feedback! [Talk to an Expert](https://www.browserstack.com/contact?ref=docs-page-floating-contact)Welcome to Percy New to Percy? [View Documentation](https://www.browserstack.com/docs/percy/get-started-without-code-or-automation-script)Select your framework and language to proceed - Selenium - Playwright - Cypress [Cypress](https://www.browserstack.com/docs/percy/cypress/get-started)- Puppeteer [Puppeteer](https://www.browserstack.com/docs/percy/puppeteer/get-started)- Ember [Ember](https://www.browserstack.com/docs/percy/ember/get-started)- Storybook [Storybook](https://www.browserstack.com/docs/percy/storybook/get-started)- Gatsby [Gatsby](https://www.browserstack.com/docs/percy/gatsby/get-started)- Jekyll [Jekyll](https://www.browserstack.com/docs/percy/jekyll/get-started)- Appium [Appium](https://www.browserstack.com/docs/percy/appium/get-started)- Tricentis Tosca [Tricentis Tosca](https://www.browserstack.com/docs/percy/tosca/get-started)- Build your own SDK [Build your own SDK](https://www.browserstack.com/docs/percy/build-your-own-SDK/get-started) --- # Source: https://www.browserstack.com/docs/percy/figma/configuration [Skip to main content](#main-content)[Explore now](https://scanner.browserstack.com?utm_source=hello+bar&utm_medium=website)[Documentation](https://www.browserstack.com/docs/)[Ask the Community](https://www.browserstack.com/discord?ref=docsArticle&source=docs_article_page) # Configure Figma designs Learn how to compare Figma designs with Percy for design comparisons and visual testing. To compare your Figma designs with your Percy build, follow these steps: - Figma recently enforced stricterAPI rate limits, which reduces the number of designs Percy can fetch. These limits are especially restrictive for accounts with only View access and often cause errors or failed builds. [API rate limits](https://developers.figma.com/docs/rest-api/rate-limits/)- For critical builds, grant Dev or Full access to our Figma service account (percy.figma@browserstack.com) to avoid rate limits and allow builds to complete. Step 1: Go to your project build and click theCompare with designsicon. - For Percy on Automate projects, you must create at least one successful build before creating a Figma build. Step 2: Make your Figma project public to allow access via a shared link. If the project must remain restricted, grant “edit” access topercy.figma@browserstack.com. `percy.figma@browserstack.com`If you experience errors due to Figma rate limits, grant “Dev” or “Full” access to our Figma service account. Wait for Percy to accept the Figma invite. This may take a few minutes. After waiting, check the invite status in Figma. If the invite has not been accepted, it will appear grayed out. Once accepted, it will be displayed in regular text asPercy. ClickContinue. Step 3: Enter the Figma link to import your designs. Enter a Percy branch name. You can select an existing branch name from the drop-down or create a new one. - The default base branch on Percy cannot be selected as the target branch for Figma builds. - For Percy on Automate projects, Figma retrieves device, browser, and width details from the last successful build on the specified branch. If no baseline build exists, it falls back to the last successful build on the default base branch. If that also doesn’t exist, it uses the most recent successful build. - You do not require a branch for your Figma designs inside the Figma tool. - Share the Figma file directly; do not invite to the project. Step 4: ClickImport designs. Your Figma designs load. Step 5: Select the desired Figma designs. By default, the system pre-selects the first 50 imported designs. You can import up to 50 designs per build. ClickNextto continue. Step 6: Rename or map your design to a snapshot name for comparison. You can either select an existing snapshot name from the list or provide a new one. Optionally, enable theUse design name as snapshot namecheckbox to automatically map snapshots. If no snapshot name is provided, Percy defaults to using the design name as the snapshot name. - Percy does not allow multiple designs with the same dimensions to be mapped to the same snapshot. - Unmapped designs will use the design name as the snapshot name. Map the test case name to your design. For more information, seeMap test cases. [Map test cases](https://www.browserstack.com/docs/percy/figma/testcase)Step 7: ClickSave and runto complete the process. A new build is triggered for the imported Figma designs. By default, the first Figma build is auto-approved. The next time you trigger a build, the review page displays snapshots for comparison. ## Manage Figma design updates When your Figma designs are updated, you can manually keep your Percy snapshots in sync using the Figma baseline update options when selecting a configured branch: - Update baseline: Refresh existing imported designs. - Import new + update baseline: Refresh existing designs and import new designs from your Figma file. ### Things to keep in mind - The baseline update options are available only when selecting a branch that already has Figma designs configured. - When frames are removed from your Figma file, Percy removes them from future builds during baseline updates. ## Related topic - Baseline management for Figma comparison [Baseline management for Figma comparison](https://www.browserstack.com/docs/percy/figma/baseline-management)- Upload Figma images to Percy via CLI [Upload Figma images to Percy via CLI](https://www.browserstack.com/docs/percy/references/upload-figma-images) #### We're sorry to hear that. Please share your feedback so we can do better Contact ourSupport teamfor immediate help while we work on improving our docs. [Support team](https://www.browserstack.com/support) #### We're continuously improving our docs. We'd love to know what you liked - This page has exactly what I am looking for - This content & code samples are accurate and up-to-date - The content on this page is easy to understand - Other (please tell us more below) Thank you for your valuable feedback - ON THIS PAGE Is this page helping you? [Support team](https://www.browserstack.com/support)Thank you for your valuable feedback! [Talk to an Expert](https://www.browserstack.com/contact?ref=docs-page-floating-contact)Welcome to Percy New to Percy? [View Documentation](https://www.browserstack.com/docs/percy/get-started-without-code-or-automation-script)Select your framework and language to proceed - Selenium - Playwright - Cypress [Cypress](https://www.browserstack.com/docs/percy/cypress/get-started)- Puppeteer [Puppeteer](https://www.browserstack.com/docs/percy/puppeteer/get-started)- Ember [Ember](https://www.browserstack.com/docs/percy/ember/get-started)- Storybook [Storybook](https://www.browserstack.com/docs/percy/storybook/get-started)- Gatsby [Gatsby](https://www.browserstack.com/docs/percy/gatsby/get-started)- Jekyll [Jekyll](https://www.browserstack.com/docs/percy/jekyll/get-started)- Appium [Appium](https://www.browserstack.com/docs/percy/appium/get-started)- Tricentis Tosca [Tricentis Tosca](https://www.browserstack.com/docs/percy/tosca/get-started)- Build your own SDK [Build your own SDK](https://www.browserstack.com/docs/percy/build-your-own-SDK/get-started) --- # Source: https://www.browserstack.com/docs/percy/figma/overview [Skip to main content](#main-content)[Explore now](https://scanner.browserstack.com?utm_source=hello+bar&utm_medium=website)[Documentation](https://www.browserstack.com/docs/)[Ask the Community](https://www.browserstack.com/discord?ref=docsArticle&source=docs_article_page) # Figma designs comparison Use Percy with Figma designs for visual comparison. Percy’s support to configure Figma designs enables you to validate designs and detect visual discrepancies. It streamlines your design-to-development process by providing: - Real-time screenshot comparisons for pixel-perfect accuracy. - One-click setup to link Figma to Percy. - Preview and interactive modes for design comparison. - Collaborate with stakeholders and request changes and approvals. New to Percy? Get started by creating a Percy project. For more information, seeCreate a Project. Once your project is created & build is triggered you are ready to perform visual testing with Percy. [Create a Project](https://www.browserstack.com/docs/percy/get-started/create-project) ## High-level steps - Upload Figma design file link. - Map the snapshots with the required build snapshots. - Compare designs and validate visual differences. - For Percy on Automate projects, you must create at least one successful build before creating a Figma build. - For Percy on Automate projects, resizing uses the baseline snapshot’s width from your Automate session. The height is taken from the Figma design to support full-page screenshots. - The allowed width for the snapshots is between 120px and 2000px (inclusive). - For Percy Web projects, ensure the snapshot width matches the design. For more information, seeset the snapshot width using the CLI. [set the snapshot width using the CLI](https://www.browserstack.com/docs/percy/take-percy-snapshots/overview#configuration-file)- Designs of the following node types are excluded: [CANVAS, SECTION, COMPONENT_SET, RECTANGLE, VECTOR, GROUP, DOCUMENT, TEXT, LINE]. - If excluded nodes have nested designs, Percy attempts to retrieve relevant children, tracing up to 3 levels deep. ## Explore further - Configure Figma designs [Configure Figma designs](https://www.browserstack.com/docs/percy/figma/configuration)- Baseline management for Figma comparison [Baseline management for Figma comparison](https://www.browserstack.com/docs/percy/figma/baseline-management) #### We're sorry to hear that. Please share your feedback so we can do better Contact ourSupport teamfor immediate help while we work on improving our docs. [Support team](https://www.browserstack.com/support) #### We're continuously improving our docs. We'd love to know what you liked - This page has exactly what I am looking for - This content & code samples are accurate and up-to-date - The content on this page is easy to understand - Other (please tell us more below) Thank you for your valuable feedback - ON THIS PAGE Is this page helping you? [Support team](https://www.browserstack.com/support)Thank you for your valuable feedback! [Talk to an Expert](https://www.browserstack.com/contact?ref=docs-page-floating-contact)Welcome to Percy New to Percy? [View Documentation](https://www.browserstack.com/docs/percy/get-started-without-code-or-automation-script)Select your framework and language to proceed - Selenium - Playwright - Cypress [Cypress](https://www.browserstack.com/docs/percy/cypress/get-started)- Puppeteer [Puppeteer](https://www.browserstack.com/docs/percy/puppeteer/get-started)- Ember [Ember](https://www.browserstack.com/docs/percy/ember/get-started)- Storybook [Storybook](https://www.browserstack.com/docs/percy/storybook/get-started)- Gatsby [Gatsby](https://www.browserstack.com/docs/percy/gatsby/get-started)- Jekyll [Jekyll](https://www.browserstack.com/docs/percy/jekyll/get-started)- Appium [Appium](https://www.browserstack.com/docs/percy/appium/get-started)- Tricentis Tosca [Tricentis Tosca](https://www.browserstack.com/docs/percy/tosca/get-started)- Build your own SDK [Build your own SDK](https://www.browserstack.com/docs/percy/build-your-own-SDK/get-started) --- # Source: https://www.browserstack.com/docs/percy/gatsby/getting-started # Redirecting… [Click here if you are not redirected.](https://www.browserstack.com/docs/percy/gatsby/getting-started/integrate-your-tests) --- # Source: https://www.browserstack.com/docs/percy/get-started/first-percy-build # Redirecting… [Click here if you are not redirected.](https://www.browserstack.com/docs/percy/get-started-without-code-or-automation-script/first-percy-build) --- # Source: https://www.browserstack.com/docs/percy/get-started # Redirecting… [Click here if you are not redirected.](https://www.browserstack.com/docs/percy/get-started-with-automated-script) --- # Source: https://www.browserstack.com/docs/percy/integrate/overview # Redirecting… [Click here if you are not redirected.](https://www.browserstack.com/docs/percy/integrate/percy-with-browserstack-sdk#Percy_SDK) --- # Source: https://www.browserstack.com/docs/percy/integrate/percy-sdk-workflow [Skip to main content](#main-content)[Explore now](https://scanner.browserstack.com?utm_source=hello+bar&utm_medium=website)[Documentation](https://www.browserstack.com/docs/)[Ask the Community](https://www.browserstack.com/discord?ref=docsArticle&source=docs_article_page) # Percy SDK and screenshot capture workflow This guide explains how the Percy infrastructure works with SDKs To debug Percy builds, a comprehensive understanding of Percy’s workflow, spanning from SDKs to screenshot capture, is essential. This document explains the operations of both the SDKs and the Percy infrastructure. At a high level, Percy works by capturing a snapshot of the DOM within the test browser. Subsequently, the DOM is transmitted to Percy’s API to be concurrently rendered across various browsers and widths for screenshots. The SDKs are responsible for capturing the DOM and assets, while the APIs handle the proxying and rendering of these snapshots in browsers for screenshots. It is important to note that screenshots are not captured within your test suite but within Percy’s infrastructure. ## How SDKs work There are two major steps in the Percy SDK to know about: - Capturing the DOM state - Asset discovery WhenpercySnapshotis called, Percy’s SDKs capture the exact state of the DOM. The SDK serializes the current page state into the DOM by applying form element values, capturing CSSOM, including accessible iframes, and converting canvas elements into images. This process is handled by the@percy/dompackage. We serialize these elements because their state is stored in the page’s memory and is not encoded into the DOM. Without this serialization, that content would be missing from the snapshot. `percySnapshot`[@percy/dom](https://github.com/percy/cli/tree/master/packages/dom)- Firefox/Chromiumare the supported test browsers for capturing the DOM state. `Firefox/Chromium`- Shadow DOM capturing is currently supported only in the Chrome browser. This feature is unavailable on Firefox due to a lack of serialization support. ### Input elements Input elements (input, textarea, select) are serialized by setting respective DOM attributes to their matching JavaScript property counterparts. For example, checked, selected, and value. ### Frame elements Frame elements are serialized when they are CORS accessible and if they haven’t been built by JavaScript when JavaScript is enabled. They are serialized by recursively serializing the iframe’s document element with the@percy/domlibrary. `@percy/dom` ### CSSOM rules When JavaScript is not enabled, CSSOM rules are serialized by iterating over and appending each rule to a new stylesheet inserted into the document’s head. ### Canvas elements Canvas elements drawing buffers are serialized as data URIs and the canvas elements are replaced with image elements. The image elements reference the serialized data URI and have the same HTML attributes as their respective canvas elements. The image elements also have a max-width of 100% to accommodate responsive layouts in situations where canvases may be expected to resize with JS. ### Video elements Videos without a poster attribute undergo automatic serialization of the current frame, and the resulting image is set as theposterattribute. This ensures that videos consistently display a stable image when screenshots are captured. `poster`Once the DOM is captured & serialized, it gets sent to@percy/corefor asset discovery. Asset discovery renders the captured DOM in a Chromium browser, where the SDK intercepts all network requests the DOM makes. This captures assets needed to render the page in Percy’s infrastructure for a screenshot. By default, all assets served on the same hostname as the tests are captured. You can capture more hostnames with theallowed-hostnamesconfig key. Asset discovery also resizes the viewport to the passed widths to ensure assets are captured for the right screen sizes. `@percy/core`[allowed-hostnames](https://www.browserstack.com/docs/percy/take-percy-snapshots/overview#all-configuration-options)`allowed-hostnames`Asset discovery by default will wait100msfor no new network requests to be made by the captured DOM. Once that timeout has been reached asset discovery will close for the given snapshot. It’s not uncommon to have to increase thenetwork-idle-timeoutto allow for more network requests to be made. `100ms`[network-idle-timeout](https://www.browserstack.com/docs/percy/take-percy-snapshots/overview#all-configuration-options)`network-idle-timeout`Since Percy re-renders the DOM in a browser outside of your test suite, you may need to provide authentication to the requests this browser is making. Thediscoveryconfiguration key in Percy’s SDKs provides a few ways to authenticate requests like request-headers, authorization, and cookies. [discovery](https://www.browserstack.com/docs/percy/take-percy-snapshots/overview#all-configuration-options)`discovery`NOTEChromiumis supported browser for Asset discovery, we manage its ourselves in@percy/corepackage, you couldskip the asset discovery browser downloadby providing your own. `Chromium``@percy/core`[skip the asset discovery browser download](https://docs.percy.io/docs/skipping-asset-discovery-browser-download) ## How the infrastructure works With the DOM captured and the right assets gathered to render the page, it’s time to capture the screenshot. Percy re-renders the page concurrently across browsers/widths for screenshots. By default, Percy renders all snapshots with JavaScript disabled. This choice stems from the fact that JavaScript has already executed and modified the page before the DOM is captured. Although enabling JavaScript in Percy’s infrastructure is possible, it often leads to unexpected issues. Most web pages are not designed to handle rendering with an already fully formed DOM, potentially resulting in issues such as redirects or the loss of serialized states (clearing inputs, etc.). When the page is re-rendered, Percy modifies the captured DOM slightly to do things like remove