diff --git a/cypress/integration/common/post.js b/cypress/integration/common/post.js index 63df8459b..23a7d5764 100644 --- a/cypress/integration/common/post.js +++ b/cypress/integration/common/post.js @@ -1,20 +1,13 @@ import { When, Then } from 'cypress-cucumber-preprocessor/steps' -When('I should be able to post a comment', () => { - cy.get('[contenteditable]') - .type('This is a comment') - // .get('.ds-form') - // .submit() - .get('button') - .contains('Submit Comment') - .click() - .get('.iziToast-message') +Then('my comment should be successfully created', () => { + cy.get('.iziToast-message') .contains('Comment Submitted') - }) - +}) + Then('I should see my comment', () => { cy.get('div.comment p') - .should('contain', 'This is a comment') + .should('contain', 'Human Connection rocks') }) Then('the editor should be cleared', () => { diff --git a/cypress/integration/post/Comment.feature b/cypress/integration/post/Comment.feature index 9290d7e21..8370bcfd4 100644 --- a/cypress/integration/post/Comment.feature +++ b/cypress/integration/post/Comment.feature @@ -12,6 +12,11 @@ Feature: Post Comment Scenario: Comment creation Given I visit "post/bWBjpkTKZp/101-essays" - Then I should be able to post a comment + And I type in the following text: + """ + Human Connection rocks + """ + And I click on "Submit Comment" + Then my comment should be successfully created And I should see my comment And the editor should be cleared