Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: git mod - test fixes #38357

Open
wants to merge 155 commits into
base: release
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
155 commits
Select commit Hold shift + click to select a range
1119f65
chore: adding apis for git
brayn003 Dec 5, 2024
2900b65
fix: review changes
brayn003 Dec 5, 2024
0d1fa18
Merge branch 'release' of github.com:appsmithorg/appsmith into chore/…
brayn003 Dec 5, 2024
146238c
fix: fixing enum imports
brayn003 Dec 5, 2024
e72e02f
chore: changing named export to default export
brayn003 Dec 6, 2024
54b5d93
Merge branch 'release' of github.com:appsmithorg/appsmith into chore/…
brayn003 Dec 6, 2024
a1b608b
Merge branch 'release' of github.com:appsmithorg/appsmith into chore/…
brayn003 Dec 6, 2024
0bb662f
fix: adding saga for commit and connect
brayn003 Dec 7, 2024
d7e6c79
chore: adding global profile and config redux slice
brayn003 Dec 7, 2024
02e128b
chore: adding saga for git profile update
brayn003 Dec 7, 2024
3218b3a
chore: adding fetch branches saga
brayn003 Dec 7, 2024
f9c4030
chore: adding fetch and update local profile
brayn003 Dec 7, 2024
adafd14
fix: fixing connectsaga
brayn003 Dec 7, 2024
488b346
fix: review changes
brayn003 Dec 8, 2024
942193d
chore: adding branch based sagas
brayn003 Dec 9, 2024
e9167f2
fix: moving things around
brayn003 Dec 9, 2024
d024160
chore: adding ctx
brayn003 Dec 9, 2024
ef34582
chore: expanding context provider and making contextaware comps
brayn003 Dec 9, 2024
c3d9a31
fix: remove gittest
brayn003 Dec 9, 2024
fa8c461
chore: adding init sagas
brayn003 Dec 10, 2024
9b1414e
fix: test fixes
brayn003 Dec 10, 2024
2de337e
fix: review changes
brayn003 Dec 10, 2024
40f057e
Merge branch 'chore/git-mod-5' of github.com:appsmithorg/appsmith int…
brayn003 Dec 10, 2024
826dbf8
Merge branch 'release' of github.com:appsmithorg/appsmith into chore/…
brayn003 Dec 10, 2024
3a47055
chore: adding autocommit to saga
brayn003 Dec 10, 2024
ca19474
fix: adding relevant selectors for quick git actions
brayn003 Dec 10, 2024
3a2a045
Merge branch 'release' of github.com:appsmithorg/appsmith into chore/…
brayn003 Dec 11, 2024
59f91f4
fix: resolving conflict errors
brayn003 Dec 11, 2024
e1eb35a
fix: review changes
brayn003 Dec 11, 2024
3c4a4c2
Merge branch 'chore/git-mod-5' of github.com:appsmithorg/appsmith int…
brayn003 Dec 11, 2024
fbcf6ae
fix: fixing test cases
brayn003 Dec 11, 2024
56cbaef
fix: fixing more test cases
brayn003 Dec 11, 2024
f8545b4
fix: changing AxiosResponse to AxiosPromise
brayn003 Dec 11, 2024
65e9ea6
fix: fixing build and naming issues
brayn003 Dec 11, 2024
2b7c3d2
Merge branch 'release' of github.com:appsmithorg/appsmith into chore/…
brayn003 Dec 11, 2024
f613ae1
fix: remove expect error
brayn003 Dec 11, 2024
adddd08
chore: adding git ops modal
brayn003 Dec 11, 2024
c6343d3
fix: arranging dumb components in a better fashion
brayn003 Dec 11, 2024
c5c9585
fix: adding conflicterror and conflicterrormodal
brayn003 Dec 11, 2024
c5b8cf3
fix: adding pull sagas
brayn003 Dec 11, 2024
bcef9f5
chore: adding deploy tab
brayn003 Dec 11, 2024
0e84fb8
chore: adding merge tab
brayn003 Dec 11, 2024
c88bc0b
fix: review changes
brayn003 Dec 12, 2024
885446c
Merge branch 'chore/git-mod-6' of github.com:appsmithorg/appsmith int…
brayn003 Dec 12, 2024
e106d43
fix: better handling of ctx values
brayn003 Dec 12, 2024
005a655
fix: minor fixes to merge comp
brayn003 Dec 12, 2024
ba6ac37
chore: adding skeleton for status
brayn003 Dec 12, 2024
54ac997
chore: adding status component and transformer
brayn003 Dec 12, 2024
8c310af
Merge branch 'release' of github.com:appsmithorg/appsmith into chore/…
brayn003 Dec 12, 2024
523296b
fix: adding autocommit statusbar
brayn003 Dec 12, 2024
8745497
Merge branch 'chore/git-mod-7' of github.com:appsmithorg/appsmith int…
brayn003 Dec 12, 2024
9d57e5a
chore: adding git settings modal
brayn003 Dec 12, 2024
44167c0
chore: wip - git settings modal
brayn003 Dec 13, 2024
f698d26
fix: fixing error handling
brayn003 Dec 13, 2024
245cb9b
chore: minor changes in error handling
brayn003 Dec 13, 2024
cc35140
chore: review fixes
brayn003 Dec 13, 2024
1b1da07
Merge branch 'chore/git-mod-7' of github.com:appsmithorg/appsmith int…
brayn003 Dec 13, 2024
8dc482f
fix: review comments
brayn003 Dec 13, 2024
e70f659
Merge branch 'chore/git-mod-7' of github.com:appsmithorg/appsmith int…
brayn003 Dec 13, 2024
801b06b
chore: minor fixes for build failures
brayn003 Dec 13, 2024
b4f8925
Merge branch 'release' of github.com:appsmithorg/appsmith into chore/…
brayn003 Dec 13, 2024
ec461fd
chore: review fixes
brayn003 Dec 13, 2024
7f54647
Merge branch 'chore/git-mod-7' of github.com:appsmithorg/appsmith int…
brayn003 Dec 13, 2024
b997ada
Merge branch 'release' of github.com:appsmithorg/appsmith into chore/…
brayn003 Dec 13, 2024
a569b22
chore: shifting fixes from ee to ee
brayn003 Dec 13, 2024
f715c2a
fix: minor fixes
brayn003 Dec 13, 2024
1273fc6
chore: adding initial state
brayn003 Dec 13, 2024
0be3210
Merge branch 'release' of github.com:appsmithorg/appsmith into chore/…
brayn003 Dec 13, 2024
2953823
chore: renaming files
brayn003 Dec 13, 2024
2be8c89
fix: minor
brayn003 Dec 13, 2024
e1588c9
chore: fixes build issue
brayn003 Dec 13, 2024
008f857
chore: adding branch protection
brayn003 Dec 13, 2024
fe620bd
chore: adding local profile
brayn003 Dec 13, 2024
d8dca7f
fix: issue with localprofile
brayn003 Dec 13, 2024
e23819b
chore: adding general tab
brayn003 Dec 14, 2024
a7f5832
chore: added disconnect modal
brayn003 Dec 14, 2024
7b48aa2
chore: adding disable autocommit modal
brayn003 Dec 14, 2024
57aa219
chore: adding disconnect and toggle autocommit saga
brayn003 Dec 14, 2024
612c35a
chore: adding base for CD
brayn003 Dec 14, 2024
ee50685
chore: moving things around
brayn003 Dec 14, 2024
e20e0a2
chore: adding minor fixes
brayn003 Dec 14, 2024
b16bf38
chore: adding connect first draft
brayn003 Dec 15, 2024
34f7a00
chore: adding logic for connect modal
brayn003 Dec 15, 2024
a71a664
chore: adding fixes
brayn003 Dec 15, 2024
5e40b10
chore: review comment fix
brayn003 Dec 15, 2024
3921112
chore: adding branch popup
brayn003 Dec 15, 2024
9071d0e
chore: wip ce-ee split
brayn003 Dec 16, 2024
6314fe2
chore: additional ee files
brayn003 Dec 16, 2024
8d077c8
chore: wip more ce-ee split
brayn003 Dec 16, 2024
56f05cf
chore: removing old ee folder
brayn003 Dec 16, 2024
24d5e1c
Merge branch 'chore/git-mod-8' of github.com:appsmithorg/appsmith int…
brayn003 Dec 16, 2024
546fd66
chore: conflict errors
brayn003 Dec 16, 2024
bbbee85
chore: fix branch list
brayn003 Dec 16, 2024
52b5c4f
chore: adding ff
brayn003 Dec 16, 2024
f789c5a
chore: unlicensed cd
brayn003 Dec 16, 2024
062e19a
Merge branch 'chore/git-mod-8' of github.com:appsmithorg/appsmith int…
brayn003 Dec 16, 2024
a6529bc
Merge branch 'release' of github.com:appsmithorg/appsmith into chore/…
brayn003 Dec 16, 2024
bc6b90e
Merge branch 'release' of github.com:appsmithorg/appsmith into chore/…
brayn003 Dec 17, 2024
243f299
Merge branch 'release' of github.com:appsmithorg/appsmith into chore/…
brayn003 Dec 17, 2024
5d758ca
Merge branch 'release' of github.com:appsmithorg/appsmith into chore/…
brayn003 Dec 17, 2024
34d96b4
chore: fixing typo
brayn003 Dec 17, 2024
4831434
chore: adding integration behind feature flag
brayn003 Dec 17, 2024
df628d7
chore: mod flag for components and selectors
brayn003 Dec 17, 2024
c100cc2
chore: introducing artfactdef for better state mgmt
brayn003 Dec 17, 2024
64c8a84
chore: moving selectors
brayn003 Dec 18, 2024
41e8b6f
Merge branch 'release' of github.com:appsmithorg/appsmith into chore/…
brayn003 Dec 23, 2024
b407de1
Merge branch 'release' of github.com:appsmithorg/appsmith into chore/…
brayn003 Dec 23, 2024
e724bcb
chore: typo error
brayn003 Dec 23, 2024
469a675
chore: fix action dispatch call
brayn003 Dec 23, 2024
7478804
chore: renaming files and types more consistently
brayn003 Dec 23, 2024
bc06f26
chore: fixing connect and import flow
brayn003 Dec 23, 2024
2730e4a
chore: integrating git profile
brayn003 Dec 23, 2024
022ac38
chore: rm console
brayn003 Dec 23, 2024
a38be13
chore: adding import modal on cta
brayn003 Dec 23, 2024
35ff365
feat: integrating with deploy btn
brayn003 Dec 23, 2024
1d6177f
Merge branch 'release' of github.com:appsmithorg/appsmith into chore/…
brayn003 Dec 23, 2024
1498ddc
chore: fix git import modal
brayn003 Dec 23, 2024
bda63a5
chore: putting gitapplicationProvider in better places
brayn003 Dec 23, 2024
a0a3d29
chore: fix connect issue
brayn003 Dec 23, 2024
1f55194
chore: minor fixes
brayn003 Dec 23, 2024
a9a65c3
chore: minor fixes for disconnect flow
brayn003 Dec 23, 2024
ad48cd9
chore: passing unit tests
brayn003 Dec 24, 2024
e7c116c
chore: fixing connect flow
brayn003 Dec 24, 2024
a6926c9
chore: fixing unit tests
brayn003 Dec 24, 2024
a2e48c9
chore: build failure
brayn003 Dec 24, 2024
741d1f0
chore: fixing unit test with mock
brayn003 Dec 24, 2024
10a4325
chore: fixing status comp
brayn003 Dec 24, 2024
5c46d32
fix: fixing when ff is off
brayn003 Dec 24, 2024
4b18bae
Merge branch 'release' of github.com:appsmithorg/appsmith into chore/…
brayn003 Dec 24, 2024
0b57fae
chore: fix typo
brayn003 Dec 24, 2024
059417b
chore: fixing unit tests
brayn003 Dec 24, 2024
034a91d
chore: fixing tests
brayn003 Dec 24, 2024
9eaa84c
Merge branch 'release' of github.com:appsmithorg/appsmith into chore/…
brayn003 Dec 25, 2024
fb8f916
Merge branch 'chore/git-mod-10' of github.com:appsmithorg/appsmith in…
brayn003 Dec 25, 2024
e678dd9
chore: cytest fix
brayn003 Dec 25, 2024
5fd6853
chore: fixing cypress tests
brayn003 Dec 25, 2024
b19338d
Merge branch 'chore/git-mod-10' of github.com:appsmithorg/appsmith in…
brayn003 Dec 25, 2024
989e70f
chore: fixed test locators
brayn003 Dec 25, 2024
57d9238
chore: lint fixes
brayn003 Dec 25, 2024
e45794e
chore: locators cleanup
brayn003 Dec 25, 2024
89a7ea6
chore: modifying choosegitprovider unit test
brayn003 Dec 25, 2024
a7110f0
chore: fixing typo in selectors
brayn003 Dec 25, 2024
4e321a2
chore: adding add deploy key
brayn003 Dec 26, 2024
4c93e4c
fix: deploy key fix
brayn003 Dec 26, 2024
59d9d1a
Merge branch 'release' of github.com:appsmithorg/appsmith into chore/…
brayn003 Dec 26, 2024
358b659
chore: fixing selectors for repetition
brayn003 Dec 27, 2024
83579a9
Merge branch 'release' of github.com:appsmithorg/appsmith into chore/…
brayn003 Dec 27, 2024
5444ae2
Merge branch 'chore/git-mod-10' of github.com:appsmithorg/appsmith in…
brayn003 Dec 27, 2024
82dc139
chore: fixing gitsynclocators
brayn003 Dec 28, 2024
8124d0c
chore: updating locators
brayn003 Dec 28, 2024
19f3ca0
Merge branch 'release' of github.com:appsmithorg/appsmith into chore/…
brayn003 Dec 28, 2024
b0893cb
Merge branch 'chore/git-mod-10' of github.com:appsmithorg/appsmith in…
brayn003 Dec 28, 2024
98d2118
chore: fixing bugs
brayn003 Dec 28, 2024
e10e0d0
chore: fixing gitsync import
brayn003 Dec 28, 2024
6385eca
chore: fixing more tests
brayn003 Dec 28, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ describe(
_.dataManager.dsValues[_.dataManager.defaultEnviorment].mockApiUrl,
"GitSyncTest",
);
_.gitSync.OpenGitSyncModal();
_.gitSync.OpenConnectModal();
cy.get("body").type(`{${modifierKey}}{enter}`);
cy.get("@postExecute").should("not.exist");
_.gitSync.CloseGitSyncModal();
_.gitSync.CloseConnectModal();
cy.get("body").type(`{${modifierKey}}{enter}`);
_.assertHelper.AssertNetworkStatus("@postExecute");
});
Expand All @@ -60,7 +60,9 @@ describe(
_.dataSources.CreatePlugIn("PostgreSQL");
_.dataSources.FillPostgresDSForm();
_.dataSources.SaveDSFromDialog(false);
_.agHelper.AssertElementVisibility(_.gitSync._branchButton);
_.agHelper.AssertElementVisibility(
_.gitSync.locators.quickActionsBranchBtn,
);
cy.get("@gitRepoName").then((repName) => {
repoName = repName;
});
Expand Down Expand Up @@ -106,18 +108,20 @@ describe(
_.agHelper.GetNClick(_.locators._appNavigationSettingsShowTitle);
AppSidebar.navigate(AppSidebarButton.Editor);
_.agHelper.GetNClick(_.locators._publishButton);
_.agHelper.WaitUntilEleAppear(_.gitSync._gitStatusChanges);
_.agHelper.GetNClick(_.gitSync._discardChanges);
_.agHelper.WaitUntilEleAppear(_.gitSync._discardCallout);
_.agHelper.WaitUntilEleAppear(_.gitSync.locators.status);
_.agHelper.GetNClick(_.gitSync.locators.opsDiscardBtn);
_.agHelper.WaitUntilEleAppear(
_.gitSync.locators.opsDiscardWarningCallout,
);
_.agHelper.AssertContains(
Cypress.env("MESSAGES").DISCARD_CHANGES_WARNING(),
"exist",
_.gitSync._discardCallout,
_.gitSync.locators.opsDiscardWarningCallout,
);
_.agHelper.AssertContains(
Cypress.env("MESSAGES").DISCARD_MESSAGE(),
"exist",
_.gitSync._discardCallout,
_.gitSync.locators.opsDiscardWarningCallout,
);
_.agHelper.GetNClick(_.locators._dialogCloseButton);
});
Expand Down Expand Up @@ -147,18 +151,18 @@ describe(
_.gitSync.CreateGitBranch(tempBranch1, true);
_.gitSync.CreateGitBranch(tempBranch2, true);
_.gitSync.CreateGitBranch(tempBranch3, true);
_.agHelper.AssertElementExist(_.gitSync._bottomBarPull);
_.agHelper.GetNClick(_.gitSync._bottomBarMergeButton);
_.agHelper.AssertElementExist(_.gitSync.locators.quickActionsPullBtn);
_.agHelper.GetNClick(_.gitSync.locators.quickActionsMergeBtn);
_.agHelper.AssertElementEnabledDisabled(
_.gitSync._mergeBranchDropdownDestination,
_.gitSync.locators.opsMergeBranchSelect,
0,
false,
);
_.agHelper.Sleep(6000); // adding wait for branch list to load
_.agHelper.GetNClick(_.gitSync._mergeBranchDropdownDestination);
_.agHelper.GetNClick(_.gitSync.locators.opsMergeBranchSelect);
// to verify scroll works and clicks on last branch in list
_.agHelper.GetNClick(_.gitSync._dropdownmenu, 5);
_.gitSync.CloseGitSyncModal();
_.agHelper.GetNClick(".rc-select-item-option-content", 5);
_.gitSync.CloseConnectModal();
});

