File tree Expand file tree Collapse file tree 1 file changed +12
-9
lines changed
regression-test/cypress/e2e Expand file tree Collapse file tree 1 file changed +12
-9
lines changed Original file line number Diff line number Diff line change @@ -41,25 +41,28 @@ afterEach(() => {
4141 } )
4242} )
4343
44- // log fn taken from https://www.npmjs.com/package/cypress-axe
4544function terminalLog ( violations : Result [ ] ) {
4645 cy . task (
4746 'log' ,
4847 `${ violations . length } accessibility violation${
4948 violations . length === 1 ? '' : 's'
50- } ${ violations . length === 1 ? 'was' : 'were' } detected`
49+ } ${ violations . length === 1 ? 'was' : 'were' } detected. `
5150 )
52- // pluck specific keys to keep the table readable
53- const violationData = violations . map (
54- ( { id , impact , description , nodes } ) => ( {
51+
52+ violations . map ( ( { id , impact , description , nodes } ) => {
53+ cy . task ( 'table' , {
5554 id,
5655 impact,
5756 description,
58- nodes : nodes . length
57+ summary : nodes [ 0 ] . failureSummary
5958 } )
60- )
61-
62- cy . task ( 'table' , violationData )
59+ const ret : any = { }
60+ cy . task ( 'log' , 'This error happens in the following elements:' )
61+ nodes . forEach ( ( item , index ) => {
62+ ret [ `${ item . target . join ( ',' ) } ` ] = { html : item . html }
63+ } )
64+ cy . task ( 'table' , ret )
65+ } )
6366}
6467
6568const axeOptions : { runOnly : RunOnly } = {
You can’t perform that action at this time.
0 commit comments