From 30d0ff3cc7c747509f4c4725c4294df49986de5a Mon Sep 17 00:00:00 2001 From: Matt Rider Date: Fri, 26 Apr 2019 11:31:18 -0300 Subject: [PATCH] Search for button with text "Comment" in cypress test --- cypress/integration/common/post.js | 4 ++++ cypress/integration/post/Comment.feature | 2 +- webapp/components/CommentForm/index.vue | 8 ++++---- webapp/pages/post/_id/_slug/index.vue | 5 ++++- 4 files changed, 13 insertions(+), 6 deletions(-) diff --git a/cypress/integration/common/post.js b/cypress/integration/common/post.js index 23a7d5764..85a9f3339 100644 --- a/cypress/integration/common/post.js +++ b/cypress/integration/common/post.js @@ -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') diff --git a/cypress/integration/post/Comment.feature b/cypress/integration/post/Comment.feature index 9d76a8cef..e7e462824 100644 --- a/cypress/integration/post/Comment.feature +++ b/cypress/integration/post/Comment.feature @@ -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 diff --git a/webapp/components/CommentForm/index.vue b/webapp/components/CommentForm/index.vue index b1f3ddf80..3c73300c2 100644 --- a/webapp/components/CommentForm/index.vue +++ b/webapp/components/CommentForm/index.vue @@ -14,9 +14,9 @@ /> - - - + + + - + - +