mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2025-12-13 07:45:56 +00:00
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:
parent
7fafa1eb6e
commit
bc35ab835f
@ -1,20 +1,13 @@
|
|||||||
import { When, Then } from 'cypress-cucumber-preprocessor/steps'
|
import { When, Then } from 'cypress-cucumber-preprocessor/steps'
|
||||||
|
|
||||||
When('I should be able to post a comment', () => {
|
Then('my comment should be successfully created', () => {
|
||||||
cy.get('[contenteditable]')
|
cy.get('.iziToast-message')
|
||||||
.type('This is a comment')
|
|
||||||
// .get('.ds-form')
|
|
||||||
// .submit()
|
|
||||||
.get('button')
|
|
||||||
.contains('Submit Comment')
|
|
||||||
.click()
|
|
||||||
.get('.iziToast-message')
|
|
||||||
.contains('Comment Submitted')
|
.contains('Comment Submitted')
|
||||||
})
|
})
|
||||||
|
|
||||||
Then('I should see my comment', () => {
|
Then('I should see my comment', () => {
|
||||||
cy.get('div.comment p')
|
cy.get('div.comment p')
|
||||||
.should('contain', 'This is a comment')
|
.should('contain', 'Human Connection rocks')
|
||||||
})
|
})
|
||||||
|
|
||||||
Then('the editor should be cleared', () => {
|
Then('the editor should be cleared', () => {
|
||||||
|
|||||||
@ -12,6 +12,11 @@ Feature: Post Comment
|
|||||||
|
|
||||||
Scenario: Comment creation
|
Scenario: Comment creation
|
||||||
Given I visit "post/bWBjpkTKZp/101-essays"
|
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 I should see my comment
|
||||||
And the editor should be cleared
|
And the editor should be cleared
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user