From fcc44903c17d545716b9db7a857ba24b31007515 Mon Sep 17 00:00:00 2001 From: rezaelahidev Date: Sat, 26 Oct 2024 12:56:32 +0330 Subject: [PATCH] test: update the block-sections e2e tests --- .../components/test/block-sections.e2e.cy.js | 21 ++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/packages/editor/js/extensions/components/test/block-sections.e2e.cy.js b/packages/editor/js/extensions/components/test/block-sections.e2e.cy.js index 4c93ddf95..9fd7f2eb8 100644 --- a/packages/editor/js/extensions/components/test/block-sections.e2e.cy.js +++ b/packages/editor/js/extensions/components/test/block-sections.e2e.cy.js @@ -21,10 +21,12 @@ describe('Block Sections Manager Testing', () => { }); it('should applied expand all of block sections', () => { - cy.getByAriaLabel('Block Settings').click(); + cy.get('button[aria-label="Block Settings"]').click(); cy.getByDataTest('Expand All').click(); + cy.get('button[aria-label="Block Settings"]').click(); + // Check for opened background section cy.getByAriaLabel('Add New Background').should('exist'); // Check for opened border section @@ -46,10 +48,12 @@ describe('Block Sections Manager Testing', () => { }); it('should applied collapse all of block sections', () => { - cy.getByAriaLabel('Block Settings').click(); + cy.get('button[aria-label="Block Settings"]').click(); cy.getByDataTest('Collapse All').click(); + cy.get('button[aria-label="Block Settings"]').click(); + // Check for opened background section cy.getByAriaLabel('Add New Background').should('not.exist'); // Check for opened border section @@ -73,10 +77,12 @@ describe('Block Sections Manager Testing', () => { }); it('should applied focus mode of block sections', () => { - cy.getByAriaLabel('Block Settings').click(); + cy.get('button[aria-label="Block Settings"]').click(); cy.getByDataTest('Focus Mode').click(); + cy.get('button[aria-label="Block Settings"]').click(); + // Check for opened Spacing section by default! cy.get( `[data-cy="box-spacing-margin-top"] [data-cy="label-control"]` @@ -111,10 +117,12 @@ describe('Block Sections Manager Testing', () => { }); it('should opened inner blocks while applied focus mode of block sections with navigate between inners and master', () => { - cy.getByAriaLabel('Block Settings').click(); + cy.get('button[aria-label="Block Settings"]').click(); cy.getByDataTest('Focus Mode').click(); + cy.get('button[aria-label="Block Settings"]').click(); + // Open inner blocks setInnerBlock('elements/link'); @@ -126,10 +134,9 @@ describe('Block Sections Manager Testing', () => { // Should open the inner blocks section on master block. cy.get('button').contains('Add Inner Block').should('exist'); - cy.getByAriaLabel('Block Settings').click(); + cy.get('button[aria-label="Block Settings"]').click(); cy.getByDataTest('Focus Mode').click(); - cy.getByAriaLabel('Block Settings').click(); - cy.getByDataTest('Expand All').click(); + cy.get('button[aria-label="Block Settings"]').click(); // Open inner blocks setInnerBlock('elements/link');