From 4f7d5ee24fb49b285d5b0813d8b4cd7d97b34a49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=A4fer?= Date: Thu, 18 Apr 2019 19:05:36 +0200 Subject: [PATCH] Fix? flaky cypress by waiting for content Content menu is a client-side rendered component. Maybe an extra assertion will wait for it? That's how you can flix flaky cucumbers if you use capybara. --- cypress/integration/common/report.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/cypress/integration/common/report.js b/cypress/integration/common/report.js index 78abf5378..a6c13c3e6 100644 --- a/cypress/integration/common/report.js +++ b/cypress/integration/common/report.js @@ -52,10 +52,11 @@ When('I click on "Report Post" from the content menu of the post', () => { When( 'I click on "Report User" from the content menu in the user info box', () => { - cy.contains('.ds-card', davidIrvingName) - .find('.content-menu-trigger') - .first() - .click({force: true}) + // wait client-side-rendered content + cy.get('.ds-card-content .content-menu button').should('exist') + + cy.contains('.ds-card-content', davidIrvingName) + .find('.content-menu button').click() cy.get('.popover .ds-menu-item-link') .contains('Report User')