From 9478bb5bd1ce101f4bfcfdfbdf8a61f108eb3923 Mon Sep 17 00:00:00 2001 From: NandanAnantharamu <67676905+NandanAnantharamu@users.noreply.github.com> Date: Thu, 1 Aug 2024 11:52:09 +0530 Subject: [PATCH] test: switch branch spec ce (#35312) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Enabled Test Replaced some validations with should with aghelper assertions EE: https://github.com/appsmithorg/appsmith-ee/pull/4755 /ok-to-test tags="@tag.Sanity" ## Summary by CodeRabbit - **Bug Fixes** - Enhanced testing for Git synchronization by refining branch name handling in input fields, leading to improved reliability. - **Chores** - Updated the Cypress limited tests to focus on the `SwitchBranches_spec.js`, changing the test execution target. - Removed unnecessary wait command to streamline test execution. > [!TIP] > 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉 > Workflow run: > Commit: 41db4eb0488c0cec98f06b0b7a7377a93c46b433 > Cypress dashboard. > Tags: `@tag.Sanity` > Spec: >
Wed, 31 Jul 2024 13:48:05 UTC --- .../ClientSide/Git/GitSync/SwitchBranches_spec.js | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/app/client/cypress/e2e/Regression/ClientSide/Git/GitSync/SwitchBranches_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Git/GitSync/SwitchBranches_spec.js index 5218cc6b63..93f24e1e27 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Git/GitSync/SwitchBranches_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Git/GitSync/SwitchBranches_spec.js @@ -40,22 +40,20 @@ describe("Git sync:", { tags: ["@tag.Git"] }, function () { cy.get(gitSyncLocators.branchSearchInput).type( `{selectall}${hypenBranchName}`, ); - cy.get(gitSyncLocators.branchSearchInput).should( - "have.value", + agHelper.AssertAttribute( + gitSyncLocators.branchSearchInput, + "value", "hypen-branch-name", ); - const specialBranchName = "special&branch-name~@#$%^&*()_+={}[]><,."; cy.get(gitSyncLocators.branchSearchInput).type( `{selectall}${specialBranchName}`, ); - - cy.get(gitSyncLocators.branchSearchInput).should( - "have.value", + agHelper.AssertAttribute( + gitSyncLocators.branchSearchInput, + "value", "special_branch-name_____________________", ); - - cy.wait(200); cy.get(gitSyncLocators.closeBranchList).click(); }); @@ -207,7 +205,6 @@ describe("Git sync:", { tags: ["@tag.Git"] }, function () { cy.get(gitSyncLocators.branchListItem) .contains(remoteTempBranchRenamedRegex) .should("exist"); - cy.get(gitSyncLocators.closeBranchList).click(); cy.switchGitBranch(`origin/${tempBranchRenamed}`); cy.switchGitBranch(`origin/${tempBranchRenamed}`, true);