Skip to content

Commit

Permalink
Merge pull request #31016 from appsmithorg/cherry-pick/9-feb-2024
Browse files Browse the repository at this point in the history
chore: cherry-pick fixes
  • Loading branch information
trishaanand committed Feb 9, 2024
2 parents b66cd24 + 71ab95f commit 286a236
Show file tree
Hide file tree
Showing 62 changed files with 289 additions and 1,622 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,15 +80,12 @@ describe("Git import flow ", { tags: ["@tag.Git"] }, function () {
it("2. Import the previous app connected to Git and reconnect Postgres, MySQL and Mongo db ", () => {
homePage.NavigateToHome();
cy.createWorkspace();
let newWorkspaceName;
cy.wait("@createWorkspace").then((interception) => {
const newWorkspaceName = interception.response.body.data.name;
newWorkspaceName = interception.response.body.data.name;
cy.CreateAppForWorkspace(newWorkspaceName, "gitImport");
});
cy.get(homePageLocators.homeIcon).click();
agHelper.GetNClick(homePageLocators.createNew, 0);
cy.get(homePageLocators.workspaceImportAppOption).click({ force: true });
cy.get(".t--import-json-card").next().click();
cy.importAppFromGit(repoName);
gitSync.ImportAppFromGit(newWorkspaceName, repoName);
cy.wait(5000);
cy.get(reconnectDatasourceModal.Modal).should("be.visible");
cy.ReconnectDatasource("TEDPostgres");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,19 @@ describe("Git import empty repository", { tags: ["@tag.Git"] }, function () {
});

it("1. Bug #12749 Git Import - Empty Repo NullPointerException", () => {
cy.get(homePage.homeIcon).click();
_.agHelper.GetNClick(homePage.createNew, 0);
cy.get(homePage.workspaceImportAppOption).click({ force: true });
cy.get(".t--import-json-card").next().click();
cy.generateUUID().then((uid) => {
repoName = uid;
//cy.createTestGithubRepo(repoName);
_.gitSync.CreateTestGiteaRepo(repoName);
cy.importAppFromGit(repoName, true, failureMessage);
_.gitSync.ImportAppFromGit(undefined, repoName, false);
cy.wait("@importFromGit").then((interception) => {
const status = interception.response.body.responseMeta.status;
const message = interception.response.body.responseMeta.error.message;
expect(status).to.be.gte(400);
expect(message).to.contain(failureMessage);
cy.get(gitSyncLocators.closeGitSyncModal).click();
});
});
cy.get(gitSyncLocators.closeGitSyncModal).click();
});
after(() => {
_.gitSync.DeleteTestGithubRepo(repoName);
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,7 @@ describe("Git sync modal: deploy tab", { tags: ["@tag.Git"] }, function () {
// The deploy preview Link should be displayed only after the first commit done
cy.get(gitSyncLocators.bottomBarCommitButton).click();

// comment text input should not empty
cy.get(gitSyncLocators.commitCommentInput)
.should("be.disabled")
.and("not.be.empty");
cy.get(gitSyncLocators.commitCommentInput).should("be.disabled");
cy.get(gitSyncLocators.commitButton).should("be.disabled");
cy.get(gitSyncLocators.closeGitSyncModal).click();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,20 @@ describe("Git disconnect modal:", { tags: ["@tag.Git"] }, function () {
const newWorkspaceName = interception.response.body.data.name;
cy.CreateAppForWorkspace(newWorkspaceName, newWorkspaceName);
});
cy.generateUUID().then((uid) => {
repoName = uid;
_.gitSync.CreateTestGiteaRepo(repoName);
});
});

it("1. should be opened with proper components", function () {
_.gitSync.AuthorizeKeyToGitea(repoName);
cy.get(gitSyncLocators.bottomBarCommitButton).click();
cy.get("[data-testid=t--tab-GIT_CONNECTION]").click();
cy.generateUUID().then((uid) => {
_.gitSync.CreateNConnectToGit(uid);
cy.get("@gitRepoName").then((repName) => {
repoName = repName;
});
});
cy.get(_.gitSync._bottomSettingsBtn).click();
cy.get(_.gitSync._settingsTabGeneral).click();
// after clicked disconnect on connection modal,
// it should be closed and disconnect modal should be opened
cy.get(gitSyncLocators.disconnectIcon).click();
cy.get(_.gitSync._disconnectGitBtn).click();
cy.get(gitSyncLocators.gitSyncModal).should("not.exist");
cy.get(gitSyncLocators.disconnectGitModal).should("exist");

Expand Down Expand Up @@ -60,12 +61,12 @@ describe("Git disconnect modal:", { tags: ["@tag.Git"] }, function () {
});

it("2. should have disconnect repo button", function () {
cy.get(gitSyncLocators.bottomBarCommitButton).click();
cy.get("[data-testid=t--tab-GIT_CONNECTION]").click();
cy.get(_.gitSync._bottomSettingsBtn).click();
cy.get(_.gitSync._settingsTabGeneral).click();

// after clicked disconnect on connection modal,
// it should be closed and disconnect modal should be opened
cy.get(gitSyncLocators.disconnectIcon).click();
cy.get(_.gitSync._disconnectGitBtn).click();
cy.get(gitSyncLocators.disconnectButton).should("be.disabled");

cy.get(gitSyncLocators.disconnectAppNameInput).type(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,14 @@ describe("Git Branch Protection", { tags: ["@tag.Git"] }, function () {
const appName = "GitBranchProtect-2" + uid;
_.homePage.CreateNewWorkspace(wsName, true);
_.homePage.CreateAppInWorkspace(wsName, appName);
featureFlagIntercept({
release_git_connect_v2_enabled: true,
});
cy.wait(1000);

cy.intercept({
method: "POST",
url: /\/api\/v1\/git\/branch\/app\/.*\/protected/,
}).as("gitProtectApi");

_.gitSync.CreateNConnectToGitV2();
_.gitSync.CreateNConnectToGit("repoprotect", true, true, false);
cy.get("@gitRepoName").then((repName) => {
repoName = repName;
cy.wait("@gitProtectApi").then((res1) => {
Expand Down
Loading

0 comments on commit 286a236

Please sign in to comment.