import './commands' ; import '@cypress/code-coverage/support' ; require ( 'cypress-axe' ) ; function terminalLog ( violations ) { cy . task ( 'log' , `${ violations . length } accessibility violation${ violations . length === 1 ? '' : 's' } ${ violations . length === 1 ? 'was' : 'were' } detected` ) ; const violationData = violations . map ( ( { id , impact , description , nodes } ) => ( { id , impact , description , nodes : nodes . length , } ) ) ; cy . task ( 'table' , violationData ) ; } if ( Cypress . env ( 'a11yCheck' ) ) { beforeEach ( 'a11y initial' , ( ) => { cy . injectAxe ( ) ; } ) ; afterEach ( 'a11y check' , ( ) => { cy . checkA11y ( '#__cy_root *' , null , terminalLog , { skipFailures : true } ) ; } ) ; }