Modify cypress tests, attempt to get them to work

- they are still not triggering a change in form.content, therefore sending an empty string and either failing the back end validations, or if removed creating a comment with an empty string
This commit is contained in:
Matt Rider 2019-04-24 20:56:57 -03:00
parent 7fafa1eb6e
commit bc35ab835f
2 changed files with 11 additions and 13 deletions

View File

@ -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', () => {

View File

@ -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