Skip to content

Commit

Permalink
test(cypress): Fix failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
avoinea committed Oct 31, 2022
1 parent 9a6e752 commit 6ad0c2b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 19 deletions.
17 changes: 7 additions & 10 deletions cypress/e2e/01-blocks-metadata-section.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,20 @@ describe('Blocks Tests', () => {

it('Add Metadata block: Description', () => {
// without this the clear command below does nothing sometimes
cy.wait(500);

// Change page title
cy.get('[contenteditable=true]').first().clear();

cy.get('[contenteditable=true]').first().type('My Add-on Page');
cy.clearSlateTitle();
cy.getSlateTitle().type('My Add-on Page');

cy.get('.documentFirstHeading').contains('My Add-on Page');

cy.get('[contenteditable=true]').first().type('{enter}');
cy.getSlate().click();

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

cy.get('.objectlist-widget button').contains('Add Field').click();
cy.get('.objectlist-widget .react-select__value-container')
.click()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,21 @@ describe('Blocks Tests', () => {
afterEach(slateAfterEach);

it('Add Metadata block: Description', () => {
// without this the clear command below does nothing sometimes
cy.wait(500);

// Change page title
cy.get('[contenteditable=true]').first().clear();

cy.get('[contenteditable=true]').first().type('My Add-on Page');
cy.clearSlateTitle();
cy.getSlateTitle().type('My Add-on Page');

cy.get('.documentFirstHeading').contains('My Add-on Page');

cy.get('[contenteditable=true]').first().type('{enter}');
cy.getSlate().click();

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

cy.get('.block.metadata input').click().type('Summary').type('{enter}');
cy.get('.block.metadata textarea').click().type('Test metadata: Summary');

Expand Down

0 comments on commit 6ad0c2b

Please sign in to comment.