it("8. Bug 24206 : Open repository button is not functional in git sync modal", function () {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,16 @@ describe(

// this logic will have to be removed after decimal issue with auto-commit is resolved
assertHelper.AssertNetworkResponseData("gitStatus");
agHelper.AssertElementExist(gitSync._bottomBarCommit, 0, 30000);
agHelper.GetNClick(gitSync._bottomBarCommit);
agHelper.AssertElementVisibility(gitSync._gitSyncModal);
agHelper.GetNClick(gitSync._commitButton);
agHelper.AssertElementExist(
gitSync.locators.quickActionsCommitBtn,
0,
30000,
);
agHelper.GetNClick(gitSync.locators.quickActionsCommitBtn);
agHelper.AssertElementVisibility(gitSync.locators.opsModal);
agHelper.GetNClick(gitSync.locators.quickActionsCommitBtn);
assertHelper.AssertNetworkStatus("@commit", 201);
gitSync.CloseGitSyncModal();
gitSync.CloseOpsModal();
});

it("1. Deploy the app & Validate CRUD pages - Mongo , MySql, Postgres pages", () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ describe(
expect(
interception?.response?.body?.data?.autoCommitResponse,
).to.equal("PUBLISHED");
agHelper.WaitUntilEleAppear(gitSync._autocommitStatusbar);
agHelper.WaitUntilEleAppear(gitSync.locators.autocommitLoader);
});
cy.wait("@gitAutocommitProgressApi").then((interceptions) => {
expect(interceptions?.response?.statusCode).to.equal(200);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import {
propPane,
} from "../../../../../support/Objects/ObjectsCore";

import gitSyncLocators from "../../../../../locators/gitSyncLocators";
import EditorNavigation, {
EntityType,
PageLeftPane,
Expand Down Expand Up @@ -187,8 +186,8 @@ describe(
it("9. On discard failure an error message should be show and user should be able to discard again", () => {
cy.Createpage(page3);

agHelper.GetNClick(gitSyncLocators.bottomBarCommitButton);
agHelper.AssertElementVisibility(gitSyncLocators.discardChanges);
agHelper.GetNClick(gitSync.locators.quickActionsCommitBtn);
agHelper.AssertElementVisibility(gitSync.locators.opsDiscardBtn);
cy.intercept("PUT", "/api/v1/git/discard/app/*", {
body: {
responseMeta: {
Expand All @@ -206,27 +205,27 @@ describe(
});

agHelper
.GetElement(gitSyncLocators.discardChanges)
.GetElement(gitSync.locators.opsDiscardBtn)
.children()
.should("have.text", "Discard & pull");

agHelper.GetNClick(gitSyncLocators.discardChanges);
agHelper.GetNClick(gitSync.locators.opsDiscardBtn);
agHelper.AssertContains(
Cypress.env("MESSAGES").DISCARD_CHANGES_WARNING(),
);
agHelper
.GetElement(gitSyncLocators.discardChanges)
.GetElement(gitSync.locators.opsDiscardBtn)
.children()
.should("have.text", "Are you sure?");
agHelper.GetNClick(gitSyncLocators.discardChanges);
agHelper.GetNClick(gitSync.locators.opsDiscardBtn);
agHelper.AssertContains(
Cypress.env("MESSAGES").DISCARDING_AND_PULLING_CHANGES(),
);
cy.contains(Cypress.env("MESSAGES").DISCARDING_AND_PULLING_CHANGES());
agHelper.Sleep(2000);

agHelper.AssertElementVisibility(".ads-v2-callout__children");
agHelper.AssertElementVisibility(gitSyncLocators.discardChanges);
agHelper.AssertElementVisibility(gitSync.locators.opsDiscardBtn);
});

after(() => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import gitSyncLocators from "../../../../../locators/gitSyncLocators";
import homePageLocators from "../../../../../locators/HomePage";
import reconnectDatasourceModal from "../../../../../locators/ReconnectLocators";
const datasourceEditor = require("../../../../../locators/DatasourcesEditor.json");
Expand Down Expand Up @@ -85,7 +84,7 @@ describe(
gitSync.CreateGitBranch(repoName);
});

agHelper.AssertElementExist(gitSync._bottomBarPull);
agHelper.AssertElementExist(gitSync.locators.quickActionsPullBtn);
});
});

Expand Down Expand Up @@ -129,11 +128,11 @@ describe(
cy.log(interception.response.body.data);
cy.wait(1000);
});
agHelper.AssertElementExist(gitSync._bottomBarPull);
agHelper.AssertElementExist(gitSync.locators.quickActionsPullBtn);

cy.wait(3000); //for uncommited changes to appear if any!
cy.get("body").then(($body) => {
if ($body.find(gitSyncLocators.gitPullCount).length > 0) {
if ($body.find(gitSync.locators.quickActionsCommitCount).length > 0) {
gitSync.CommitAndPush();
}
});
Expand Down Expand Up @@ -179,12 +178,12 @@ describe(
// deploy the app and validate data binding
cy.wait(2000);
cy.get(homePageLocators.publishButton).click();
agHelper.AssertElementExist(gitSync._bottomBarPull);
cy.get(gitSyncLocators.commitCommentInput).type("Initial Commit");
cy.get(gitSyncLocators.commitButton).click();
agHelper.AssertElementExist(gitSync.locators.quickActionsPullBtn);
cy.get(gitSync.locators.opsCommitInput).type("Initial Commit");
cy.get(gitSync.locators.opsCommitBtn).click();
cy.intercept("POST", "api/v1/git/commit/app/*").as("commit");
agHelper.AssertElementExist(gitSync._bottomBarPull);
cy.get(gitSyncLocators.closeGitSyncModal).click();
agHelper.AssertElementExist(gitSync.locators.quickActionsPullBtn);
gitSync.CloseOpsModal();
cy.wait(2000);
gitSync.MergeToMaster();
cy.wait(2000);
Expand Down Expand Up @@ -230,7 +229,7 @@ describe(
cy.wait(3000);
gitSync.CommitAndPush();
cy.merge(newBranch);
cy.get(gitSyncLocators.closeGitSyncModal).click();
gitSync.CloseOpsModal();
cy.wait(2000);
cy.switchGitBranch(newBranch);
cy.wait(4000);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import homePage from "../../../../../locators/HomePage";
import gitSyncLocators from "../../../../../locators/gitSyncLocators";
import * as _ from "../../../../../support/Objects/ObjectsCore";

describe(
Expand Down Expand Up @@ -44,7 +42,7 @@ describe(
const message = interception.response.body.responseMeta.error.message;
expect(status).to.be.gte(400);
expect(message).to.contain(failureMessage);
cy.get(gitSyncLocators.closeGitSyncModal).click();
_.gitSync.CloseConnectModal();
});
});
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import gitSyncLocators from "../../../../../locators/gitSyncLocators";

import { agHelper, gitSync } from "../../../../../support/Objects/ObjectsCore";
import {
PageLeftPane,
Expand Down Expand Up @@ -39,7 +37,7 @@ describe(
agHelper.ValidateToastMessage(
`Cannot delete checked out branch. Please check out other branch before deleting ${branchName}.`,
);
cy.get(gitSyncLocators.closeBranchList).click({ force: true });
cy.get(gitSync.locators.branchCloseBtn).click({ force: true });
// switch to master and delete new branch created
cy.switchGitBranch("master");
cy.wait(2000);
Expand All @@ -50,7 +48,7 @@ describe(
"response.body.responseMeta.status",
200,
);
cy.get(gitSyncLocators.closeBranchList).click({ force: true });
cy.get(gitSync.locators.branchCloseBtn).click({ force: true });
// verify remote branch is there for the deleted local branch
cy.wait(2000);
cy.switchGitBranch(`origin/${branchName}`);
Expand Down Expand Up @@ -79,7 +77,7 @@ describe(
"response.body.responseMeta.status",
200,
);
cy.get(gitSyncLocators.closeBranchList).click({ force: true });
cy.get(gitSync.locators.branchCloseBtn).click({ force: true });
cy.get(".t--draggable-checkboxwidget").should("be.visible");
});

Expand All @@ -103,25 +101,25 @@ describe(
200,
);
cy.get(".--widget-chartwidget").should("not.exist");
cy.get(gitSyncLocators.closeBranchList).click({ force: true });
cy.get(gitSync.locators.branchCloseBtn).click({ force: true });
});

it("4. Verify Default branch deletion not allowed ", () => {
agHelper.Sleep(2000); //for toasts to appear then wait for disappear
agHelper.WaitUntilAllToastsDisappear();
DeleteBranchFromUI(0);
cy.get(gitSyncLocators.closeBranchList).click({ force: true });
cy.get(gitSync.locators.branchCloseBtn).click({ force: true });
agHelper.ValidateToastMessage("Cannot delete default branch: master");
});

function DeleteBranchFromUI(index = 1) {
cy.get(gitSyncLocators.branchButton).click();
cy.get(gitSyncLocators.branchListItem)
cy.get(gitSync.locators.quickActionsBranchBtn).click();
cy.get(gitSync.locators.branchItem)
.eq(index)
.trigger("mouseenter")
.wait(1000);
cy.get(gitSyncLocators.gitBranchContextMenu).click({ force: true });
cy.xpath("//div[@role='menu']//span[text()='Delete']")
cy.get(gitSync.locators.branchItemMenuBtn).click({ force: true });
cy.get(gitSync.locators.branchItemMenuDeleteBtn)
.should("be.visible")
.click({ force: true });
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import gitSyncLocators from "../../../../../locators/gitSyncLocators";
import homePage from "../../../../../locators/HomePage";
import * as _ from "../../../../../support/Objects/ObjectsCore";

Expand Down Expand Up @@ -36,19 +35,19 @@ describe(
it("1. Validate commit comment inputbox and last deployed preview", function () {
// last deployed preview
// The deploy preview Link should be displayed only after the first commit done
cy.get(gitSyncLocators.bottomBarCommitButton).click();
cy.get(_.gitSync.locators.quickActionsCommitBtn).click();

cy.get(gitSyncLocators.commitCommentInput).should("be.disabled");
cy.get(gitSyncLocators.commitButton).should("be.disabled");
cy.get(gitSyncLocators.closeGitSyncModal).click();
cy.get(_.gitSync.locators.opsCommitInput).should("be.disabled");
cy.get(_.gitSync.locators.opsCommitBtn).should("be.disabled");
_.gitSync.CloseOpsModal();
});

it("2. Post connection app name deploy menu", function () {
// deploy
_.agHelper.GetNClick(_.locators._publishButton);

cy.get(gitSyncLocators.gitSyncModal);
cy.get(gitSyncLocators.gitSyncModalDeployTab)
cy.get(_.gitSync.locators.opsModal);
cy.get(_.gitSync.locators.opsModalTabDeploy)
.should("have.attr", "aria-selected", "true")
.and("not.be.empty");
cy.window().then((window) => {
Expand All @@ -58,7 +57,7 @@ describe(
});
});

cy.get(gitSyncLocators.closeGitSyncModal).click();
_.gitSync.CloseOpsModal();

// current deployed version
_.agHelper.GetNClick(homePage.deployPopupOptionTrigger);
Expand Down
Loading
Loading