View Slide
[Screenshot eines
// First: Loading installation script// Run install script./vrt-install.sh// Next: Install Cypress pluginnpm install@visual-regression-tracker/agent-cypress
main 6.4.7.0
6.4.7.06.4.7.0
name: CIon: [push, pull_request]jobs:build:runs-on: ubuntu-lateststeps:- name: Checkoutuses: actions/[email protected]- name: Installrun: yarn- name: Percy Testuses: percy/[email protected]with:command: "cypress run"env:PERCY_TOKEN: ${{ secrets.PERCY_TOKEN }}
[Screenshot Percy Gitlab]
Percy im Test - Code im Test
const now = new Date(2018, 1, 1).getTime();// freezes the system time to Jan 1, 2018cy.clock(now);// continue with your normal tests below
// Wait for loading timescy.get('.grid-selection‘).should('not.exist');cy.get('.sw-loader').should('not.exist');
// Command usageawait percySnapshot('Home page', {percyCSS: `iframe { display: none; }`});version: 1snapshot:percy-css: |iframe {display: none;}
// An own CommandCypress.Commands.add('changeElementStyling', (selector, imageStyle) => {// E.g. replace the image with a fixed onecy.get(selector).invoke('attr', 'style', imageStyle).should('have.attr', 'style', imageStyle);});