Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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();
}
Comment on lines +393 to +403
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The MergeToMaster method is well-implemented. Consider adding error handling to manage potential failures during the merge process.

MergeToMaster() {
  try {
    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",
    );
  } catch (error) {
    console.error('Failed to merge to master:', error);
    // Handle error appropriately
  }
  this.CloseGitSyncModal();
}


OpenRepositoryAndVerify() {
this.agHelper.GetNClick(this._openRepoButton);
}
Expand Down