From 708ec85808dd6883f8ee661f532081e376b6315a Mon Sep 17 00:00:00 2001 From: Teodor Date: Wed, 25 Sep 2024 15:11:33 +0300 Subject: [PATCH 01/12] Add a11y test for image-block --- .../volto/cypress/tests/core/basic/a11y.js | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/packages/volto/cypress/tests/core/basic/a11y.js b/packages/volto/cypress/tests/core/basic/a11y.js index 9c21668d8f..7936b4219a 100644 --- a/packages/volto/cypress/tests/core/basic/a11y.js +++ b/packages/volto/cypress/tests/core/basic/a11y.js @@ -13,6 +13,38 @@ describe('Accessibility Tests', () => { cy.checkA11y(); }); + it('Image block has not a11y violations', () => { + cy.autologin(); + cy.visit('/'); + cy.createContent({ + contentType: 'Document', + contentId: 'my-page', + contentTitle: 'My Page', + }); + cy.visit('/my-page'); + + cy.wait(500); + + cy.navigate('/my-page/edit'); + cy.get('.block .slate-editor [contenteditable=true]').click(); + cy.get('.button .block-add-button').click({ force: true }); + cy.get('.blocks-chooser .mostUsed') + .findByText('Image') + .click({ force: true }); + cy.get('.block-editor-image [tabindex="0"]').last().focus(); + cy.findByLabelText('Enter a URL to an image').click(); + cy.get('.ui.input.editor-link.input-anchorlink-theme input').type( + `https://github.com/plone/volto/raw/main/logos/volto-colorful.png{enter}`, + ); + cy.wait(1000); + cy.get('#toolbar-save').click(); + cy.get('img').should('exist'); + cy.get('img').should('have.attr', 'src'); + cy.wait(1000); + cy.injectAxe(); + cy.checkA11y(); + }); + // TODO: Adapt this to volto-slate table // it('Table has no a11y violations', () => { // cy.createContent({ From ed7168fc1b9d42a7d7aeef10d9c13ad6457447a2 Mon Sep 17 00:00:00 2001 From: Teodor Date: Wed, 25 Sep 2024 15:24:05 +0300 Subject: [PATCH 02/12] add changelog --- packages/volto/news/6329.internal | 1 + 1 file changed, 1 insertion(+) create mode 100644 packages/volto/news/6329.internal diff --git a/packages/volto/news/6329.internal b/packages/volto/news/6329.internal new file mode 100644 index 0000000000..f5b9037f40 --- /dev/null +++ b/packages/volto/news/6329.internal @@ -0,0 +1 @@ +Add Accessibility acceptance tests for blocks. @tedw87 \ No newline at end of file From fb536a9ff2c74fd25ebc8f7d3d236447b31b0623 Mon Sep 17 00:00:00 2001 From: Teodor Date: Wed, 25 Sep 2024 16:58:31 +0300 Subject: [PATCH 03/12] add a11y test for table block --- .../volto/cypress/tests/core/basic/a11y.js | 43 +++++++++++++++---- 1 file changed, 35 insertions(+), 8 deletions(-) diff --git a/packages/volto/cypress/tests/core/basic/a11y.js b/packages/volto/cypress/tests/core/basic/a11y.js index 7936b4219a..acf1ffe62b 100644 --- a/packages/volto/cypress/tests/core/basic/a11y.js +++ b/packages/volto/cypress/tests/core/basic/a11y.js @@ -1,6 +1,7 @@ describe('Accessibility Tests', () => { beforeEach(() => { cy.visit('/'); + cy.autologin(); cy.injectAxe(); // make sure axe is available on the page }); @@ -14,18 +15,15 @@ describe('Accessibility Tests', () => { }); it('Image block has not a11y violations', () => { - cy.autologin(); - cy.visit('/'); cy.createContent({ contentType: 'Document', - contentId: 'my-page', - contentTitle: 'My Page', + contentId: 'a11y-image-block', + contentTitle: 'a11y image block', }); - cy.visit('/my-page'); - + cy.visit('/a11y-image-block'); cy.wait(500); - - cy.navigate('/my-page/edit'); + // Add an image block + cy.navigate('/a11y-image-block/edit'); cy.get('.block .slate-editor [contenteditable=true]').click(); cy.get('.button .block-add-button').click({ force: true }); cy.get('.blocks-chooser .mostUsed') @@ -45,6 +43,35 @@ describe('Accessibility Tests', () => { cy.checkA11y(); }); + it('Table has no a11y violations', () => { + cy.createContent({ + contentType: 'Document', + contentId: 'a11y-table-block', + contentTitle: 'a11y table block', + }); + cy.visit('/a11y-table-block/edit'); + // Add a table block + cy.get('.block .slate-editor [contenteditable=true]').click(); + cy.get('.button .block-add-button').click({ force: true }); + cy.get('[aria-label="Unfold Common blocks"]').click(); + cy.get('.blocks-chooser .common') + .findByText('Table') + .click({ force: true }); + cy.get('tbody > :nth-child(1) > :nth-child(1)').click().type('headline 1'); + cy.get('tbody > :nth-child(1) > :nth-child(2)').click().type('headline 2'); + cy.get('#toolbar-save').click(); + // Ensure the table exists and has correct structure + cy.get('table').should('exist'); // Wait for the table to render + cy.get('thead').should('exist'); // Ensure the table has a header + // Wait for the headers to exist and contain correct content + cy.get('thead th').should('have.length', 2); + cy.get('thead th').first().should('exist'); + cy.get('thead th').last().should('exist'); + cy.wait(500); + cy.injectAxe(); + cy.checkA11y(); + }); + // TODO: Adapt this to volto-slate table // it('Table has no a11y violations', () => { // cy.createContent({ From 5ff4b1542231ff06d0e1dc79bd8258fd1cfc3e34 Mon Sep 17 00:00:00 2001 From: Teodor Date: Wed, 25 Sep 2024 17:25:06 +0300 Subject: [PATCH 04/12] add a11y test for maps block --- .../volto/cypress/tests/core/basic/a11y.js | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/packages/volto/cypress/tests/core/basic/a11y.js b/packages/volto/cypress/tests/core/basic/a11y.js index acf1ffe62b..c7b385011d 100644 --- a/packages/volto/cypress/tests/core/basic/a11y.js +++ b/packages/volto/cypress/tests/core/basic/a11y.js @@ -72,6 +72,30 @@ describe('Accessibility Tests', () => { cy.checkA11y(); }); + it('Maps has no a11y violations', () => { + cy.createContent({ + contentType: 'Document', + contentId: 'a11y-maps-block', + contentTitle: 'a11y table block', + }); + cy.visit('/a11y-maps-block/edit'); + // Add a maps block + cy.get('.block .slate-editor [contenteditable=true]').click(); + cy.get('.button .block-add-button').click({ force: true }); + cy.get('[aria-label="Unfold Common blocks"]').click(); + cy.get('.blocks-chooser .common').findByText('Maps').click({ force: true }); + cy.get('.block.maps .toolbar-inner .ui.input input').type( + `{enter}`, + ); + cy.get( + '#sidebar #blockform-fieldset-default .field-wrapper-title #field-title', + ).type('plone location'); + cy.get('#toolbar-save').click(); + cy.wait(1000); + cy.injectAxe(); + cy.checkA11y(); + }); + // TODO: Adapt this to volto-slate table // it('Table has no a11y violations', () => { // cy.createContent({ From 66a5f8bfc4794c75d218a7a56159159629527ba4 Mon Sep 17 00:00:00 2001 From: Teodor Date: Wed, 25 Sep 2024 17:30:55 +0300 Subject: [PATCH 05/12] add a11y test for text block --- .../volto/cypress/tests/core/basic/a11y.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/packages/volto/cypress/tests/core/basic/a11y.js b/packages/volto/cypress/tests/core/basic/a11y.js index c7b385011d..2afc8e7fd0 100644 --- a/packages/volto/cypress/tests/core/basic/a11y.js +++ b/packages/volto/cypress/tests/core/basic/a11y.js @@ -96,6 +96,25 @@ describe('Accessibility Tests', () => { cy.checkA11y(); }); + it('Text block has no a11y violations', () => { + cy.createContent({ + contentType: 'Document', + contentId: 'a11y-text-block', + contentTitle: 'a11y text block', + }); + cy.visit('/a11y-text-block/edit'); + // Add a text block + cy.get('.block .slate-editor [contenteditable=true]').click(); + cy.get('.button .block-add-button').click({ force: true }); + cy.get('[aria-label="Unfold Text blocks"]').click(); + cy.get('.blocks-chooser .slate').findByText('Text').click({ force: true }); + cy.getSlateEditorAndType('My text').contains('My text'); + cy.get('#toolbar-save').click(); + cy.wait(1000); + cy.injectAxe(); + cy.checkA11y(); + }); + // TODO: Adapt this to volto-slate table // it('Table has no a11y violations', () => { // cy.createContent({ From 1cd859a88a262c5fb40816a1092e42c81df04bed Mon Sep 17 00:00:00 2001 From: Teodor Date: Wed, 25 Sep 2024 18:48:00 +0300 Subject: [PATCH 06/12] fix cypress test --- packages/volto/cypress/tests/core/basic/a11y.js | 9 ++++++++- packages/volto/news/6329.internal | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/volto/cypress/tests/core/basic/a11y.js b/packages/volto/cypress/tests/core/basic/a11y.js index 7779ba7e25..df5c93f53a 100644 --- a/packages/volto/cypress/tests/core/basic/a11y.js +++ b/packages/volto/cypress/tests/core/basic/a11y.js @@ -1,7 +1,6 @@ describe('Accessibility Tests', () => { beforeEach(() => { cy.visit('/'); - cy.autologin(); cy.injectAxe(); // make sure axe is available on the page }); @@ -19,6 +18,8 @@ describe('Accessibility Tests', () => { }); it('Image block has not a11y violations', () => { + cy.autologin(); + cy.createContent({ contentType: 'Document', contentId: 'a11y-image-block', @@ -48,6 +49,8 @@ describe('Accessibility Tests', () => { }); it('Table has no a11y violations', () => { + cy.autologin(); + cy.createContent({ contentType: 'Document', contentId: 'a11y-table-block', @@ -77,6 +80,8 @@ describe('Accessibility Tests', () => { }); it('Maps has no a11y violations', () => { + cy.autologin(); + cy.createContent({ contentType: 'Document', contentId: 'a11y-maps-block', @@ -101,6 +106,8 @@ describe('Accessibility Tests', () => { }); it('Text block has no a11y violations', () => { + cy.autologin(); + cy.createContent({ contentType: 'Document', contentId: 'a11y-text-block', diff --git a/packages/volto/news/6329.internal b/packages/volto/news/6329.internal index f5b9037f40..2a7aa76398 100644 --- a/packages/volto/news/6329.internal +++ b/packages/volto/news/6329.internal @@ -1 +1 @@ -Add Accessibility acceptance tests for blocks. @tedw87 \ No newline at end of file +Add Accessibility acceptance tests for: image block, table block, maps block, text block. @tedw87 \ No newline at end of file From 361262a82e104ea0922d97dae8c24f45493d85e0 Mon Sep 17 00:00:00 2001 From: Teodor Date: Fri, 27 Sep 2024 11:26:35 +0300 Subject: [PATCH 07/12] add test for video block and update changelog --- .../volto/cypress/tests/core/basic/a11y.js | 30 ++++++++++++++++--- packages/volto/news/6329.internal | 2 +- 2 files changed, 27 insertions(+), 5 deletions(-) diff --git a/packages/volto/cypress/tests/core/basic/a11y.js b/packages/volto/cypress/tests/core/basic/a11y.js index df5c93f53a..2508bdc4b4 100644 --- a/packages/volto/cypress/tests/core/basic/a11y.js +++ b/packages/volto/cypress/tests/core/basic/a11y.js @@ -19,7 +19,6 @@ describe('Accessibility Tests', () => { it('Image block has not a11y violations', () => { cy.autologin(); - cy.createContent({ contentType: 'Document', contentId: 'a11y-image-block', @@ -50,7 +49,6 @@ describe('Accessibility Tests', () => { it('Table has no a11y violations', () => { cy.autologin(); - cy.createContent({ contentType: 'Document', contentId: 'a11y-table-block', @@ -81,7 +79,6 @@ describe('Accessibility Tests', () => { it('Maps has no a11y violations', () => { cy.autologin(); - cy.createContent({ contentType: 'Document', contentId: 'a11y-maps-block', @@ -107,7 +104,6 @@ describe('Accessibility Tests', () => { it('Text block has no a11y violations', () => { cy.autologin(); - cy.createContent({ contentType: 'Document', contentId: 'a11y-text-block', @@ -126,6 +122,32 @@ describe('Accessibility Tests', () => { cy.checkA11y(); }); + // TODO: Update video block + // a11y tests are failing because placeholder image has no alt attribute. + // Embed component from semantic-ui doesn't accept alt property. + + // it('Video block has no a11y violations', () => { + // cy.autologin(); + // cy.createContent({ + // contentType: 'Document', + // contentId: 'a11y-video-block', + // contentTitle: 'a11y video block', + // }); + // cy.visit('/a11y-video-block/edit'); + // // Add a video block + // cy.getSlate().click(); + // cy.get('.ui.basic.icon.button.block-add-button').click(); + // cy.get('.ui.basic.icon.button.video').contains('Video').click(); + // cy.get('.toolbar-inner > .ui > input') + // .click() + // .type('https://youtu.be/T6J3d35oIAY') + // .type('{enter}'); + // cy.get('#toolbar-save').click(); + // cy.wait(1000); + // cy.injectAxe(); + // cy.checkA11y(); + // }); + // TODO: Adapt this to volto-slate table // it('Table has no a11y violations', () => { // cy.createContent({ diff --git a/packages/volto/news/6329.internal b/packages/volto/news/6329.internal index 2a7aa76398..c4ac596d41 100644 --- a/packages/volto/news/6329.internal +++ b/packages/volto/news/6329.internal @@ -1 +1 @@ -Add Accessibility acceptance tests for: image block, table block, maps block, text block. @tedw87 \ No newline at end of file +Add Accessibility acceptance tests for: image block, table block, maps block, text block, video block. @iRohitSingh @tedw87 @ana-oprea \ No newline at end of file From ead2ee9bf7bb42f8a45d284e3301e154301bea0f Mon Sep 17 00:00:00 2001 From: Teodor Date: Fri, 27 Sep 2024 12:21:26 +0300 Subject: [PATCH 08/12] add test for teaser block --- .../volto/cypress/tests/core/basic/a11y.js | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/packages/volto/cypress/tests/core/basic/a11y.js b/packages/volto/cypress/tests/core/basic/a11y.js index 2508bdc4b4..95272f609a 100644 --- a/packages/volto/cypress/tests/core/basic/a11y.js +++ b/packages/volto/cypress/tests/core/basic/a11y.js @@ -122,6 +122,40 @@ describe('Accessibility Tests', () => { cy.checkA11y(); }); + it('Teaser block has no a11y violations', () => { + cy.autologin(); + cy.createContent({ + contentType: 'Document', + contentId: 'a11y-teaser-block', + contentTitle: 'a11y teaser block', + }); + cy.createContent({ + contentType: 'Document', + contentId: 'blue-orchids', + contentTitle: 'Blue Orchids', + contentDescription: 'are growing on the mountain tops', + image: true, + path: '/a11y-teaser-block', + }); + cy.visit('/a11y-teaser-block/edit'); + // Add a teaser block + cy.get('.block .slate-editor [contenteditable=true]').click(); + cy.get('.button .block-add-button').click({ force: true }); + cy.get('.blocks-chooser .mostUsed .button.teaser') + .contains('Teaser') + .click({ force: true }); + cy.get( + '.objectbrowser-field[aria-labelledby="fieldset-default-field-label-href"] button[aria-label="Open object browser"]', + ).click(); + cy.get('[aria-label="Select Blue Orchids"]').dblclick(); + cy.wait(500); + cy.get('.align-buttons .ui.buttons button[aria-label="Center"]').click(); + cy.get('#toolbar-save').click(); + cy.wait(1000); + cy.injectAxe(); + cy.checkA11y(); + }); + // TODO: Update video block // a11y tests are failing because placeholder image has no alt attribute. // Embed component from semantic-ui doesn't accept alt property. From f17da6e4484bcdf666b518ef22ba72205998ceb3 Mon Sep 17 00:00:00 2001 From: Teodor Date: Fri, 27 Sep 2024 13:16:10 +0300 Subject: [PATCH 09/12] update changelog --- packages/volto/news/6329.internal | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/volto/news/6329.internal b/packages/volto/news/6329.internal index c4ac596d41..9e211aaa68 100644 --- a/packages/volto/news/6329.internal +++ b/packages/volto/news/6329.internal @@ -1 +1 @@ -Add Accessibility acceptance tests for: image block, table block, maps block, text block, video block. @iRohitSingh @tedw87 @ana-oprea \ No newline at end of file +Add Accessibility acceptance tests for: image block, table block, maps block, text block, video block, teaser block. @iRohitSingh @tedw87 \ No newline at end of file From 5384793c5b66c0cebd53a084833ac4181fafbda0 Mon Sep 17 00:00:00 2001 From: Teodor Date: Fri, 27 Sep 2024 14:00:20 +0300 Subject: [PATCH 10/12] update test descriptions --- .../volto/cypress/tests/core/basic/a11y.js | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/packages/volto/cypress/tests/core/basic/a11y.js b/packages/volto/cypress/tests/core/basic/a11y.js index 95272f609a..f67962e526 100644 --- a/packages/volto/cypress/tests/core/basic/a11y.js +++ b/packages/volto/cypress/tests/core/basic/a11y.js @@ -4,20 +4,20 @@ describe('Accessibility Tests', () => { cy.injectAxe(); // make sure axe is available on the page }); - it('Front page has not a11y violations', () => { + it('Test front page with cypress-axe', () => { cy.checkA11y(); // fail for a11y violations }); - it('Contact form has not a11y violations', () => { + it('Test contact form with cypress-axe', () => { cy.navigate('/contact-form'); cy.get('#field-name').click().type('input'); cy.get('#field-from').click().type('something@domain.com'); cy.get('#field-subject').click().type('input'); cy.get('#field-message').click().type('input'); - cy.checkA11y(); + cy.checkA11y(); // fail for a11y violations }); - it('Image block has not a11y violations', () => { + it('Test image block with cypress-axe', () => { cy.autologin(); cy.createContent({ contentType: 'Document', @@ -44,10 +44,10 @@ describe('Accessibility Tests', () => { cy.get('img').should('have.attr', 'src'); cy.wait(1000); cy.injectAxe(); - cy.checkA11y(); + cy.checkA11y(); // fail for a11y violations }); - it('Table has no a11y violations', () => { + it('Test table block with cypress-axe', () => { cy.autologin(); cy.createContent({ contentType: 'Document', @@ -74,10 +74,10 @@ describe('Accessibility Tests', () => { cy.get('thead th').last().should('exist'); cy.wait(500); cy.injectAxe(); - cy.checkA11y(); + cy.checkA11y(); // fail for a11y violations }); - it('Maps has no a11y violations', () => { + it('Test maps block with cypress-axe', () => { cy.autologin(); cy.createContent({ contentType: 'Document', @@ -99,10 +99,10 @@ describe('Accessibility Tests', () => { cy.get('#toolbar-save').click(); cy.wait(1000); cy.injectAxe(); - cy.checkA11y(); + cy.checkA11y(); // fail for a11y violations }); - it('Text block has no a11y violations', () => { + it('Test text block with cypress-axe', () => { cy.autologin(); cy.createContent({ contentType: 'Document', @@ -119,10 +119,10 @@ describe('Accessibility Tests', () => { cy.get('#toolbar-save').click(); cy.wait(1000); cy.injectAxe(); - cy.checkA11y(); + cy.checkA11y(); // fail for a11y violations }); - it('Teaser block has no a11y violations', () => { + it('Test teaser block with cypress-axe', () => { cy.autologin(); cy.createContent({ contentType: 'Document', @@ -153,7 +153,7 @@ describe('Accessibility Tests', () => { cy.get('#toolbar-save').click(); cy.wait(1000); cy.injectAxe(); - cy.checkA11y(); + cy.checkA11y(); // fail for a11y violations }); // TODO: Update video block From 10c63abbdd26b9cf6c5d9f7d97072cf280f7b8c5 Mon Sep 17 00:00:00 2001 From: ana-oprea Date: Fri, 27 Sep 2024 13:03:21 +0200 Subject: [PATCH 11/12] add test for anchors and toc block --- .../volto/cypress/tests/core/basic/a11y.js | 41 ++++++++++++++++--- 1 file changed, 36 insertions(+), 5 deletions(-) diff --git a/packages/volto/cypress/tests/core/basic/a11y.js b/packages/volto/cypress/tests/core/basic/a11y.js index f67962e526..cbf93e53a8 100644 --- a/packages/volto/cypress/tests/core/basic/a11y.js +++ b/packages/volto/cypress/tests/core/basic/a11y.js @@ -1,5 +1,6 @@ describe('Accessibility Tests', () => { beforeEach(() => { + cy.autologin(); cy.visit('/'); cy.injectAxe(); // make sure axe is available on the page }); @@ -18,7 +19,6 @@ describe('Accessibility Tests', () => { }); it('Test image block with cypress-axe', () => { - cy.autologin(); cy.createContent({ contentType: 'Document', contentId: 'a11y-image-block', @@ -48,7 +48,6 @@ describe('Accessibility Tests', () => { }); it('Test table block with cypress-axe', () => { - cy.autologin(); cy.createContent({ contentType: 'Document', contentId: 'a11y-table-block', @@ -78,7 +77,6 @@ describe('Accessibility Tests', () => { }); it('Test maps block with cypress-axe', () => { - cy.autologin(); cy.createContent({ contentType: 'Document', contentId: 'a11y-maps-block', @@ -103,7 +101,6 @@ describe('Accessibility Tests', () => { }); it('Test text block with cypress-axe', () => { - cy.autologin(); cy.createContent({ contentType: 'Document', contentId: 'a11y-text-block', @@ -123,7 +120,6 @@ describe('Accessibility Tests', () => { }); it('Test teaser block with cypress-axe', () => { - cy.autologin(); cy.createContent({ contentType: 'Document', contentId: 'a11y-teaser-block', @@ -156,6 +152,41 @@ describe('Accessibility Tests', () => { cy.checkA11y(); // fail for a11y violations }); + it('Test Anchors and TOC block with cypress-axe', () => { + cy.createContent({ + contentType: 'Document', + contentId: 'a11y-anchors-block', + contentTitle: 'a11y anchors block', + }); + cy.visit('/a11y-anchors-block/edit'); + + // Add TOC block + cy.get('.ui.basic.icon.button.block-add-button').first().click(); + cy.get(".blocks-chooser .ui.form .field.searchbox input[type='text']").type( + 'table of contents', + ); + cy.get('.button.toc').click(); + + // Add headings + cy.get('.ui.basic.icon.button.block-add-button').first().click(); + cy.get(".blocks-chooser .ui.form .field.searchbox input[type='text']").type( + 'text', + ); + cy.get('.button.slate').click(); + cy.get('.ui.drag.block.inner.slate').eq(0).click().type('Title 1').click(); + cy.contains('Title 1').setSelection('Title 1'); + cy.get('.slate-inline-toolbar .button-wrapper a[title="Title"]').click({ + force: true, + }); + + cy.get('#toolbar-save').click(); + cy.url().should('eq', Cypress.config().baseUrl + '/a11y-anchors-block'); + + cy.wait(1000); + cy.injectAxe(); + cy.checkA11y(); + }); + // TODO: Update video block // a11y tests are failing because placeholder image has no alt attribute. // Embed component from semantic-ui doesn't accept alt property. From 3f74d072a2d00d9cb67492500b9f8ac3d2cf1853 Mon Sep 17 00:00:00 2001 From: ana-oprea Date: Fri, 27 Sep 2024 13:25:09 +0200 Subject: [PATCH 12/12] fix test for contact form --- .../volto/cypress/tests/core/basic/a11y.js | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/packages/volto/cypress/tests/core/basic/a11y.js b/packages/volto/cypress/tests/core/basic/a11y.js index cbf93e53a8..44c005294a 100644 --- a/packages/volto/cypress/tests/core/basic/a11y.js +++ b/packages/volto/cypress/tests/core/basic/a11y.js @@ -1,14 +1,8 @@ -describe('Accessibility Tests', () => { +describe('Accessibility Test for contact form', () => { beforeEach(() => { - cy.autologin(); cy.visit('/'); cy.injectAxe(); // make sure axe is available on the page }); - - it('Test front page with cypress-axe', () => { - cy.checkA11y(); // fail for a11y violations - }); - it('Test contact form with cypress-axe', () => { cy.navigate('/contact-form'); cy.get('#field-name').click().type('input'); @@ -17,6 +11,18 @@ describe('Accessibility Tests', () => { cy.get('#field-message').click().type('input'); cy.checkA11y(); // fail for a11y violations }); +}); + +describe('Accessibility Tests', () => { + beforeEach(() => { + cy.autologin(); + cy.visit('/'); + cy.injectAxe(); // make sure axe is available on the page + }); + + it('Test front page with cypress-axe', () => { + cy.checkA11y(); // fail for a11y violations + }); it('Test image block with cypress-axe', () => { cy.createContent({