|
| 1 | +import { slateBeforeEach, slateAfterEach } from '../support/e2e'; |
| 2 | + |
| 3 | +describe('Blocks Tests', () => { |
| 4 | + beforeEach(slateBeforeEach); |
| 5 | + afterEach(slateAfterEach); |
| 6 | + |
| 7 | + it('Style Block', () => { |
| 8 | + // Change page title |
| 9 | + cy.get('[contenteditable=true]').first().click(); |
| 10 | + |
| 11 | + cy.get('[contenteditable=true]').first().clear(); |
| 12 | + |
| 13 | + cy.get('[contenteditable=true]').first().type('Volto Style Block Demo'); |
| 14 | + |
| 15 | + cy.get('.documentFirstHeading').contains('Volto Style Block Demo'); |
| 16 | + |
| 17 | + // Align the block |
| 18 | + cy.get('.open-styles-button button').click(); |
| 19 | + cy.contains('Standard').click(); |
| 20 | + cy.get( |
| 21 | + '.inline.field.align-widget.field-wrapper-textAlign .align-buttons .ui.buttons', |
| 22 | + ) |
| 23 | + .eq(2) |
| 24 | + .click(); |
| 25 | + |
| 26 | + // Change the background color of the block |
| 27 | + cy.contains('Decorations').click(); |
| 28 | + cy.get( |
| 29 | + '.inline.field.simple-color-picker-widget.field-wrapper-backgroundColor .ui.huge.button', |
| 30 | + ).click(); |
| 31 | + cy.get('.github-picker.color-picker div[title="#9dc6d4"]').click(); |
| 32 | + |
| 33 | + cy.get('[contenteditable=true]').first().type('{enter}'); |
| 34 | + |
| 35 | + // Save page |
| 36 | + cy.get('#toolbar-save').click(); |
| 37 | + cy.url().should('eq', Cypress.config().baseUrl + '/cypress/my-page'); |
| 38 | + |
| 39 | + // The page view should contain our changes |
| 40 | + cy.contains('Volto Style Block Demo'); |
| 41 | + cy.get('.has--backgroundColor--9dc6d4.has--textAlign--center').should( |
| 42 | + 'exist', |
| 43 | + ); |
| 44 | + }); |
| 45 | +}); |
0 commit comments