Skip to content

Commit

Permalink
test: update the block-sections e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rezaelahidev committed Oct 26, 2024
1 parent 68e229d commit fcc4490
Showing 1 changed file with 14 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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"]`
Expand Down Expand Up @@ -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');

Expand All @@ -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');
Expand Down

0 comments on commit fcc4490

Please sign in to comment.