Skip to content

Commit

Permalink
chore: Adding missing function in cypress git sync helper and syncing…
Browse files Browse the repository at this point in the history
… the common file across the two repositories. (#33368)

Fixes GitSync spec in CE repo. 

Previous PR which got dirty due to prettier check :
#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=""

### 🔍 Cypress test results
<!-- This is an auto-generated comment: Cypress test results  -->
> [!CAUTION]  
> If you modify the content in this section, you are likely to disrupt
the CI result for your PR.

<!-- end of auto-generated comment: Cypress test results  -->


## Communication
Should the DevRel and Marketing teams inform users about this change?
- [ ] Yes
- [ ] No
  • Loading branch information
trishaanand committed May 13, 2024
1 parent 7250422 commit 783bd10
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion app/client/cypress/support/Pages/GitSync.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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']";
Expand Down Expand Up @@ -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);
}
Expand Down

0 comments on commit 783bd10

Please sign in to comment.