From 6d1b9bdc2cfe8b8c5a70c684215d57933b671eea Mon Sep 17 00:00:00 2001 From: Sagar Khalasi Date: Wed, 7 Aug 2024 13:55:22 +0530 Subject: [PATCH] test: fix flaky case for forkapp (#35376) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Description Fix case with adding one more assertion with wait. RCA: The issue was not with the function itself but rather with the flaky behavior of the Cypress code. The modal was opening, and our code was attempting to click the “Skip to Application” button too quickly. The actual validation was only for SkipToAppBtn, but in the application, the modal was still loading, causing Cypress to perform the action prematurely, which led to failures. To address this, I added an additional wait for another element, and this resolved the issue. Fixes #`35375` ## Automation /ok-to-test tags="@tag.Fork" ### :mag: Cypress test results > [!TIP] > 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉 > Workflow run: > Commit: 748f4f7cf960355a957e59f3956a47880494da93 > Cypress dashboard. > Tags: `@tag.Fork` > Spec: >
Wed, 07 Aug 2024 07:08:45 UTC ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [x] No ## Summary by CodeRabbit ## Summary by CodeRabbit - **New Features** - Enhanced test robustness for the ForkApplication component by implementing a prerequisite check for the presence of a critical UI element linked to data sources. - **Bug Fixes** - Improved control flow in tests to ensure that necessary elements are available before proceeding with actions, reducing the likelihood of test failures. --- .../e2e/Regression/ClientSide/Fork/ForkApplication_spec.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/client/cypress/e2e/Regression/ClientSide/Fork/ForkApplication_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Fork/ForkApplication_spec.ts index 1cf1677b74..8a2bfbebb6 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Fork/ForkApplication_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Fork/ForkApplication_spec.ts @@ -14,6 +14,7 @@ import { fakerHelper, homePage, inviteModal, + dataSources, } from "../../../../support/Objects/ObjectsCore"; import EditorNavigation, { AppSidebar, @@ -110,6 +111,7 @@ describe( cy.log("isPartialImport : ", isPartialImport); if (isPartialImport) { agHelper.WaitUntilEleAppear(reconnectDatasourceModal.SkipToAppBtn); + agHelper.WaitUntilEleAppear(dataSources._saveDs); agHelper.GetNClick(reconnectDatasourceModal.SkipToAppBtn, 0, true); agHelper.WaitUntilEleDisappear(reconnectDatasourceModal.SkipToAppBtn); }