From 783bd104ca01608311708a61b80c5acd9d63e33a Mon Sep 17 00:00:00 2001 From: Trisha Anand Date: Mon, 13 May 2024 10:19:49 +0530 Subject: [PATCH] chore: Adding missing function in cypress git sync helper and syncing the common file across the two repositories. (#33368) Fixes GitSync spec in CE repo. Previous PR which got dirty due to prettier check : https://github.com/appsmithorg/appsmith/pull/33360 ## Description > [!TIP] > _Add a TL;DR when the description is longer than 500 words or extremely technical (helps the content, marketing, and DevRel team)._ > > _Please also include relevant motivation and context. List any dependencies that are required for this change. Add links to Notion, Figma or any other documents that might be relevant to the PR._ Fixes #`Issue Number` _or_ Fixes `Issue URL` > [!WARNING] > _If no issue exists, please create an issue first, and check with the maintainers if the issue is valid._ ## Automation /ok-to-test tags="" ### :mag: Cypress test results > [!CAUTION] > If you modify the content in this section, you are likely to disrupt the CI result for your PR. ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [ ] No --- app/client/cypress/support/Pages/GitSync.ts | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/app/client/cypress/support/Pages/GitSync.ts b/app/client/cypress/support/Pages/GitSync.ts index 064762d07fd..3e74f01d4cc 100644 --- a/app/client/cypress/support/Pages/GitSync.ts +++ b/app/client/cypress/support/Pages/GitSync.ts @@ -38,12 +38,13 @@ export class GitSync { _checkMergeability = "//span[contains(text(), 'Checking mergeability')]"; public _branchListItem = "[data-testid=t--branch-list-item]"; public _bottomBarMergeButton = ".t--bottom-bar-merge"; + private mergeCTA = "[data-testid=t--git-merge-button]"; public _mergeBranchDropdownDestination = ".t--merge-branch-dropdown-destination"; public _dropdownmenu = ".rc-select-item-option-content"; private _openRepoButton = "[data-testid=t--git-repo-button]"; public _commitButton = ".t--commit-button"; - private _commitCommentInput = ".t--commit-comment-input textarea"; + public _commitCommentInput = ".t--commit-comment-input textarea"; public _discardChanges = ".t--discard-button"; public _discardCallout = "[data-testid='t--discard-callout']"; @@ -389,6 +390,18 @@ export class GitSync { this.agHelper.AssertElementAbsence(this._checkMergeability, 35000); } + MergeToMaster() { + this.CheckMergeConflicts("master"); + this.agHelper.AssertElementEnabledDisabled(this.mergeCTA, 0, false); + this.agHelper.GetNClick(this.mergeCTA); + this.assertHelper.AssertNetworkStatus("@mergeBranch"); + this.agHelper.AssertContains( + Cypress.env("MESSAGES").MERGED_SUCCESSFULLY(), + "be.visible", + ); + this.CloseGitSyncModal(); + } + OpenRepositoryAndVerify() { this.agHelper.GetNClick(this._openRepoButton); }