Skip to content

Commit 207f97c

Browse files
authored
test: Add cypress test for basic functionality - refs #252543
1 parent 8004fc6 commit 207f97c

File tree

2 files changed

+45
-30
lines changed

2 files changed

+45
-30
lines changed

cypress/e2e/01-block-basics.cy.js

Lines changed: 0 additions & 30 deletions
This file was deleted.
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
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

Comments
 (0)