From 2fe41f3910e578d45cd36e88847cced382cb1785 Mon Sep 17 00:00:00 2001 From: tidusjar Date: Mon, 11 Oct 2021 14:07:30 +0100 Subject: [PATCH] test(automation): :test_tube: Fixed flakey tests --- .../tests/discover/discover-cards-requests.spec.ts | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/tests/cypress/tests/discover/discover-cards-requests.spec.ts b/tests/cypress/tests/discover/discover-cards-requests.spec.ts index 81d86d7e7..d024225f3 100644 --- a/tests/cypress/tests/discover/discover-cards-requests.spec.ts +++ b/tests/cypress/tests/discover/discover-cards-requests.spec.ts @@ -1,5 +1,5 @@ -import { discoverPage as Page } from "@/integration/page-objects"; import { DiscoverType } from "@/integration/page-objects/shared/DiscoverCard"; +import { discoverPage as Page } from "@/integration/page-objects"; describe("Discover Cards Requests Tests", () => { beforeEach(() => { @@ -288,9 +288,15 @@ describe("Discover Cards Requests Tests", () => { var expectedId = body[3].id; var title = body[3].title; + cy.wait(3000); + const card = Page.popularCarousel.getCard(expectedId, false, DiscoverType.Popular); card.title.realHover(); + cy.waitUntil(() => { + return card.requestButton.should("be.visible"); + }); + card.verifyTitle(title); card.requestButton.should("be.visible"); card.requestButton.click(); @@ -335,9 +341,15 @@ describe("Discover Cards Requests Tests", () => { var expectedId = body[5].id; var title = body[5].title; + cy.wait(3000); + const card = Page.popularCarousel.getCard(expectedId, false, DiscoverType.Popular); card.title.realHover(); + cy.waitUntil(() => { + return card.requestButton.should("be.visible"); + }); + card.verifyTitle(title); card.requestButton.should("be.visible"); card.requestButton.click();