-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Percy visual regression testing (VRT) snapshots for all components #8911
Comments
Here's a super barebones template I've been starting from when adding a /**
* Copyright IBM Corp. 2016, 2018
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/
import 'carbon-components/scss/components/component/_component.scss';
import React from 'react';
import { mount } from '@cypress/react';
import { Component } from './Component';
describe('Component', () => {
beforeEach(() => {
mount(<Component>sample_text</Component>);
});
it('should render', () => {
cy.findByText(/sample_text/).should('be.visible');
// snapshots should always be taken _after_ an assertion that
// a element/component should be visible. This is to ensure
// the DOM has settled and the element has fully loaded.
cy.percySnapshot();
});
}); It's helpful to look at the stories to understand common permutations or configurations of the component to get the component into a "default" state for baseline snapshots. |
Here's a guide on what I've been doing to add these:
|
Helpful links I've referenced along the way:
|
Closing. We've migrated away from cypress to instead use playwright and added baseline VRT snapshots for all components in #11302 |
Summary
In #8282 Cypress was set up for e2e testing and also added the Percy integration to facilitate visual regression testing via snapshots taken in the e2e tests. We need to enable a snapshot for each component, this epic/issue is to track the status of adding a single baseline snapshot for each component.
Process
High level steps for each component:
Components
The text was updated successfully, but these errors were encountered: