Skip to content

Commit

Permalink
Merge pull request #13 from eea/correct-cypress-tests
Browse files Browse the repository at this point in the history
Correct Cypress tests
  • Loading branch information
tiberiuichim committed Dec 9, 2021
2 parents fdecddd + dca8e1c commit 9adb0be
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
19 changes: 10 additions & 9 deletions cypress/integration/block-basics.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,17 @@ describe('Blocks Tests', () => {
afterEach(tearDownAfterEach);

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

// Change page title
cy.get('.documentFirstHeading > .public-DraftStyleDefault-block')
.clear()
.type('My Add-on Page')
.get('.documentFirstHeading span[data-text]')
.contains('My Add-on Page');

cy.get('.documentFirstHeading > .public-DraftStyleDefault-block').type(
'{enter}',
);
cy.get('[contenteditable=true]').first().clear();

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

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

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

// Add block
cy.get('.ui.basic.icon.button.block-add-button').first().click();
Expand Down
2 changes: 1 addition & 1 deletion cypress/support/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export const setupBeforeEach = () => {
cy.waitForResourceToLoad('@types');
cy.waitForResourceToLoad('my-page');
cy.navigate('/cypress/my-page/edit');
cy.get(`.block.title [data-contents]`);
cy.get(`.block.title h1`);
};

export const tearDownAfterEach = () => {
Expand Down

0 comments on commit 9adb0be

Please sign in to comment.