Search for button with text "Comment" in cypress test

This commit is contained in:
Matt Rider 2019-04-26 11:31:18 -03:00
parent 8d7fdec17f
commit 30d0ff3cc7
4 changed files with 13 additions and 6 deletions

View File

@ -1,5 +1,9 @@
import { When, Then } from 'cypress-cucumber-preprocessor/steps'
Then('I click on the {string} button', text => {
cy.get('button').contains(text).click()
})
Then('my comment should be successfully created', () => {
cy.get('.iziToast-message')
.contains('Comment Submitted')

View File

@ -16,7 +16,7 @@ Feature: Post Comment
"""
Human Connection rocks
"""
And I click on "Comment"
And I click on the "Comment" button
Then my comment should be successfully created
And I should see my comment
And the editor should be cleared

View File

@ -125,7 +125,10 @@
icon="messages"
/>
<ds-space margin-bottom="large" />
<hc-comment-form :post="post" @addComment="addComment" />
<hc-comment-form
:post="post"
@addComment="addComment"
/>
</ds-section>
</ds-card>
</transition>