From c4ce5c5eb3d5aafa964c95eb29deccd9848cdc3e Mon Sep 17 00:00:00 2001 From: Kalle <38327916+Sendouc@users.noreply.github.com> Date: Tue, 19 Jul 2022 00:27:46 +0300 Subject: [PATCH] Try to fix flaky E2E test --- app/routes/plus/suggestions.tsx | 1 + cypress/e2e/plus.cy.ts | 17 ++++++++++++++--- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/app/routes/plus/suggestions.tsx b/app/routes/plus/suggestions.tsx index b64cb3b25..ab7eeb0a6 100644 --- a/app/routes/plus/suggestions.tsx +++ b/app/routes/plus/suggestions.tsx @@ -344,6 +344,7 @@ function SuggestedUser({ {suggested.suggestedUser.discordName} diff --git a/cypress/e2e/plus.cy.ts b/cypress/e2e/plus.cy.ts index 6c7271ad9..f9ef75a75 100644 --- a/cypress/e2e/plus.cy.ts +++ b/cypress/e2e/plus.cy.ts @@ -16,10 +16,21 @@ describe("Plus suggestions page", () => { it("adds a comment and deletes one", () => { cy.auth(); cy.visit(PLUS_SUGGESTIONS_PAGE); - cy.getCy("plus2-radio").click(); - cy.getCy("comment-button").first().click(); - cy.url().should("include", "/2/"); // let's check the radio button click did something + cy.getCy("suggested-user-name") + .first() + .invoke("text") + .then((previousContent) => { + cy.getCy("plus2-radio").click(); + + // let's verify the radio button click actually changed stuff + cy.getCy("suggested-user-name") + .first() + .invoke("text") + .should("not.equal", previousContent); + }); + + cy.getCy("comment-button").first().click(); cy.getCy("comment-textarea").type("Cracked!"); cy.getCy("submit-button").click();