test: switch branch spec ce (#35312)

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"




<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## 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.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

<!-- This is an auto-generated comment: Cypress test results  -->
> [!TIP]
> 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
> Workflow run:
<https://github.com/appsmithorg/appsmith/actions/runs/10181073301>
> Commit: 41db4eb0488c0cec98f06b0b7a7377a93c46b433
> <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=10181073301&attempt=1"
target="_blank">Cypress dashboard</a>.
> Tags: `@tag.Sanity`
> Spec:
> <hr>Wed, 31 Jul 2024 13:48:05 UTC
<!-- end of auto-generated comment: Cypress test results  -->
This commit is contained in:
NandanAnantharamu 2024-08-01 11:52:09 +05:30 committed by GitHub
parent ccedf2e88b
commit 9478bb5bd1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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);