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

@ -14,9 +14,9 @@
/>
</no-ssr>
<ds-space />
<ds-flex :gutter="{ base: 'small', md: 'small', sm: 'x-large', xs: 'x-large' }" >
<ds-flex :gutter="{ base: 'small', md: 'small', sm: 'x-large', xs: 'x-large' }">
<ds-flex-item :width="{ base: '0%', md: '50%', sm: '0%', xs: '0%' }" />
<ds-flex-item :width="{ base: '40%', md: '20%', sm: '30%', xs: '30%' }" >
<ds-flex-item :width="{ base: '40%', md: '20%', sm: '30%', xs: '30%' }">
<ds-button
:disabled="disabled"
ghost
@ -25,7 +25,7 @@
{{ $t('actions.cancel') }}
</ds-button>
</ds-flex-item>
<ds-flex-item :width="{ base: '40%', md: '20%', sm: '40%', xs: '40%' }" >
<ds-flex-item :width="{ base: '40%', md: '20%', sm: '40%', xs: '40%' }">
<ds-button
type="submit"
:disabled="disabled || errors"

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>