From 49c20a0c7201bb7607d8a91c6f067ed2e2f1ef00 Mon Sep 17 00:00:00 2001 From: Suzanne Aitchison Date: Fri, 26 Mar 2021 16:23:19 +0000 Subject: [PATCH] 15 min fix - improve reliability of autocomplete cypress test (#13147) --- app/views/articles/_full_comment_area.html.erb | 3 ++- .../integration/articleFlows/commentOnArticle.spec.js | 11 ++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/app/views/articles/_full_comment_area.html.erb b/app/views/articles/_full_comment_area.html.erb index ce6e2b8a8..696d9ba36 100644 --- a/app/views/articles/_full_comment_area.html.erb +++ b/app/views/articles/_full_comment_area.html.erb @@ -6,12 +6,13 @@
+
diff --git a/cypress/integration/articleFlows/commentOnArticle.spec.js b/cypress/integration/articleFlows/commentOnArticle.spec.js index 9c88e21b9..0ef0c4b8a 100644 --- a/cypress/integration/articleFlows/commentOnArticle.spec.js +++ b/cypress/integration/articleFlows/commentOnArticle.spec.js @@ -257,11 +257,12 @@ describe('Comment on articles', () => { cy.findByRole('link', { name: /Reply/ }); - // Wait for the comment to save - cy.findByText('Edit'); - - cy.findAllByLabelText('Toggle dropdown menu').last().click(); - cy.findByText('Edit').click(); + cy.findByTestId('comments-container').within(() => { + cy.findByLabelText('Toggle dropdown menu').click(); + // Wait for the menu to be visible + cy.findByText('Edit').should('be.visible'); + cy.findByText('Edit').click(); + }); cy.findByDisplayValue('first comment').should('exist'); });