• Stars
    star
    321
  • Rank 130,752 (Top 3 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created about 6 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Visual testing with Cypress and Percy

@percy/cypress

Version Test

Percy visual testing for Cypress.

Installation

$ npm install --save-dev @percy/cli @percy/cypress

Then add to your cypress/support/index.js file

import '@percy/cypress'

Usage

This is an example using the cy.percySnapshot command.

describe('My app', () => {
  it('should look good', () => {
    cy.get('body').should('have.class', 'finished-loading');
    cy.percySnapshot();

    cy.get('button').click();
    cy.percySnapshot('Clicked button');
  });
});

Running the test above will result in the following log:

$ cypress run
...
[percy] Percy is not running, disabling snapshots

When running with percy exec, and your project's PERCY_TOKEN, a new Percy build will be created and snapshots will be uploaded to your project.

$ export PERCY_TOKEN=[your-project-token]
$ percy exec -- cypress run
[percy] Percy has started!
[percy] Created build #1: https://percy.io/[your-project]
[percy] Running "cypress run"
...
[percy] Snapshot taken "My app should look good"
[percy] Snapshot taken "Clicked button"
...
[percy] Stopping percy...
[percy] Finalized build #1: https://percy.io/[your-project]
[percy] Done!

Configuration

cy.percySnapshot([name][, options])

Upgrading

Automatically with @percy/migrate

We built a tool to help automate migrating to the new CLI toolchain! Migrating can be done by running the following commands and following the prompts:

$ npx @percy/migrate
? Are you currently using @percy/cypress? Yes
? Install @percy/cli (required to run percy)? Yes
? Migrate Percy config file? Yes
? Upgrade SDK to @percy/[email protected]? Yes

This will automatically run the changes described below for you.

Manually

Installing @percy/cli

If you're coming from a pre-3.0 version of this package, make sure to install @percy/cli after upgrading to retain any existing scripts that reference the Percy CLI command.

$ npm install --save-dev @percy/cli

Removing tasks

If you're coming from 2.x the health check task, @percy/cypress/task, is no longer needed and no longer exists. You should remove this task from your cypress/plugins/index.js file.

Migrating Config

If you have a previous Percy configuration file, migrate it to the newest version with the config:migrate command:

$ percy config:migrate

More Repositories

1

percy-storybook

Percy's Storybook SDK.
JavaScript
145
star
2

percy-ember

Ember addon for visual regression testing with Percy
JavaScript
70
star
3

cli

The Percy CLI is used to interact with, and upload snapshots to, percy.io via the command line.
JavaScript
60
star
4

example-percy-cypress

Example app demonstrating Percy's Cypress integration.
JavaScript
57
star
5

percy-puppeteer

Visual testing with Puppeteer and Percy
JavaScript
47
star
6

percy-capybara

Visual testing for Capybara with Percy.
Ruby
45
star
7

react-percy

[Deprecated]
JavaScript
32
star
8

percy-js

[Deprecated] JavaScript API client library for Percy.
JavaScript
31
star
9

percy-webdriverio

Visual testing with WebdriverIO and Percy
JavaScript
26
star
10

percy-style

Percy shared style configs.
Ruby
25
star
11

percy-agent

[Deprecated in favor of `@percy/cli`] An agent process for integrating with Percy.
HTML
22
star
12

python-percy-client

[Deprecated] Python client library for visual regression testing with Percy.
Python
21
star
13

percy-cli-ruby

[Deprecated] Command-line interface for Percy.
Ruby
19
star
14

snapshot-action

[Deprecated] A GitHub action to visually test static sites with Percy
SCSS
14
star
15

example-percyscript

The easiest way to get started with visual testing and Percy.
HTML
13
star
16

percy-playwright

Playwright client library for visual testing with Percy
JavaScript
12
star
17

percy-selenium-java

Visual testing with Java Selenium and Percy
Java
11
star
18

storybook-action

[Deprecated] A GitHub action to run Percy with Storybook
JavaScript
11
star
19

percy-selenium-python

Percy visual testing for Python Selenium
Python
10
star
20

percy-testcafe

TestCafe client library for visual regression testing with Percy
JavaScript
9
star
21

percy-appium-wd

Webdriver & Appium client library for visual regression testing with Percy
JavaScript
8
star
22

percy-client

Low-level Ruby API client for Percy.
Ruby
8
star
23

exec-action

A (deprecated) GitHub action to run Percy Agent `percy exec` commands
JavaScript
8
star
24

example-percy-puppeteer

Example app showing integration of Percy visual testing into Puppeteer tests.
JavaScript
7
star
25

percy-nightwatch

Visual testing with Nightwatch and Percy
JavaScript
6
star
26

example-rails

Example app for Percy's Rails tutorial.
Ruby
5
star
27

example-percy-nightwatch

Example app demonstrating Percy's Nightwatch integration.
JavaScript
5
star
28

example-percy-java-selenium

Example app demonstrating Percy's Java Selenium integration.
JavaScript
5
star
29

example-percy-webdriverio

Example of how to integrate Percy visual test with WebdriverIO.
JavaScript
4
star
30

example-percy-testcafe

Example app demonstrating Percy's TestCafe integration.
JavaScript
4
star
31

example-percy-ember

Example app for Percy's Ember tutorial.
JavaScript
3
star
32

percy-common

Server-side common library for Percy.
Ruby
3
star
33

example-percy-selenium-dotnet

Example app demonstrating Percy's .NET selenium integration.
JavaScript
3
star
34

percy-protractor

Visual testing with Protractor and Percy
JavaScript
3
star
35

example-percy-jekyll

SCSS
3
star
36

percy-selenium-ruby

Visual testing with Selenium Ruby and Percy
Ruby
3
star
37

example-percy-puppeteer-standalone

Example app showing integration of Percy visual testing into Google Puppeteer scripts.
HTML
3
star
38

percy-poller

Poll the Percy API until a build is done, and then log the status as JSON. Also see Webhooks: https://docs.percy.io/docs/webhooks
JavaScript
3
star
39

gatsby-plugin-percy

Percy Plugin for Gatsby
JavaScript
2
star
40

percy-selenium-js

Selenium.js client library for visual regression testing with Percy
JavaScript
2
star
41

example-percy-cypress-typescript

Example Cypress and Percy usage with TypeScript
JavaScript
2
star
42

percy-script

[Deprecated] PercyScript is the easiest way to get started with visual testing and Percy.
JavaScript
2
star
43

example-percy-protractor

Example app demonstrating Percy's Protractor integration.
JavaScript
2
star
44

in-percy

@percy-io/in-percy NPM package
JavaScript
2
star
45

example-percy-storybook

Example app demonstrating Percy's Storybook integration.
JavaScript
2
star
46

percy-selenium-dotnet

Percy visual testing for .NET Selenium
C#
1
star
47

example-percy-anywhere

An example of Percy visual regression tests and Capybara/Selenium interaction with any static site.
JavaScript
1
star
48

example-quickstart

Simple example app with Percy visual regression tests.
Ruby
1
star
49

percy-appium-js

JavaScript
1
star
50

example-percy-appium-python

Python
1
star
51

example-percy-playwright

Example app showing integration of Percy visual testing into Puppeteer tests.
JavaScript
1
star
52

percy-appium-python

Python
1
star
53

example-percy-selenium-python

Example app demonstrating Percy's Python Selenium integration.
JavaScript
1
star
54

percy-nightmare

Visual testing with Nightmare and Percy
JavaScript
1
star
55

percy-migrate-sdk

@percy/migrate is used to upgrade and migrate your Percy SDK to the latest version.
JavaScript
1
star