Skip to content

Commit

Permalink
add cypress test to increase coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
MihaelaCretu11 committed Oct 9, 2023
1 parent 8dad4dd commit aedc5b3
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions cypress/e2e/01-block-basics.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,30 @@ describe('Blocks Tests', () => {
cy.contains('My Add-on Page');
cy.get('.block.image');
});

it('Add Hero Block', () => {
// Change page title
cy.clearSlateTitle();
cy.getSlateTitle().type('My Add-on Page');
cy.get('.documentFirstHeading').contains('My Add-on Page');
cy.getSlate().click();

// Add block
cy.get('.ui.basic.icon.button.block-add-button').first().click();
cy.get('.blocks-chooser .title').contains('Common').click();
cy.get('.content.active.common .button.hero').contains('Hero').click({ force: true });

// Configure block
cy.getSlate().click().type('Hero Block');
cy.get('.ui.checked.toggle.checkbox').contains('Full height').click();
cy.get('.ui.toggle.checkbox').contains('Hide publishing date').click();

// Save
cy.get('#toolbar-save').click();
cy.url().should('eq', Cypress.config().baseUrl + '/cypress/my-page');

// then the page view should contain our changes
cy.contains('My Add-on Page');
cy.get('.hero-block');
});
});

0 comments on commit aedc5b3

Please sign in to comment.