Skip to content

Commit

Permalink
add cy tests
Browse files Browse the repository at this point in the history
  • Loading branch information
danielamormocea committed Dec 21, 2021
1 parent 6b3f742 commit d25abc5
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions cypress/integration/block-basics.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,38 @@ describe('Blocks Tests', () => {
.contains('Columns')
.click();

cy.get('.columns-block .ui.card').eq(2).click();
cy.get('.field-wrapper-title #field-title').last().type('Column test');
cy.get('.field-wrapper-data .columns-area button').last().click();

cy.get('.columns-area .drag.handle.wrapper').first().trigger('mousedown', { which: 1 }, { force: true }).trigger('mousemove', 0, 60, {force: true}).trigger('mouseup');

cy.get('.field-wrapper-gridCols #field-gridCols').click();
cy.get('.react-select__menu').contains('25').click();


cy.get('.columns-block .block-editor-text [contenteditable=true]').eq(0).click().type("First");
cy.get('.columns-block .block-editor-text [contenteditable=true]').eq(1).click().type("Second");
cy.get('.columns-block .block-editor-text [contenteditable=true]').eq(2).click().type("Third");
cy.get('.block-toolbar button').eq(1).click();

cy.get('.field-wrapper-grid_vertical_align #field-grid_vertical_align').click();
cy.get('.react-select__menu').contains('Middle').click();
cy.get('.field-wrapper-backgroundColor .ui.huge.button').click();
cy.get('.github-picker.color-picker span').eq(3).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.contains('.columns-block');
cy.contains('First');
cy.contains('Second');
cy.contains('Third');
cy.get('.columns-view');
});
});

0 comments on commit d25abc5

Please sign in to comment.