15 min fix - improve reliability of autocomplete cypress test (#13147)

This commit is contained in:
Suzanne Aitchison 2021-03-26 16:23:19 +00:00 committed by GitHub
parent 11f1c9d487
commit 49c20a0c72
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 6 deletions

View file

@ -6,12 +6,13 @@
<div id="comment-subscription">
<div role="presentation" class="crayons-btn-group">
<span class="crayons-btn crayons-btn--outlined">Subscribe</span>
</div>
</div>
</div>
</header>
<div
id="comments-container"
data-testid="comments-container"
data-commentable-id="<%= @article.id %>"
data-commentable-type="Article"
data-has-recent-comment-activity="<%= @article.has_recent_comment_activity? %>">

View file

@ -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');
});