test: Cypess - added tags - @tag.Fork, @tag.Git (#29672)
## Description > Added tags to cases in - cypress/e2e/Regression/ClientSide/Fork - client/cypress/e2e/Regression/ClientSide/Git #### Type of change - Chore (housekeeping or task changes that don't impact user perception) ## Testing >/ok-to-test tags="@tag.Fork" #### How Has This Been Tested? - [x] Manual - [x] Cypress > > ## Checklist: #### Dev activity - [ ] My code follows the style guidelines of this project - [ ] I have performed a self-review of my own code - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the documentation - [ ] My changes generate no new warnings - [ ] I have added tests that prove my fix is effective or that my feature works - [ ] New and existing unit tests pass locally with my changes - [ ] PR is being merged under a feature flag #### QA activity: - [ ] [Speedbreak features](https://github.com/appsmithorg/TestSmith/wiki/Guidelines-for-test-plans#speedbreakers-) have been covered - [ ] Test plan covers all impacted features and [areas of interest](https://github.com/appsmithorg/TestSmith/wiki/Guidelines-for-test-plans#areas-of-interest-) - [ ] Test plan has been peer reviewed by project stakeholders and other QA members - [ ] Manually tested functionality on DP - [ ] We had an implementation alignment call with stakeholders post QA Round 2 - [ ] Cypress test cases have been added and approved by SDET/manual QA - [ ] Added `Test Plan Approved` label after Cypress tests were reviewed - [ ] Added `Test Plan Approved` label after JUnit tests were reviewed <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Refactor** - Improved the structure and readability of test suites related to forking applications. - **Tests** - Enhanced test descriptions and categorization with new tags for better test management. - Added new test scenarios for forking applications by non-signed users and checking application properties post-fork. - **Chores** - Introduced new tags for test suites to facilitate automated test height adjustment and forking feature identification. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
parent
e6ebfbaea1
commit
87a928a168
|
|
@ -6,46 +6,50 @@ import {
|
|||
|
||||
let workspaceId: string;
|
||||
|
||||
describe("Fork application with multiple datasources", function () {
|
||||
before("Creating all Datasources", () => {
|
||||
// Create Mongo DS and respective query
|
||||
dataSources.CreateDataSource("Mongo");
|
||||
dataSources.CreateQueryAfterDSSaved();
|
||||
// Create PostgreSQL DS and respective query
|
||||
dataSources.CreateDataSource("Postgres");
|
||||
dataSources.CreateQueryAfterDSSaved();
|
||||
// Create Mysql DS and respective query
|
||||
dataSources.CreateDataSource("MySql");
|
||||
dataSources.CreateQueryAfterDSSaved();
|
||||
// Create S3 DS
|
||||
dataSources.CreateDataSource("S3");
|
||||
dataSources.CreateQueryAfterDSSaved();
|
||||
dataSources.ValidateNSelectDropdown("Commands", "List files in bucket");
|
||||
agHelper.EnterValue("assets-test.appsmith.com", {
|
||||
propFieldName: "",
|
||||
directInput: false,
|
||||
inputFieldName: "Bucket name",
|
||||
describe(
|
||||
"Fork application with multiple datasources",
|
||||
{ tags: ["@tag.Fork"] },
|
||||
function () {
|
||||
before("Creating all Datasources", () => {
|
||||
// Create Mongo DS and respective query
|
||||
dataSources.CreateDataSource("Mongo");
|
||||
dataSources.CreateQueryAfterDSSaved();
|
||||
// Create PostgreSQL DS and respective query
|
||||
dataSources.CreateDataSource("Postgres");
|
||||
dataSources.CreateQueryAfterDSSaved();
|
||||
// Create Mysql DS and respective query
|
||||
dataSources.CreateDataSource("MySql");
|
||||
dataSources.CreateQueryAfterDSSaved();
|
||||
// Create S3 DS
|
||||
dataSources.CreateDataSource("S3");
|
||||
dataSources.CreateQueryAfterDSSaved();
|
||||
dataSources.ValidateNSelectDropdown("Commands", "List files in bucket");
|
||||
agHelper.EnterValue("assets-test.appsmith.com", {
|
||||
propFieldName: "",
|
||||
directInput: false,
|
||||
inputFieldName: "Bucket name",
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
it("1. Bug Id: 24708 - fork and test the forked application", function () {
|
||||
// Create a new workspace and fork application
|
||||
const appname: string = localStorage.getItem("appName") || "randomApp";
|
||||
agHelper.GenerateUUID();
|
||||
cy.get("@guid").then((uid) => {
|
||||
workspaceId = "forkApp" + uid;
|
||||
homePage.CreateNewWorkspace(workspaceId, true);
|
||||
agHelper.PressEscape();
|
||||
cy.log("------------------" + workspaceId);
|
||||
homePage.ForkApplication(appname, workspaceId);
|
||||
it("1. Bug Id: 24708 - fork and test the forked application", function () {
|
||||
// Create a new workspace and fork application
|
||||
const appname: string = localStorage.getItem("appName") || "randomApp";
|
||||
agHelper.GenerateUUID();
|
||||
cy.get("@guid").then((uid) => {
|
||||
workspaceId = "forkApp" + uid;
|
||||
homePage.CreateNewWorkspace(workspaceId, true);
|
||||
agHelper.PressEscape();
|
||||
cy.log("------------------" + workspaceId);
|
||||
homePage.ForkApplication(appname, workspaceId);
|
||||
});
|
||||
// In the forked application, reconnect all datasources
|
||||
dataSources.ReconnectDSbyType("MongoDBUri");
|
||||
dataSources.ReconnectDSbyType("PostgreSQL");
|
||||
dataSources.ReconnectDSbyType("MySQL");
|
||||
dataSources.ReconnectDSbyType("S3");
|
||||
|
||||
// assert if the datasources are connected as expeced
|
||||
homePage.AssertNCloseImport();
|
||||
});
|
||||
// In the forked application, reconnect all datasources
|
||||
dataSources.ReconnectDSbyType("MongoDBUri");
|
||||
dataSources.ReconnectDSbyType("PostgreSQL");
|
||||
dataSources.ReconnectDSbyType("MySQL");
|
||||
dataSources.ReconnectDSbyType("S3");
|
||||
|
||||
// assert if the datasources are connected as expeced
|
||||
homePage.AssertNCloseImport();
|
||||
});
|
||||
});
|
||||
},
|
||||
);
|
||||
|
|
|
|||
|
|
@ -6,26 +6,33 @@ import {
|
|||
} from "../../../../support/Objects/ObjectsCore";
|
||||
import applicationLocators from "../../../../locators/Applications.json";
|
||||
|
||||
describe("Fork application in deployed mode", function () {
|
||||
it("1. Fork modal should open and close", function () {
|
||||
appSettings.OpenAppSettings();
|
||||
appSettings.GoToEmbedSettings();
|
||||
embedSettings.ToggleMarkForkable();
|
||||
embedSettings.TogglePublicAccess();
|
||||
deployMode.DeployApp();
|
||||
describe(
|
||||
"Fork application in deployed mode",
|
||||
{ tags: ["@tag.Fork"] },
|
||||
function () {
|
||||
it("1. Fork modal should open and close", function () {
|
||||
appSettings.OpenAppSettings();
|
||||
appSettings.GoToEmbedSettings();
|
||||
embedSettings.ToggleMarkForkable();
|
||||
embedSettings.TogglePublicAccess();
|
||||
deployMode.DeployApp();
|
||||
|
||||
cy.url().then((url) => {
|
||||
const forkableAppUrl = url;
|
||||
cy.LogOut();
|
||||
cy.LogintoApp(Cypress.env("TESTUSERNAME1"), Cypress.env("TESTPASSWORD1"));
|
||||
cy.visit(forkableAppUrl);
|
||||
cy.url().then((url) => {
|
||||
const forkableAppUrl = url;
|
||||
cy.LogOut();
|
||||
cy.LogintoApp(
|
||||
Cypress.env("TESTUSERNAME1"),
|
||||
Cypress.env("TESTPASSWORD1"),
|
||||
);
|
||||
cy.visit(forkableAppUrl);
|
||||
|
||||
agHelper.GetNClick(applicationLocators.forkButton);
|
||||
cy.wait(2000);
|
||||
agHelper.AssertElementVisibility(applicationLocators.forkModal);
|
||||
cy.location("search").should("include", "fork=true");
|
||||
agHelper.GetNClick(applicationLocators.closeModalPopup);
|
||||
cy.location("search").should("not.include", "fork=true");
|
||||
agHelper.GetNClick(applicationLocators.forkButton);
|
||||
cy.wait(2000);
|
||||
agHelper.AssertElementVisibility(applicationLocators.forkModal);
|
||||
cy.location("search").should("include", "fork=true");
|
||||
agHelper.GetNClick(applicationLocators.closeModalPopup);
|
||||
cy.location("search").should("not.include", "fork=true");
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
},
|
||||
);
|
||||
|
|
|
|||
|
|
@ -6,44 +6,48 @@ import {
|
|||
|
||||
let currentWorkspace: string, currentAppName: string, forkWorkspaceName: string;
|
||||
|
||||
describe("Fork application across workspaces", function () {
|
||||
it("Bug 24702: Signed user should be able to fork a public forkable app & Check if the forked application has the same dsl as the original", function () {
|
||||
// Create new workspace to create App in
|
||||
agHelper.GenerateUUID();
|
||||
cy.get("@guid").then((uid) => {
|
||||
currentWorkspace = "CurrentWorkspace " + uid;
|
||||
currentAppName = "MongoQueryApp " + uid;
|
||||
homePage.CreateNewWorkspace(currentWorkspace, true);
|
||||
homePage.CreateAppInWorkspace(currentWorkspace, currentAppName);
|
||||
|
||||
// Create datasource and query
|
||||
dataSources.CreateDataSource("Mongo", true, false);
|
||||
dataSources.CreateQueryAfterDSSaved("", "Query1");
|
||||
|
||||
// eslint-disable-next-line cypress/no-unnecessary-waiting
|
||||
cy.wait(2000);
|
||||
|
||||
describe(
|
||||
"Fork application across workspaces",
|
||||
{ tags: ["@tag.Fork"] },
|
||||
function () {
|
||||
it("Bug 24702: Signed user should be able to fork a public forkable app & Check if the forked application has the same dsl as the original", function () {
|
||||
// Create new workspace to create App in
|
||||
agHelper.GenerateUUID();
|
||||
cy.get("@guid").then((uid) => {
|
||||
forkWorkspaceName = "ForkApplication" + uid;
|
||||
homePage.CreateNewWorkspace(forkWorkspaceName, true);
|
||||
homePage.FilterApplication(currentAppName);
|
||||
currentWorkspace = "CurrentWorkspace " + uid;
|
||||
currentAppName = "MongoQueryApp " + uid;
|
||||
homePage.CreateNewWorkspace(currentWorkspace, true);
|
||||
homePage.CreateAppInWorkspace(currentWorkspace, currentAppName);
|
||||
|
||||
agHelper.Sleep(500);
|
||||
// Create datasource and query
|
||||
dataSources.CreateDataSource("Mongo", true, false);
|
||||
dataSources.CreateQueryAfterDSSaved("", "Query1");
|
||||
|
||||
homePage.ForkApplication(currentAppName, forkWorkspaceName);
|
||||
// eslint-disable-next-line cypress/no-unnecessary-waiting
|
||||
cy.wait(2000);
|
||||
|
||||
dataSources.FillMongoDatasourceFormWithURI();
|
||||
dataSources.TestSaveDatasource(true, true);
|
||||
agHelper.GenerateUUID();
|
||||
cy.get("@guid").then((uid) => {
|
||||
forkWorkspaceName = "ForkApplication" + uid;
|
||||
homePage.CreateNewWorkspace(forkWorkspaceName, true);
|
||||
homePage.FilterApplication(currentAppName);
|
||||
|
||||
agHelper.Sleep(500);
|
||||
|
||||
homePage.ForkApplication(currentAppName, forkWorkspaceName);
|
||||
|
||||
dataSources.FillMongoDatasourceFormWithURI();
|
||||
dataSources.TestSaveDatasource(true, true);
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
after(() => {
|
||||
homePage.NavigateToHome();
|
||||
homePage.DeleteApplication(currentAppName);
|
||||
homePage.DeleteApplication(currentAppName);
|
||||
homePage.DeleteWorkspace(currentWorkspace);
|
||||
homePage.DeleteWorkspace(forkWorkspaceName);
|
||||
});
|
||||
});
|
||||
after(() => {
|
||||
homePage.NavigateToHome();
|
||||
homePage.DeleteApplication(currentAppName);
|
||||
homePage.DeleteApplication(currentAppName);
|
||||
homePage.DeleteWorkspace(currentWorkspace);
|
||||
homePage.DeleteWorkspace(forkWorkspaceName);
|
||||
});
|
||||
},
|
||||
);
|
||||
|
|
|
|||
|
|
@ -6,47 +6,51 @@ import EditorNavigation, {
|
|||
let forkedApplicationDsl;
|
||||
let parentApplicationDsl: any;
|
||||
|
||||
describe("Fork application across workspaces", function () {
|
||||
before(() => {
|
||||
_.agHelper.AddDsl("basicDsl");
|
||||
});
|
||||
|
||||
it("1. Signed user should be able to fork a public forkable app & Check if the forked application has the same dsl as the original", function () {
|
||||
const appname: string =
|
||||
localStorage.getItem("workspaceName") || "randomApp";
|
||||
EditorNavigation.SelectEntityByName("Input1", EntityType.Widget);
|
||||
|
||||
cy.intercept("PUT", "/api/v1/layouts/*/pages/*").as("inputUpdate");
|
||||
_.propPane.TypeTextIntoField("defaultvalue", "A");
|
||||
cy.wait("@inputUpdate").then((response) => {
|
||||
response.response &&
|
||||
(parentApplicationDsl = response.response.body.data.dsl);
|
||||
describe(
|
||||
"Fork application across workspaces",
|
||||
{ tags: ["@tag.Fork"] },
|
||||
function () {
|
||||
before(() => {
|
||||
_.agHelper.AddDsl("basicDsl");
|
||||
});
|
||||
// eslint-disable-next-line cypress/no-unnecessary-waiting
|
||||
cy.wait(2000);
|
||||
_.homePage.NavigateToHome();
|
||||
_.homePage.FilterApplication(appname);
|
||||
// eslint-disable-next-line cypress/no-unnecessary-waiting
|
||||
cy.get(_.homePage._applicationCard).first().trigger("mouseover");
|
||||
cy.get(_.homePage._appEditIcon).first().click({ force: true });
|
||||
|
||||
cy.get(_.homePage._applicationName).click({ force: true });
|
||||
cy.contains("Fork application").click({ force: true });
|
||||
it("1. Signed user should be able to fork a public forkable app & Check if the forked application has the same dsl as the original", function () {
|
||||
const appname: string =
|
||||
localStorage.getItem("workspaceName") || "randomApp";
|
||||
EditorNavigation.SelectEntityByName("Input1", EntityType.Widget);
|
||||
|
||||
cy.get(_.locators._forkAppToWorkspaceBtn).click({ force: true });
|
||||
// eslint-disable-next-line cypress/no-unnecessary-waiting
|
||||
|
||||
cy.wait("@postForkAppWorkspace")
|
||||
.its("response.body.responseMeta.status")
|
||||
.should("eq", 200);
|
||||
// check that forked application has same dsl
|
||||
cy.get("@getPage")
|
||||
.its("response.body.data")
|
||||
.then((data) => {
|
||||
forkedApplicationDsl = data.layouts[0].dsl;
|
||||
expect(JSON.stringify(forkedApplicationDsl)).to.contain(
|
||||
JSON.stringify(parentApplicationDsl),
|
||||
);
|
||||
cy.intercept("PUT", "/api/v1/layouts/*/pages/*").as("inputUpdate");
|
||||
_.propPane.TypeTextIntoField("defaultvalue", "A");
|
||||
cy.wait("@inputUpdate").then((response) => {
|
||||
response.response &&
|
||||
(parentApplicationDsl = response.response.body.data.dsl);
|
||||
});
|
||||
});
|
||||
});
|
||||
// eslint-disable-next-line cypress/no-unnecessary-waiting
|
||||
cy.wait(2000);
|
||||
_.homePage.NavigateToHome();
|
||||
_.homePage.FilterApplication(appname);
|
||||
// eslint-disable-next-line cypress/no-unnecessary-waiting
|
||||
cy.get(_.homePage._applicationCard).first().trigger("mouseover");
|
||||
cy.get(_.homePage._appEditIcon).first().click({ force: true });
|
||||
|
||||
cy.get(_.homePage._applicationName).click({ force: true });
|
||||
cy.contains("Fork application").click({ force: true });
|
||||
|
||||
cy.get(_.locators._forkAppToWorkspaceBtn).click({ force: true });
|
||||
// eslint-disable-next-line cypress/no-unnecessary-waiting
|
||||
|
||||
cy.wait("@postForkAppWorkspace")
|
||||
.its("response.body.responseMeta.status")
|
||||
.should("eq", 200);
|
||||
// check that forked application has same dsl
|
||||
cy.get("@getPage")
|
||||
.its("response.body.data")
|
||||
.then((data) => {
|
||||
forkedApplicationDsl = data.layouts[0].dsl;
|
||||
expect(JSON.stringify(forkedApplicationDsl)).to.contain(
|
||||
JSON.stringify(parentApplicationDsl),
|
||||
);
|
||||
});
|
||||
});
|
||||
},
|
||||
);
|
||||
|
|
|
|||
|
|
@ -21,130 +21,141 @@ let forkedApplicationDsl;
|
|||
let parentApplicationDsl;
|
||||
let forkableAppUrl;
|
||||
|
||||
describe("Fork application across workspaces", function () {
|
||||
before(() => {
|
||||
agHelper.AddDsl("basicDsl");
|
||||
});
|
||||
|
||||
it("1. Check if the forked application has the same dsl as the original", function () {
|
||||
const appname = localStorage.getItem("workspaceName");
|
||||
EditorNavigation.SelectEntityByName("Input1", EntityType.Widget);
|
||||
|
||||
cy.intercept("PUT", "/api/v1/layouts/*/pages/*").as("inputUpdate");
|
||||
cy.testJsontext("defaultvalue", "A");
|
||||
cy.wait("@inputUpdate").then((response) => {
|
||||
parentApplicationDsl = response.response.body.data.dsl;
|
||||
describe(
|
||||
"Fork application across workspaces",
|
||||
{ tags: ["@tag.Fork"] },
|
||||
function () {
|
||||
before(() => {
|
||||
agHelper.AddDsl("basicDsl");
|
||||
});
|
||||
// eslint-disable-next-line cypress/no-unnecessary-waiting
|
||||
cy.wait(2000);
|
||||
homePage.NavigateToHome();
|
||||
cy.get(homepagelocators.searchInput).type(appname);
|
||||
// eslint-disable-next-line cypress/no-unnecessary-waiting
|
||||
cy.wait(2000);
|
||||
cy.get(homepagelocators.appMoreIcon).first().click({ force: true });
|
||||
cy.get(homepagelocators.forkAppFromMenu).click({ force: true });
|
||||
cy.get(homepagelocators.forkAppWorkspaceButton).click({ force: true });
|
||||
// eslint-disable-next-line cypress/no-unnecessary-waiting
|
||||
cy.wait(4000);
|
||||
cy.wait("@postForkAppWorkspace")
|
||||
.its("response.body.responseMeta.status")
|
||||
.should("eq", 200);
|
||||
cy.wait("@getWorkspace");
|
||||
// check that forked application has same dsl
|
||||
cy.get("@getPage").then((httpResponse) => {
|
||||
const data = httpResponse.response.body.data;
|
||||
forkedApplicationDsl = data.layouts[0].dsl;
|
||||
cy.log(JSON.stringify(forkedApplicationDsl));
|
||||
cy.log(JSON.stringify(parentApplicationDsl));
|
||||
expect(JSON.stringify(forkedApplicationDsl)).to.contain(
|
||||
JSON.stringify(parentApplicationDsl),
|
||||
|
||||
it("1. Check if the forked application has the same dsl as the original", function () {
|
||||
const appname = localStorage.getItem("workspaceName");
|
||||
EditorNavigation.SelectEntityByName("Input1", EntityType.Widget);
|
||||
|
||||
cy.intercept("PUT", "/api/v1/layouts/*/pages/*").as("inputUpdate");
|
||||
cy.testJsontext("defaultvalue", "A");
|
||||
cy.wait("@inputUpdate").then((response) => {
|
||||
parentApplicationDsl = response.response.body.data.dsl;
|
||||
});
|
||||
// eslint-disable-next-line cypress/no-unnecessary-waiting
|
||||
cy.wait(2000);
|
||||
homePage.NavigateToHome();
|
||||
cy.get(homepagelocators.searchInput).type(appname);
|
||||
// eslint-disable-next-line cypress/no-unnecessary-waiting
|
||||
cy.wait(2000);
|
||||
cy.get(homepagelocators.appMoreIcon).first().click({ force: true });
|
||||
cy.get(homepagelocators.forkAppFromMenu).click({ force: true });
|
||||
cy.get(homepagelocators.forkAppWorkspaceButton).click({ force: true });
|
||||
// eslint-disable-next-line cypress/no-unnecessary-waiting
|
||||
cy.wait(4000);
|
||||
cy.wait("@postForkAppWorkspace")
|
||||
.its("response.body.responseMeta.status")
|
||||
.should("eq", 200);
|
||||
cy.wait("@getWorkspace");
|
||||
// check that forked application has same dsl
|
||||
cy.get("@getPage").then((httpResponse) => {
|
||||
const data = httpResponse.response.body.data;
|
||||
forkedApplicationDsl = data.layouts[0].dsl;
|
||||
cy.log(JSON.stringify(forkedApplicationDsl));
|
||||
cy.log(JSON.stringify(parentApplicationDsl));
|
||||
expect(JSON.stringify(forkedApplicationDsl)).to.contain(
|
||||
JSON.stringify(parentApplicationDsl),
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
it("2. Non signed user should be able to fork a public forkable app", function () {
|
||||
homePage.NavigateToHome();
|
||||
cy.get(homepagelocators.homeIcon).click();
|
||||
cy.get(homepagelocators.optionsIcon).first().click();
|
||||
cy.get(homepagelocators.workspaceImportAppOption).click({ force: true });
|
||||
cy.get(homepagelocators.workspaceImportAppModal).should("be.visible");
|
||||
cy.xpath(homepagelocators.uploadLogo).selectFile(
|
||||
"cypress/fixtures/forkNonSignedInUser.json",
|
||||
{ force: true },
|
||||
);
|
||||
});
|
||||
});
|
||||
cy.wait("@importNewApplication").then((interception) => {
|
||||
const { isPartialImport } = interception.response.body.data;
|
||||
cy.log("isPartialImport : ", isPartialImport);
|
||||
if (isPartialImport) {
|
||||
cy.wait(2000);
|
||||
cy.get(reconnectDatasourceModal.SkipToAppBtn).click({
|
||||
force: true,
|
||||
});
|
||||
cy.wait(2000);
|
||||
}
|
||||
cy.get("#sidebar").should("be.visible");
|
||||
deployMode.DeployApp();
|
||||
agHelper.Sleep(2000);
|
||||
cy.get("button:contains('Share')").first().click({ force: true });
|
||||
// _.agHelper.Sleep(1000);
|
||||
// cy.get("body").then(($ele) => {
|
||||
// if ($ele.find(homePage.enablePublicAccess).length <= 0) {
|
||||
// cy.contains("Retry").click();
|
||||
// cy.get("button:contains('Share')")
|
||||
// .first()
|
||||
// .click({ force: true });
|
||||
// }
|
||||
// });
|
||||
cy.enablePublicAccess();
|
||||
|
||||
it("2. Non signed user should be able to fork a public forkable app", function () {
|
||||
homePage.NavigateToHome();
|
||||
cy.get(homepagelocators.homeIcon).click();
|
||||
cy.get(homepagelocators.optionsIcon).first().click();
|
||||
cy.get(homepagelocators.workspaceImportAppOption).click({ force: true });
|
||||
cy.get(homepagelocators.workspaceImportAppModal).should("be.visible");
|
||||
cy.xpath(homepagelocators.uploadLogo).selectFile(
|
||||
"cypress/fixtures/forkNonSignedInUser.json",
|
||||
{ force: true },
|
||||
);
|
||||
cy.wait("@importNewApplication").then((interception) => {
|
||||
const { isPartialImport } = interception.response.body.data;
|
||||
cy.log("isPartialImport : ", isPartialImport);
|
||||
if (isPartialImport) {
|
||||
cy.wait(2000);
|
||||
cy.get(reconnectDatasourceModal.SkipToAppBtn).click({
|
||||
force: true,
|
||||
cy.url().then((url) => {
|
||||
forkableAppUrl = url;
|
||||
cy.LogOut();
|
||||
|
||||
cy.visit(forkableAppUrl);
|
||||
//cy.reload();
|
||||
//cy.visit(forkableAppUrl);
|
||||
cy.wait(4000);
|
||||
cy.get(applicationLocators.forkButton).first().click({ force: true });
|
||||
cy.get(loginPageLocators.signupLink).click();
|
||||
cy.generateUUID().then((uid) => {
|
||||
cy.get(signupPageLocators.username).type(`${uid}@appsmith.com`);
|
||||
cy.get(signupPageLocators.password).type(uid);
|
||||
cy.get(signupPageLocators.submitBtn).click();
|
||||
cy.wait(10000);
|
||||
cy.get(applicationLocators.forkButton)
|
||||
.first()
|
||||
.click({ force: true });
|
||||
cy.get(homepagelocators.forkAppWorkspaceButton).should(
|
||||
"be.visible",
|
||||
);
|
||||
});
|
||||
});
|
||||
cy.wait(2000);
|
||||
}
|
||||
cy.get("#sidebar").should("be.visible");
|
||||
});
|
||||
});
|
||||
|
||||
it("3. Mark application as forkable", () => {
|
||||
homePage.LogintoApp(Cypress.env("USERNAME"), Cypress.env("PASSWORD"));
|
||||
featureFlagIntercept({ license_gac_enabled: true });
|
||||
cy.wait(2000);
|
||||
homePage.CreateNewApplication();
|
||||
appSettings.OpenAppSettings();
|
||||
appSettings.GoToEmbedSettings();
|
||||
embedSettings.ToggleMarkForkable();
|
||||
embedSettings.TogglePublicAccess();
|
||||
|
||||
inviteModal.OpenShareModal();
|
||||
homePage.InviteUserToApplication(
|
||||
fakerHelper.GetRandomText(5) + "@appsmith.com",
|
||||
"App Viewer",
|
||||
);
|
||||
|
||||
inviteModal.CloseModal();
|
||||
deployMode.DeployApp();
|
||||
agHelper.Sleep(2000);
|
||||
cy.get("button:contains('Share')").first().click({ force: true });
|
||||
// _.agHelper.Sleep(1000);
|
||||
// cy.get("body").then(($ele) => {
|
||||
// if ($ele.find(homePage.enablePublicAccess).length <= 0) {
|
||||
// cy.contains("Retry").click();
|
||||
// cy.get("button:contains('Share')")
|
||||
// .first()
|
||||
// .click({ force: true });
|
||||
// }
|
||||
// });
|
||||
cy.enablePublicAccess();
|
||||
|
||||
cy.url().then((url) => {
|
||||
forkableAppUrl = url;
|
||||
cy.LogOut();
|
||||
|
||||
cy.LogintoApp(
|
||||
Cypress.env("TESTUSERNAME1"),
|
||||
Cypress.env("TESTPASSWORD1"),
|
||||
);
|
||||
cy.visit(forkableAppUrl);
|
||||
//cy.reload();
|
||||
//cy.visit(forkableAppUrl);
|
||||
cy.wait(4000);
|
||||
cy.get(applicationLocators.forkButton).first().click({ force: true });
|
||||
cy.get(loginPageLocators.signupLink).click();
|
||||
cy.generateUUID().then((uid) => {
|
||||
cy.get(signupPageLocators.username).type(`${uid}@appsmith.com`);
|
||||
cy.get(signupPageLocators.password).type(uid);
|
||||
cy.get(signupPageLocators.submitBtn).click();
|
||||
cy.wait(10000);
|
||||
cy.get(applicationLocators.forkButton).first().click({ force: true });
|
||||
cy.get(homepagelocators.forkAppWorkspaceButton).should("be.visible");
|
||||
});
|
||||
|
||||
agHelper.AssertElementVisibility(applicationLocators.forkButton);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
it("3. Mark application as forkable", () => {
|
||||
homePage.LogintoApp(Cypress.env("USERNAME"), Cypress.env("PASSWORD"));
|
||||
featureFlagIntercept({ license_gac_enabled: true });
|
||||
cy.wait(2000);
|
||||
homePage.CreateNewApplication();
|
||||
appSettings.OpenAppSettings();
|
||||
appSettings.GoToEmbedSettings();
|
||||
embedSettings.ToggleMarkForkable();
|
||||
embedSettings.TogglePublicAccess();
|
||||
|
||||
inviteModal.OpenShareModal();
|
||||
homePage.InviteUserToApplication(
|
||||
fakerHelper.GetRandomText(5) + "@appsmith.com",
|
||||
"App Viewer",
|
||||
);
|
||||
|
||||
inviteModal.CloseModal();
|
||||
deployMode.DeployApp();
|
||||
|
||||
cy.url().then((url) => {
|
||||
forkableAppUrl = url;
|
||||
cy.LogOut();
|
||||
cy.LogintoApp(Cypress.env("TESTUSERNAME1"), Cypress.env("TESTPASSWORD1"));
|
||||
cy.visit(forkableAppUrl);
|
||||
|
||||
agHelper.AssertElementVisibility(applicationLocators.forkButton);
|
||||
});
|
||||
});
|
||||
});
|
||||
},
|
||||
);
|
||||
|
|
|
|||
|
|
@ -17,253 +17,258 @@ import EditorNavigation, {
|
|||
PageLeftPane,
|
||||
} from "../../../../../../support/Pages/EditorNavigation";
|
||||
|
||||
describe("Import and validate older app (app created in older versions of Appsmith) from Gitea", function () {
|
||||
let appRepoName = "TestMigration",
|
||||
appName = "UpgradeAppToLatestVersion",
|
||||
keyId: any,
|
||||
workspaceName: any;
|
||||
before(() => {
|
||||
agHelper.GenerateUUID();
|
||||
cy.get("@guid").then((uid) => {
|
||||
workspaceName = "GitImport_" + uid;
|
||||
homePage.CreateNewWorkspace(workspaceName, true);
|
||||
//Import App From Gitea
|
||||
gitSync.ImportAppFromGit(workspaceName, appRepoName, true);
|
||||
cy.get("@deployKeyId").then((id) => {
|
||||
keyId = id;
|
||||
describe(
|
||||
"Import and validate older app (app created in older versions of Appsmith) from Gitea",
|
||||
{ tags: ["@tag.Git"] },
|
||||
function () {
|
||||
let appRepoName = "TestMigration",
|
||||
appName = "UpgradeAppToLatestVersion",
|
||||
keyId: any,
|
||||
workspaceName: any;
|
||||
before(() => {
|
||||
agHelper.GenerateUUID();
|
||||
cy.get("@guid").then((uid) => {
|
||||
workspaceName = "GitImport_" + uid;
|
||||
homePage.CreateNewWorkspace(workspaceName, true);
|
||||
//Import App From Gitea
|
||||
gitSync.ImportAppFromGit(workspaceName, appRepoName, true);
|
||||
cy.get("@deployKeyId").then((id) => {
|
||||
keyId = id;
|
||||
});
|
||||
});
|
||||
|
||||
//Reconnect datasources
|
||||
dataSources.ReconnectDSbyType("MongoDB");
|
||||
dataSources.ReconnectDSbyType("MySQL");
|
||||
dataSources.ReconnectDSbyType("PostgreSQL");
|
||||
agHelper.Sleep(3000); //for CI to reconnect successfully
|
||||
homePage.AssertNCloseImport();
|
||||
});
|
||||
|
||||
//Reconnect datasources
|
||||
dataSources.ReconnectDSbyType("MongoDB");
|
||||
dataSources.ReconnectDSbyType("MySQL");
|
||||
dataSources.ReconnectDSbyType("PostgreSQL");
|
||||
agHelper.Sleep(3000); //for CI to reconnect successfully
|
||||
homePage.AssertNCloseImport();
|
||||
});
|
||||
it("1. Validate merge status + Bug23822", () => {
|
||||
PageLeftPane.assertPresence("ListingAndReviews");
|
||||
//Wait for the app to settle
|
||||
agHelper.Sleep(3000);
|
||||
homePage.RenameApplication(appName);
|
||||
assertHelper.AssertNetworkResponseData("gitStatus");
|
||||
agHelper.AssertElementExist(gitSync._bottomBarCommit, 0, 30000);
|
||||
agHelper.AssertText(gitSync._gitPullCount, "text", "4");
|
||||
agHelper.GetNClick(gitSync._bottomBarCommit);
|
||||
agHelper.AssertElementVisibility(gitSync._gitSyncModal);
|
||||
|
||||
it("1. Validate merge status + Bug23822", () => {
|
||||
PageLeftPane.assertPresence("ListingAndReviews");
|
||||
//Wait for the app to settle
|
||||
agHelper.Sleep(3000);
|
||||
homePage.RenameApplication(appName);
|
||||
assertHelper.AssertNetworkResponseData("gitStatus");
|
||||
agHelper.AssertElementExist(gitSync._bottomBarCommit, 0, 30000);
|
||||
agHelper.AssertText(gitSync._gitPullCount, "text", "4");
|
||||
agHelper.GetNClick(gitSync._bottomBarCommit);
|
||||
agHelper.AssertElementVisibility(gitSync._gitSyncModal);
|
||||
|
||||
//This is expected due to Canvas Splitting PR changes in v1.9.24
|
||||
agHelper.GetNAssertContains(
|
||||
gitSync._gitStatusChanges,
|
||||
/[0-9] page(|s) modified/,
|
||||
);
|
||||
|
||||
// Commenting it as part of #28012 - to be added back later
|
||||
// agHelper.GetNAssertElementText(
|
||||
// gitSync._gitStatusChanges,
|
||||
// "Application settings modified",
|
||||
// "not.contain.text",
|
||||
// );
|
||||
agHelper.GetNAssertElementText(
|
||||
gitSync._gitStatusChanges,
|
||||
"Theme modified",
|
||||
"not.contain.text",
|
||||
);
|
||||
agHelper.AssertContains(/[0-9] quer(y|ies) modified/, "not.exist");
|
||||
|
||||
// Commented out due to #25739 - to be fixed by dev later
|
||||
// agHelper.GetNAssertElementText(
|
||||
// gitSync._gitStatusChanges,
|
||||
// "datasource modified",
|
||||
// "not.contain.text",
|
||||
// );
|
||||
|
||||
agHelper.AssertContains(/[0-9] JS Object(|s) modified/, "not.exist");
|
||||
|
||||
// Commenting it as part of #28012 - to be added back later
|
||||
// agHelper.AssertContains(/[0-9] librar(y|ies) modified/, "not.exist");
|
||||
|
||||
// This assertions is commented out due to issue #https://github.com/appsmithorg/appsmith/issues/28563
|
||||
// Since we don't want this specific message appearing when we are just migrating the metadata,
|
||||
// this assertion is not required.
|
||||
// Slack conversation: https://theappsmith.slack.com/archives/C04HERDNZPA/p1698851532418569
|
||||
|
||||
// agHelper.GetNAssertElementText(
|
||||
// gitSync._gitStatusChanges,
|
||||
// "Some of the changes above are due to an improved file structure designed to reduce merge conflicts. You can safely commit them to your repository.",
|
||||
// "contain.text",
|
||||
// );
|
||||
agHelper.GetNClick(gitSync._commitButton);
|
||||
assertHelper.AssertNetworkStatus("@commit", 201);
|
||||
gitSync.CloseGitSyncModal();
|
||||
});
|
||||
|
||||
it("2. Deploy the app & Validate CRUD pages - Mongo , MySql, Postgres pages", () => {
|
||||
//Mongo CRUD page validation
|
||||
//Assert table data
|
||||
cy.latestDeployPreview();
|
||||
agHelper.AssertText(
|
||||
locators._widgetInDeployed(draggableWidgets.TEXT),
|
||||
"text",
|
||||
"listingAndReviews Data",
|
||||
);
|
||||
agHelper.AssertElementVisibility(locators._widgetByName("data_table"));
|
||||
table.WaitUntilTableLoad(0, 0, "v1");
|
||||
|
||||
//Filter & validate table data
|
||||
table.OpenNFilterTable("_id", "is exactly", "15665837");
|
||||
table.ReadTableRowColumnData(0, 0).then(($cellData) => {
|
||||
expect($cellData).to.eq(
|
||||
'["TV","Internet","Wifi","Air conditioning","Wheelchair accessible","Pool","Kitchen","Free parking on premises","Smoking allowed","Pets allowed","Gym","Elevator","Hot tub","Heating","Family/kid friendly","Washer","Dryer","Smoke detector","Fire extinguisher","Essentials"]',
|
||||
//This is expected due to Canvas Splitting PR changes in v1.9.24
|
||||
agHelper.GetNAssertContains(
|
||||
gitSync._gitStatusChanges,
|
||||
/[0-9] page(|s) modified/,
|
||||
);
|
||||
|
||||
// Commenting it as part of #28012 - to be added back later
|
||||
// agHelper.GetNAssertElementText(
|
||||
// gitSync._gitStatusChanges,
|
||||
// "Application settings modified",
|
||||
// "not.contain.text",
|
||||
// );
|
||||
agHelper.GetNAssertElementText(
|
||||
gitSync._gitStatusChanges,
|
||||
"Theme modified",
|
||||
"not.contain.text",
|
||||
);
|
||||
agHelper.AssertContains(/[0-9] quer(y|ies) modified/, "not.exist");
|
||||
|
||||
// Commented out due to #25739 - to be fixed by dev later
|
||||
// agHelper.GetNAssertElementText(
|
||||
// gitSync._gitStatusChanges,
|
||||
// "datasource modified",
|
||||
// "not.contain.text",
|
||||
// );
|
||||
|
||||
agHelper.AssertContains(/[0-9] JS Object(|s) modified/, "not.exist");
|
||||
|
||||
// Commenting it as part of #28012 - to be added back later
|
||||
// agHelper.AssertContains(/[0-9] librar(y|ies) modified/, "not.exist");
|
||||
|
||||
// This assertions is commented out due to issue #https://github.com/appsmithorg/appsmith/issues/28563
|
||||
// Since we don't want this specific message appearing when we are just migrating the metadata,
|
||||
// this assertion is not required.
|
||||
// Slack conversation: https://theappsmith.slack.com/archives/C04HERDNZPA/p1698851532418569
|
||||
|
||||
// agHelper.GetNAssertElementText(
|
||||
// gitSync._gitStatusChanges,
|
||||
// "Some of the changes above are due to an improved file structure designed to reduce merge conflicts. You can safely commit them to your repository.",
|
||||
// "contain.text",
|
||||
// );
|
||||
agHelper.GetNClick(gitSync._commitButton);
|
||||
assertHelper.AssertNetworkStatus("@commit", 201);
|
||||
gitSync.CloseGitSyncModal();
|
||||
});
|
||||
|
||||
//MySql CRUD page validation
|
||||
agHelper.GetNClickByContains(locators._deployedPage, "CountryFlags");
|
||||
//Assert table data
|
||||
agHelper.AssertText(
|
||||
locators._widgetInDeployed(draggableWidgets.TEXT),
|
||||
"text",
|
||||
"countryFlags Data",
|
||||
);
|
||||
agHelper.AssertElementVisibility(locators._widgetByName("data_table"));
|
||||
table.WaitUntilTableLoad(0, 0, "v1");
|
||||
it("2. Deploy the app & Validate CRUD pages - Mongo , MySql, Postgres pages", () => {
|
||||
//Mongo CRUD page validation
|
||||
//Assert table data
|
||||
cy.latestDeployPreview();
|
||||
agHelper.AssertText(
|
||||
locators._widgetInDeployed(draggableWidgets.TEXT),
|
||||
"text",
|
||||
"listingAndReviews Data",
|
||||
);
|
||||
agHelper.AssertElementVisibility(locators._widgetByName("data_table"));
|
||||
table.WaitUntilTableLoad(0, 0, "v1");
|
||||
|
||||
//Filter & validate table data
|
||||
table.OpenNFilterTable("Country", "starts with", "Ba");
|
||||
table.ReadTableRowColumnData(2, 0).then(($cellData) => {
|
||||
expect($cellData).to.eq("Bangladesh");
|
||||
});
|
||||
table.CloseFilter();
|
||||
//Filter & validate table data
|
||||
table.OpenNFilterTable("_id", "is exactly", "15665837");
|
||||
table.ReadTableRowColumnData(0, 0).then(($cellData) => {
|
||||
expect($cellData).to.eq(
|
||||
'["TV","Internet","Wifi","Air conditioning","Wheelchair accessible","Pool","Kitchen","Free parking on premises","Smoking allowed","Pets allowed","Gym","Elevator","Hot tub","Heating","Family/kid friendly","Washer","Dryer","Smoke detector","Fire extinguisher","Essentials"]',
|
||||
);
|
||||
});
|
||||
|
||||
//Download table data
|
||||
table.DownloadFromTable("Download as CSV");
|
||||
table.ValidateDownloadNVerify("data_table.csv", "Bangladesh");
|
||||
//MySql CRUD page validation
|
||||
agHelper.GetNClickByContains(locators._deployedPage, "CountryFlags");
|
||||
//Assert table data
|
||||
agHelper.AssertText(
|
||||
locators._widgetInDeployed(draggableWidgets.TEXT),
|
||||
"text",
|
||||
"countryFlags Data",
|
||||
);
|
||||
agHelper.AssertElementVisibility(locators._widgetByName("data_table"));
|
||||
table.WaitUntilTableLoad(0, 0, "v1");
|
||||
|
||||
//Postgres CRUD page validation
|
||||
agHelper.GetNClickByContains(locators._deployedPage, "Public.astronauts");
|
||||
agHelper.AssertText(
|
||||
locators._widgetInDeployed(draggableWidgets.TEXT),
|
||||
"text",
|
||||
"public_astronauts Data",
|
||||
);
|
||||
agHelper.AssertElementVisibility(locators._widgetByName("data_table"));
|
||||
table.WaitUntilTableLoad(0, 0, "v1");
|
||||
//Filter & validate table data
|
||||
table.OpenNFilterTable("Country", "starts with", "Ba");
|
||||
table.ReadTableRowColumnData(2, 0).then(($cellData) => {
|
||||
expect($cellData).to.eq("Bangladesh");
|
||||
});
|
||||
table.CloseFilter();
|
||||
|
||||
//Filter & validate table data
|
||||
table.OpenNFilterTable("id", "is exactly", "196");
|
||||
table.ReadTableRowColumnData(0, 2).then(($cellData) => {
|
||||
expect($cellData).to.eq("Ulf Merbold");
|
||||
});
|
||||
table.RemoveFilter();
|
||||
//Download table data
|
||||
table.DownloadFromTable("Download as CSV");
|
||||
table.ValidateDownloadNVerify("data_table.csv", "Bangladesh");
|
||||
|
||||
//Update table data
|
||||
deployMode.EnterJSONInputValue("Statusid", "5", 0, true);
|
||||
deployMode.EnterJSONInputValue("Statusname", "Active", 0, true);
|
||||
agHelper.Sleep(500);
|
||||
agHelper.ClickButton("Update");
|
||||
agHelper.Sleep(2000); //for CI update to be successful
|
||||
table.WaitUntilTableLoad(0, 0, "v1");
|
||||
//Postgres CRUD page validation
|
||||
agHelper.GetNClickByContains(locators._deployedPage, "Public.astronauts");
|
||||
agHelper.AssertText(
|
||||
locators._widgetInDeployed(draggableWidgets.TEXT),
|
||||
"text",
|
||||
"public_astronauts Data",
|
||||
);
|
||||
agHelper.AssertElementVisibility(locators._widgetByName("data_table"));
|
||||
table.WaitUntilTableLoad(0, 0, "v1");
|
||||
|
||||
//Validate updated values in table
|
||||
table.ReadTableRowColumnData(0, 3).then(($cellData) => {
|
||||
expect($cellData).to.eq("5");
|
||||
});
|
||||
table.ReadTableRowColumnData(0, 4).then(($cellData) => {
|
||||
expect($cellData).to.eq("Active");
|
||||
});
|
||||
agHelper.Sleep(500);
|
||||
});
|
||||
//Filter & validate table data
|
||||
table.OpenNFilterTable("id", "is exactly", "196");
|
||||
table.ReadTableRowColumnData(0, 2).then(($cellData) => {
|
||||
expect($cellData).to.eq("Ulf Merbold");
|
||||
});
|
||||
table.RemoveFilter();
|
||||
|
||||
it("3. Validate widgets & bindings", () => {
|
||||
agHelper.GetNClickByContains(locators._deployedPage, "Widgets");
|
||||
agHelper.AssertElementVisibility(
|
||||
locators._widgetInDeployed(draggableWidgets.AUDIO),
|
||||
);
|
||||
agHelper.AssertElementVisibility(
|
||||
locators._widgetInDeployed(draggableWidgets.AUDIORECORDER),
|
||||
);
|
||||
agHelper.AssertElementVisibility(
|
||||
locators._widgetInDeployed(draggableWidgets.DOCUMENT_VIEWER),
|
||||
);
|
||||
agHelper.AssertElementVisibility(
|
||||
locators._widgetInDeployed(draggableWidgets.CHART),
|
||||
);
|
||||
//Update table data
|
||||
deployMode.EnterJSONInputValue("Statusid", "5", 0, true);
|
||||
deployMode.EnterJSONInputValue("Statusname", "Active", 0, true);
|
||||
agHelper.Sleep(500);
|
||||
agHelper.ClickButton("Update");
|
||||
agHelper.Sleep(2000); //for CI update to be successful
|
||||
table.WaitUntilTableLoad(0, 0, "v1");
|
||||
|
||||
//Button
|
||||
agHelper.ClickButton("Alert button");
|
||||
agHelper.Sleep(500);
|
||||
agHelper.WaitUntilToastDisappear("404 hit : invalidApi failed to execute");
|
||||
|
||||
//Checkbox group
|
||||
agHelper.AssertElementVisibility(
|
||||
locators._widgetInDeployed(draggableWidgets.CHECKBOXGROUP),
|
||||
);
|
||||
agHelper.GetNAssertElementText(
|
||||
locators._widgetInDeployed(draggableWidgets.CHECKBOXGROUP),
|
||||
"Select AstronautUlf MerboldAndreas MogensenWubbo OckelsThomas ReiterAnil Menon",
|
||||
"have.text",
|
||||
);
|
||||
agHelper
|
||||
.GetElement(locators._checkboxTypeByOption("Ulf Merbold"))
|
||||
.should("be.checked");
|
||||
agHelper.CheckUncheck(locators._checkboxTypeByOption("Anil Menon"));
|
||||
|
||||
//Slider
|
||||
agHelper
|
||||
.ScrollIntoView(locators._sliderThumb)
|
||||
.focus()
|
||||
.type("{rightArrow}")
|
||||
.wait(500);
|
||||
|
||||
agHelper.Sleep(500);
|
||||
agHelper.WaitUntilToastDisappear("Category Value Changed!");
|
||||
|
||||
//Currency input
|
||||
agHelper.TypeText(
|
||||
locators._widgetInDeployed(draggableWidgets.CURRENCY_INPUT) + " input",
|
||||
"10",
|
||||
);
|
||||
agHelper.WaitUntilToastDisappear(
|
||||
'{"countryCode":"IN","currencyCode":"INR","value":10}',
|
||||
);
|
||||
|
||||
//Table
|
||||
agHelper.TypeText(
|
||||
locators._widgetInDeployed("inputwidgetv2") + " input",
|
||||
"144",
|
||||
);
|
||||
table.ReadTableRowColumnData(0, 3, "v2").then(($cellData) => {
|
||||
expect($cellData).to.eq("Christina ");
|
||||
//Validate updated values in table
|
||||
table.ReadTableRowColumnData(0, 3).then(($cellData) => {
|
||||
expect($cellData).to.eq("5");
|
||||
});
|
||||
table.ReadTableRowColumnData(0, 4).then(($cellData) => {
|
||||
expect($cellData).to.eq("Active");
|
||||
});
|
||||
agHelper.Sleep(500);
|
||||
});
|
||||
|
||||
//Add customer details - Validate Modal & JSON Form
|
||||
agHelper.ClickButton("Add customer Details");
|
||||
agHelper.AssertElementVisibility(locators._modal);
|
||||
it("3. Validate widgets & bindings", () => {
|
||||
agHelper.GetNClickByContains(locators._deployedPage, "Widgets");
|
||||
agHelper.AssertElementVisibility(
|
||||
locators._widgetInDeployed(draggableWidgets.AUDIO),
|
||||
);
|
||||
agHelper.AssertElementVisibility(
|
||||
locators._widgetInDeployed(draggableWidgets.AUDIORECORDER),
|
||||
);
|
||||
agHelper.AssertElementVisibility(
|
||||
locators._widgetInDeployed(draggableWidgets.DOCUMENT_VIEWER),
|
||||
);
|
||||
agHelper.AssertElementVisibility(
|
||||
locators._widgetInDeployed(draggableWidgets.CHART),
|
||||
);
|
||||
|
||||
deployMode.EnterJSONInputValue("Customer Name", "TestUser", 0, true);
|
||||
deployMode.EnterJSONInputValue("Customer Number", "1", 0, true);
|
||||
deployMode.EnterJSONInputValue("Phone Number", "999999999", 0, true);
|
||||
agHelper.ClickButton("Submit", 1);
|
||||
agHelper.WaitUntilToastDisappear("Add Customer Successful!");
|
||||
agHelper.ClickButton("Close");
|
||||
//Button
|
||||
agHelper.ClickButton("Alert button");
|
||||
agHelper.Sleep(500);
|
||||
agHelper.WaitUntilToastDisappear(
|
||||
"404 hit : invalidApi failed to execute",
|
||||
);
|
||||
|
||||
//Delete customer details
|
||||
agHelper.ClickButton("Delete customer details");
|
||||
agHelper.AssertElementVisibility(locators._modal);
|
||||
agHelper.ClickButton("Confirm");
|
||||
agHelper.WaitUntilToastDisappear("Delete customer successful!");
|
||||
agHelper.ClickButton("Close");
|
||||
agHelper.AssertElementAbsence(locators._modal);
|
||||
agHelper.Sleep(2000);
|
||||
});
|
||||
//Checkbox group
|
||||
agHelper.AssertElementVisibility(
|
||||
locators._widgetInDeployed(draggableWidgets.CHECKBOXGROUP),
|
||||
);
|
||||
agHelper.GetNAssertElementText(
|
||||
locators._widgetInDeployed(draggableWidgets.CHECKBOXGROUP),
|
||||
"Select AstronautUlf MerboldAndreas MogensenWubbo OckelsThomas ReiterAnil Menon",
|
||||
"have.text",
|
||||
);
|
||||
agHelper
|
||||
.GetElement(locators._checkboxTypeByOption("Ulf Merbold"))
|
||||
.should("be.checked");
|
||||
agHelper.CheckUncheck(locators._checkboxTypeByOption("Anil Menon"));
|
||||
|
||||
it.skip("4. Edit JSObject & Check Updated Data ", () => {
|
||||
deployMode.NavigateBacktoEditor();
|
||||
//Edit existing JS object
|
||||
EditorNavigation.SelectEntityByName("users", EntityType.JSObject);
|
||||
jsEditor.EditJSObj(`export default {
|
||||
//Slider
|
||||
agHelper
|
||||
.ScrollIntoView(locators._sliderThumb)
|
||||
.focus()
|
||||
.type("{rightArrow}")
|
||||
.wait(500);
|
||||
|
||||
agHelper.Sleep(500);
|
||||
agHelper.WaitUntilToastDisappear("Category Value Changed!");
|
||||
|
||||
//Currency input
|
||||
agHelper.TypeText(
|
||||
locators._widgetInDeployed(draggableWidgets.CURRENCY_INPUT) + " input",
|
||||
"10",
|
||||
);
|
||||
agHelper.WaitUntilToastDisappear(
|
||||
'{"countryCode":"IN","currencyCode":"INR","value":10}',
|
||||
);
|
||||
|
||||
//Table
|
||||
agHelper.TypeText(
|
||||
locators._widgetInDeployed("inputwidgetv2") + " input",
|
||||
"144",
|
||||
);
|
||||
table.ReadTableRowColumnData(0, 3, "v2").then(($cellData) => {
|
||||
expect($cellData).to.eq("Christina ");
|
||||
});
|
||||
|
||||
//Add customer details - Validate Modal & JSON Form
|
||||
agHelper.ClickButton("Add customer Details");
|
||||
agHelper.AssertElementVisibility(locators._modal);
|
||||
|
||||
deployMode.EnterJSONInputValue("Customer Name", "TestUser", 0, true);
|
||||
deployMode.EnterJSONInputValue("Customer Number", "1", 0, true);
|
||||
deployMode.EnterJSONInputValue("Phone Number", "999999999", 0, true);
|
||||
agHelper.ClickButton("Submit", 1);
|
||||
agHelper.WaitUntilToastDisappear("Add Customer Successful!");
|
||||
agHelper.ClickButton("Close");
|
||||
|
||||
//Delete customer details
|
||||
agHelper.ClickButton("Delete customer details");
|
||||
agHelper.AssertElementVisibility(locators._modal);
|
||||
agHelper.ClickButton("Confirm");
|
||||
agHelper.WaitUntilToastDisappear("Delete customer successful!");
|
||||
agHelper.ClickButton("Close");
|
||||
agHelper.AssertElementAbsence(locators._modal);
|
||||
agHelper.Sleep(2000);
|
||||
});
|
||||
|
||||
it.skip("4. Edit JSObject & Check Updated Data ", () => {
|
||||
deployMode.NavigateBacktoEditor();
|
||||
//Edit existing JS object
|
||||
EditorNavigation.SelectEntityByName("users", EntityType.JSObject);
|
||||
jsEditor.EditJSObj(`export default {
|
||||
fun: async () => {
|
||||
return await invalidApi.run().catch((e) => showAlert("404 hit : " + e.message));
|
||||
},
|
||||
|
|
@ -279,35 +284,36 @@ describe("Import and validate older app (app created in older versions of Appsmi
|
|||
}
|
||||
}`);
|
||||
|
||||
//Update property field for button
|
||||
EditorNavigation.SelectEntityByName("Button1", EntityType.Widget);
|
||||
propPane.EnterJSContext("onClick", `{{users.myFun2()}}`, true, false);
|
||||
//Update property field for button
|
||||
EditorNavigation.SelectEntityByName("Button1", EntityType.Widget);
|
||||
propPane.EnterJSContext("onClick", `{{users.myFun2()}}`, true, false);
|
||||
|
||||
//Drag n drop text widget & bind it to myFun1
|
||||
entityExplorer.DragDropWidgetNVerify(draggableWidgets.TEXT);
|
||||
propPane.TypeTextIntoField("Text", `{{users.myFun1.data}}`);
|
||||
agHelper.ValidateToastMessage(
|
||||
"[users.myFun1] will be executed automatically on page load",
|
||||
);
|
||||
//Drag n drop text widget & bind it to myFun1
|
||||
entityExplorer.DragDropWidgetNVerify(draggableWidgets.TEXT);
|
||||
propPane.TypeTextIntoField("Text", `{{users.myFun1.data}}`);
|
||||
agHelper.ValidateToastMessage(
|
||||
"[users.myFun1] will be executed automatically on page load",
|
||||
);
|
||||
|
||||
//Commit & push new changes
|
||||
gitSync.CommitAndPush();
|
||||
cy.latestDeployPreview();
|
||||
//Commit & push new changes
|
||||
gitSync.CommitAndPush();
|
||||
cy.latestDeployPreview();
|
||||
|
||||
//Validate new response for button & text widget
|
||||
agHelper.GetNClickByContains(locators._deployedPage, "Widgets");
|
||||
agHelper.ClickButton("Submit");
|
||||
agHelper.ValidateToastMessage("myFun2 Data");
|
||||
agHelper
|
||||
.GetText(locators._widgetInDeployed(draggableWidgets.TEXT), "text")
|
||||
.should("not.be.empty");
|
||||
});
|
||||
//Validate new response for button & text widget
|
||||
agHelper.GetNClickByContains(locators._deployedPage, "Widgets");
|
||||
agHelper.ClickButton("Submit");
|
||||
agHelper.ValidateToastMessage("myFun2 Data");
|
||||
agHelper
|
||||
.GetText(locators._widgetInDeployed(draggableWidgets.TEXT), "text")
|
||||
.should("not.be.empty");
|
||||
});
|
||||
|
||||
after(() => {
|
||||
gitSync.DeleteDeployKey(appRepoName, keyId);
|
||||
agHelper.WaitUntilAllToastsDisappear();
|
||||
deployMode.NavigateToHomeDirectly();
|
||||
homePage.DeleteApplication(appName);
|
||||
homePage.DeleteWorkspace(workspaceName);
|
||||
});
|
||||
});
|
||||
after(() => {
|
||||
gitSync.DeleteDeployKey(appRepoName, keyId);
|
||||
agHelper.WaitUntilAllToastsDisappear();
|
||||
deployMode.NavigateToHomeDirectly();
|
||||
homePage.DeleteApplication(appName);
|
||||
homePage.DeleteWorkspace(workspaceName);
|
||||
});
|
||||
},
|
||||
);
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ import EditorNavigation, {
|
|||
} from "../../../../../support/Pages/EditorNavigation";
|
||||
import PageList from "../../../../../support/Pages/PageList";
|
||||
|
||||
describe("Git discard changes:", function () {
|
||||
describe("Git discard changes:", { tags: ["@tag.Git"] }, function () {
|
||||
let datasourceName;
|
||||
let repoName;
|
||||
const query1 = "get_employees";
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ import EditorNavigation, {
|
|||
} from "../../../../../support/Pages/EditorNavigation";
|
||||
import PageList from "../../../../../support/Pages/PageList";
|
||||
|
||||
describe("Git import flow ", function () {
|
||||
describe("Git import flow ", { tags: ["@tag.Git"] }, function () {
|
||||
before(() => {
|
||||
homePage.NavigateToHome();
|
||||
homePage.CreateNewWorkspace();
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import homePage from "../../../../../locators/HomePage";
|
|||
import gitSyncLocators from "../../../../../locators/gitSyncLocators";
|
||||
import * as _ from "../../../../../support/Objects/ObjectsCore";
|
||||
|
||||
describe("Git import empty repository", function () {
|
||||
describe("Git import empty repository", { tags: ["@tag.Git"] }, function () {
|
||||
let repoName;
|
||||
const assertConnectFailure = true;
|
||||
const failureMessage =
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ let repoName;
|
|||
let generatedKey;
|
||||
let windowOpenSpy;
|
||||
const owner = Cypress.env("TEST_GITHUB_USER_NAME");
|
||||
describe("Git sync modal: connect tab", function () {
|
||||
describe("Git sync modal: connect tab", { tags: ["@tag.Git"] }, function () {
|
||||
before(() => {
|
||||
_.homePage.NavigateToHome();
|
||||
cy.createWorkspace();
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ import {
|
|||
} from "../../../../../support/Pages/EditorNavigation";
|
||||
|
||||
let repoName, branchName;
|
||||
describe("Delete branch flow", () => {
|
||||
describe("Delete branch flow", { tags: ["@tag.Git"] }, () => {
|
||||
it("1. Connect app to git, create new branch and delete it", () => {
|
||||
// create git repo and connect app to git
|
||||
gitSync.CreateNConnectToGit();
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import homePage from "../../../../../locators/HomePage";
|
|||
import * as _ from "../../../../../support/Objects/ObjectsCore";
|
||||
|
||||
let repoName;
|
||||
describe("Git sync modal: deploy tab", function () {
|
||||
describe("Git sync modal: deploy tab", { tags: ["@tag.Git"] }, function () {
|
||||
before(() => {
|
||||
_.homePage.NavigateToHome();
|
||||
cy.createWorkspace();
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import * as _ from "../../../../../support/Objects/ObjectsCore";
|
|||
|
||||
let repoName;
|
||||
let windowOpenSpy;
|
||||
describe("Git disconnect modal:", function () {
|
||||
describe("Git disconnect modal:", { tags: ["@tag.Git"] }, function () {
|
||||
before(() => {
|
||||
_.homePage.NavigateToHome();
|
||||
cy.createWorkspace();
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import * as _ from "../../../../../support/Objects/ObjectsCore";
|
|||
let guid: any;
|
||||
let repoName: any;
|
||||
|
||||
describe("Git Branch Protection", function () {
|
||||
describe("Git Branch Protection", { tags: ["@tag.Git"] }, function () {
|
||||
it("Issue 28056 - 2 : Check if protection is enabled when feature flag is enabled", function () {
|
||||
_.agHelper.GenerateUUID();
|
||||
cy.get("@guid").then((uid) => {
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ const tempBranch0 = "tempBranch0";
|
|||
const mainBranch = "master";
|
||||
const jsObject = "JSObject1";
|
||||
|
||||
describe("Git sync Bug #10773", function () {
|
||||
describe("Git sync Bug #10773", { tags: ["@tag.Git"] }, function () {
|
||||
let repoName;
|
||||
|
||||
beforeEach(() => {
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ let app1Name: string;
|
|||
let repoName: any;
|
||||
let branchName: any;
|
||||
|
||||
describe("Git Connect V2", function () {
|
||||
describe("Git Connect V2", { tags: ["@tag.Git"] }, function () {
|
||||
before(() => {
|
||||
_.agHelper.GenerateUUID();
|
||||
cy.get("@guid").then((uid) => {
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ let wsName: string;
|
|||
let appName: string;
|
||||
let repoName: any;
|
||||
|
||||
describe("Git Connect V2", function () {
|
||||
describe("Git Connect V2", { tags: ["@tag.Git"] }, function () {
|
||||
before(() => {
|
||||
_.agHelper.GenerateUUID();
|
||||
cy.get("@guid").then((uid) => {
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ const mainBranch = "master";
|
|||
let datasourceName;
|
||||
let repoName;
|
||||
|
||||
describe("Git sync apps", function () {
|
||||
describe("Git sync apps", { tags: ["@tag.Git"] }, function () {
|
||||
it("1. Generate postgreSQL crud page , connect to git, clone the page, rename page with special character in it", () => {
|
||||
homePage.NavigateToHome();
|
||||
homePage.CreateNewApplication();
|
||||
|
|
|
|||
|
|
@ -8,67 +8,73 @@ const invalidURL = "test";
|
|||
let repoName: string;
|
||||
let generatedKey;
|
||||
let windowOpenSpy: any;
|
||||
describe("Git sync modal: Learn more links", function () {
|
||||
it("1. validates repo URL", function () {
|
||||
// open gitSync modal
|
||||
cy.get(homePage.deployPopupOptionTrigger).click({ force: true });
|
||||
cy.get(homePage.connectToGitBtn).click({ force: true });
|
||||
describe(
|
||||
"Git sync modal: Learn more links",
|
||||
{ tags: ["@tag.Git"] },
|
||||
function () {
|
||||
it("1. validates repo URL", function () {
|
||||
// open gitSync modal
|
||||
cy.get(homePage.deployPopupOptionTrigger).click({ force: true });
|
||||
cy.get(homePage.connectToGitBtn).click({ force: true });
|
||||
|
||||
cy.get(gitSyncLocators.gitRepoInput).type(`{selectAll}${httpsRepoURL}`);
|
||||
cy.contains(Cypress.env("MESSAGES").PASTE_SSH_URL_INFO());
|
||||
cy.get(gitSyncLocators.generateDeployKeyBtn).should("not.exist");
|
||||
cy.get(gitSyncLocators.gitRepoInput).type(`{selectAll}${httpsRepoURL}`);
|
||||
cy.contains(Cypress.env("MESSAGES").PASTE_SSH_URL_INFO());
|
||||
cy.get(gitSyncLocators.generateDeployKeyBtn).should("not.exist");
|
||||
|
||||
cy.get(gitSyncLocators.gitRepoInput).type(`{selectAll}${invalidURL}`);
|
||||
cy.contains(Cypress.env("MESSAGES").PASTE_SSH_URL_INFO());
|
||||
cy.get(gitSyncLocators.generateDeployKeyBtn).should("not.exist");
|
||||
cy.get(gitSyncLocators.gitRepoInput).type(`{selectAll}${invalidURL}`);
|
||||
cy.contains(Cypress.env("MESSAGES").PASTE_SSH_URL_INFO());
|
||||
cy.get(gitSyncLocators.generateDeployKeyBtn).should("not.exist");
|
||||
|
||||
// generate key button should be disappeared if empty repo
|
||||
cy.get(gitSyncLocators.gitRepoInput).type(`{selectAll}${""}`);
|
||||
cy.get(gitSyncLocators.generateDeployKeyBtn).should("not.exist");
|
||||
// generate key button should be disappeared if empty repo
|
||||
cy.get(gitSyncLocators.gitRepoInput).type(`{selectAll}${""}`);
|
||||
cy.get(gitSyncLocators.generateDeployKeyBtn).should("not.exist");
|
||||
|
||||
cy.get(gitSyncLocators.gitRepoInput).type(
|
||||
`{selectAll}${_.dataManager.GITEA_API_URL_TED}/${repoName}.git`,
|
||||
);
|
||||
cy.contains(Cypress.env("MESSAGES").PASTE_SSH_URL_INFO()).should(
|
||||
"not.exist",
|
||||
);
|
||||
cy.get(gitSyncLocators.gitRepoInput).type(
|
||||
`{selectAll}${_.dataManager.GITEA_API_URL_TED}/${repoName}.git`,
|
||||
);
|
||||
cy.contains(Cypress.env("MESSAGES").PASTE_SSH_URL_INFO()).should(
|
||||
"not.exist",
|
||||
);
|
||||
|
||||
cy.get(gitSyncLocators.generateDeployKeyBtn).should("not.be.disabled");
|
||||
cy.get(gitSyncLocators.generateDeployKeyBtn).should("not.be.disabled");
|
||||
|
||||
cy.intercept("POST", "/api/v1/applications/ssh-keypair/*").as(
|
||||
"generateKey",
|
||||
);
|
||||
cy.intercept("POST", "/api/v1/applications/ssh-keypair/*").as(
|
||||
"generateKey",
|
||||
);
|
||||
|
||||
// Stubbing window.open
|
||||
// cy.window().then((window) => {
|
||||
// windowOpenSpy = cy.stub(window, "open").callsFake((url) => {
|
||||
// expect(url.startsWith("https://docs.appsmith.com/")).to.be.true;
|
||||
// windowOpenSpy.restore();
|
||||
// });
|
||||
// });
|
||||
// Stubbing window.open
|
||||
// cy.window().then((window) => {
|
||||
// windowOpenSpy = cy.stub(window, "open").callsFake((url) => {
|
||||
// expect(url.startsWith("https://docs.appsmith.com/")).to.be.true;
|
||||
// windowOpenSpy.restore();
|
||||
// });
|
||||
// });
|
||||
|
||||
cy.window().then((window) => {
|
||||
windowOpenSpy = cy.stub(window, "open").callsFake((url) => {
|
||||
if (
|
||||
url.includes("/version-control-with-git/connecting-to-git-repository")
|
||||
) {
|
||||
expect(url).to.contain(
|
||||
"/version-control-with-git/connecting-to-git-repository",
|
||||
);
|
||||
} else if (url.includes("overview/managing-deploy-keys")) {
|
||||
expect(url).to.contain("overview/managing-deploy-keys");
|
||||
}
|
||||
windowOpenSpy.restore();
|
||||
cy.window().then((window) => {
|
||||
windowOpenSpy = cy.stub(window, "open").callsFake((url) => {
|
||||
if (
|
||||
url.includes(
|
||||
"/version-control-with-git/connecting-to-git-repository",
|
||||
)
|
||||
) {
|
||||
expect(url).to.contain(
|
||||
"/version-control-with-git/connecting-to-git-repository",
|
||||
);
|
||||
} else if (url.includes("overview/managing-deploy-keys")) {
|
||||
expect(url).to.contain("overview/managing-deploy-keys");
|
||||
}
|
||||
windowOpenSpy.restore();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
// Click the "Learn more" link
|
||||
cy.get(gitSyncLocators.learnMoreSshUrl).click();
|
||||
cy.get(gitSyncLocators.generateDeployKeyBtn).click();
|
||||
// Click the "Learn more" link
|
||||
cy.get(gitSyncLocators.learnMoreSshUrl).click();
|
||||
cy.get(gitSyncLocators.generateDeployKeyBtn).click();
|
||||
|
||||
cy.wait("@generateKey").then((result: any) => {
|
||||
generatedKey = result.response.body.data.publicKey;
|
||||
cy.wait("@generateKey").then((result: any) => {
|
||||
generatedKey = result.response.body.data.publicKey;
|
||||
});
|
||||
cy.xpath(gitSyncLocators.learnMoreDeployKey).click({ force: true });
|
||||
});
|
||||
cy.xpath(gitSyncLocators.learnMoreDeployKey).click({ force: true });
|
||||
});
|
||||
});
|
||||
},
|
||||
);
|
||||
|
|
|
|||
|
|
@ -29,267 +29,271 @@ let applicationId: any;
|
|||
let applicationName: any;
|
||||
let repoName: any;
|
||||
|
||||
describe("Git sync: Merge changes via remote", function () {
|
||||
before(() => {
|
||||
_.homePage.NavigateToHome();
|
||||
_.homePage.CreateNewWorkspace();
|
||||
describe(
|
||||
"Git sync: Merge changes via remote",
|
||||
{ tags: ["@tag.Git"] },
|
||||
function () {
|
||||
before(() => {
|
||||
_.homePage.NavigateToHome();
|
||||
_.homePage.CreateNewWorkspace();
|
||||
|
||||
_.agHelper.GenerateUUID();
|
||||
cy.get("@guid").then((uid: any) => {
|
||||
cy.get("@workspaceName").then((workspaceName: any) => {
|
||||
_.homePage.CreateAppInWorkspace(workspaceName, uid);
|
||||
applicationName = uid;
|
||||
cy.get("@applicationId").then(
|
||||
(currentAppId) => (applicationId = currentAppId),
|
||||
);
|
||||
_.agHelper.GenerateUUID();
|
||||
cy.get("@guid").then((uid: any) => {
|
||||
cy.get("@workspaceName").then((workspaceName: any) => {
|
||||
_.homePage.CreateAppInWorkspace(workspaceName, uid);
|
||||
applicationName = uid;
|
||||
cy.get("@applicationId").then(
|
||||
(currentAppId) => (applicationId = currentAppId),
|
||||
);
|
||||
});
|
||||
});
|
||||
_.gitSync.CreateNConnectToGit(repoName);
|
||||
cy.get("@gitRepoName").then((repName) => {
|
||||
repoName = repName;
|
||||
});
|
||||
});
|
||||
_.gitSync.CreateNConnectToGit(repoName);
|
||||
cy.get("@gitRepoName").then((repName) => {
|
||||
repoName = repName;
|
||||
|
||||
it.skip("1. Shows remote is ahead warning and conflict error during commit and push", function () {
|
||||
_.gitSync.CreateGitBranch(tempBranch, false);
|
||||
cy.get("@gitbranchName").then((branName) => {
|
||||
tempBranch = branName;
|
||||
cy.log("tempBranch is " + tempBranch);
|
||||
|
||||
//cy.createGitBranch(tempBranch);
|
||||
PageLeftPane.switchSegment(PagePaneSegment.Widgets);
|
||||
cy.wait(2000); // wait for transition
|
||||
cy.dragAndDropToCanvas("buttonwidget", { x: 300, y: 300 });
|
||||
// cy.createGitBranch(tempBranch0);
|
||||
_.gitSync.CreateGitBranch(tempBranch0, false);
|
||||
cy.get("@gitbranchName").then((branName) => {
|
||||
tempBranch0 = branName;
|
||||
cy.log("tempBranch0 is " + tempBranch0);
|
||||
cy.widgetText(
|
||||
buttonNameTemp0Branch,
|
||||
widgetsPage.buttonWidget,
|
||||
widgetsPage.widgetNameSpan,
|
||||
);
|
||||
cy.commitAndPush();
|
||||
cy.switchGitBranch(tempBranch);
|
||||
cy.merge(tempBranch0);
|
||||
});
|
||||
|
||||
// cy.mergeViaGithubApi({
|
||||
// repo: repoName,
|
||||
// base: tempBranch,
|
||||
// head: tempBranch0,
|
||||
// });
|
||||
cy.switchGitBranch(tempBranch);
|
||||
});
|
||||
cy.widgetText(
|
||||
buttonNameMainBranch,
|
||||
widgetsPage.buttonWidget,
|
||||
widgetsPage.widgetNameSpan,
|
||||
);
|
||||
cy.get(homePage.publishButton).click();
|
||||
cy.get(gitSyncLocators.commitCommentInput).type("Initial Commit");
|
||||
cy.get(gitSyncLocators.commitButton).click();
|
||||
cy.wait("@commit").should(
|
||||
"have.nested.property",
|
||||
"response.body.responseMeta.status",
|
||||
400,
|
||||
);
|
||||
|
||||
cy.contains(Cypress.env("MESSAGES").GIT_UPSTREAM_CHANGES());
|
||||
cy.get(gitSyncLocators.pullButton).click();
|
||||
cy.contains(Cypress.env("MESSAGES").GIT_CONFLICTING_INFO());
|
||||
cy.get(gitSyncLocators.closeGitSyncModal).click();
|
||||
});
|
||||
});
|
||||
|
||||
it.skip("1. Shows remote is ahead warning and conflict error during commit and push", function () {
|
||||
_.gitSync.CreateGitBranch(tempBranch, false);
|
||||
cy.get("@gitbranchName").then((branName) => {
|
||||
tempBranch = branName;
|
||||
cy.log("tempBranch is " + tempBranch);
|
||||
|
||||
//cy.createGitBranch(tempBranch);
|
||||
it.skip("2. Detect conflicts when merging head to base branch", function () {
|
||||
cy.switchGitBranch(mainBranch);
|
||||
PageLeftPane.switchSegment(PagePaneSegment.Widgets);
|
||||
cy.wait(2000); // wait for transition
|
||||
cy.dragAndDropToCanvas("buttonwidget", { x: 300, y: 300 });
|
||||
// cy.createGitBranch(tempBranch0);
|
||||
_.gitSync.CreateGitBranch(tempBranch0, false);
|
||||
cy.get("@gitbranchName").then((branName) => {
|
||||
tempBranch0 = branName;
|
||||
cy.log("tempBranch0 is " + tempBranch0);
|
||||
cy.widgetText(
|
||||
buttonNameTemp0Branch,
|
||||
widgetsPage.buttonWidget,
|
||||
widgetsPage.widgetNameSpan,
|
||||
);
|
||||
cy.commitAndPush();
|
||||
cy.switchGitBranch(tempBranch);
|
||||
cy.merge(tempBranch0);
|
||||
_.gitSync.CreateGitBranch(tempBranch1, false);
|
||||
cy.widgetText(
|
||||
buttonNameTempBranch1,
|
||||
widgetsPage.buttonWidget,
|
||||
widgetsPage.widgetNameSpan,
|
||||
);
|
||||
cy.commitAndPush();
|
||||
|
||||
cy.switchGitBranch(mainBranch);
|
||||
cy.widgetText(
|
||||
buttonNameMainBranchEdited,
|
||||
widgetsPage.buttonWidget,
|
||||
widgetsPage.widgetNameSpan,
|
||||
);
|
||||
cy.commitAndPush();
|
||||
|
||||
cy.switchGitBranch(tempBranch1);
|
||||
|
||||
cy.get(gitSyncLocators.bottomBarMergeButton).click();
|
||||
cy.wait(5000); // wait for git status call to finish
|
||||
cy.get(gitSyncLocators.mergeBranchDropdownDestination).click();
|
||||
cy.get(commonlocators.dropdownmenu).contains(mainBranch).click();
|
||||
// assert conflicting status
|
||||
cy.contains(Cypress.env("MESSAGES").GIT_CONFLICTING_INFO());
|
||||
cy.get(gitSyncLocators.closeGitSyncModal).click();
|
||||
});
|
||||
|
||||
it("3. Supports merging head to base branch", function () {
|
||||
//cy.switchGitBranch(mainBranch);
|
||||
_.gitSync.CreateGitBranch(tempBranch2, true);
|
||||
PageLeftPane.switchSegment(PagePaneSegment.Explorer);
|
||||
cy.CheckAndUnfoldEntityItem("Pages");
|
||||
cy.Createpage("NewPage");
|
||||
cy.commitAndPush();
|
||||
cy.merge(mainBranch);
|
||||
cy.get(gitSyncLocators.closeGitSyncModal).click();
|
||||
cy.wait(4000);
|
||||
cy.switchGitBranch(mainBranch);
|
||||
cy.wait(4000); // wait for switch branch
|
||||
cy.contains("NewPage");
|
||||
});
|
||||
|
||||
it.skip("4. Enables pulling remote changes from bottom bar", function () {
|
||||
_.gitSync.CreateGitBranch(tempBranch3, false);
|
||||
PageLeftPane.switchSegment(PagePaneSegment.Widgets);
|
||||
cy.wait(2000); // wait for transition
|
||||
cy.dragAndDropToCanvas("inputwidgetv2", { x: 300, y: 300 });
|
||||
cy.wait("@updateLayout");
|
||||
cy.commitAndPush();
|
||||
cy.mergeViaGithubApi({
|
||||
repo: repoName,
|
||||
base: mainBranch,
|
||||
head: tempBranch3,
|
||||
});
|
||||
cy.switchGitBranch(mainBranch);
|
||||
cy.get(gitSyncLocators.bottomBarCommitButton).should("be.visible");
|
||||
cy.get(gitSyncLocators.gitPullCount);
|
||||
|
||||
cy.intercept("GET", "/api/v1/git/pull/app/*").as("gitPull");
|
||||
|
||||
cy.get(gitSyncLocators.bottomBarPullButton).click();
|
||||
|
||||
cy.wait("@gitPull");
|
||||
|
||||
cy.get(".ads-v2-spinner").should("exist");
|
||||
cy.get(".ads-v2-spinner").should("not.exist");
|
||||
|
||||
cy.get(widgetsPage.inputWidget);
|
||||
|
||||
cy.switchGitBranch(tempBranch3);
|
||||
|
||||
cy.widgetText(
|
||||
inputNameTempBranch3,
|
||||
widgetsPage.inputWidget,
|
||||
widgetsPage.widgetNameSpan,
|
||||
);
|
||||
|
||||
cy.commitAndPush();
|
||||
|
||||
cy.mergeViaGithubApi({
|
||||
repo: repoName,
|
||||
base: mainBranch,
|
||||
head: tempBranch3,
|
||||
});
|
||||
|
||||
// cy.mergeViaGithubApi({
|
||||
// repo: repoName,
|
||||
// base: tempBranch,
|
||||
// head: tempBranch0,
|
||||
// });
|
||||
cy.switchGitBranch(tempBranch);
|
||||
});
|
||||
cy.widgetText(
|
||||
buttonNameMainBranch,
|
||||
widgetsPage.buttonWidget,
|
||||
widgetsPage.widgetNameSpan,
|
||||
);
|
||||
cy.get(homePage.publishButton).click();
|
||||
cy.get(gitSyncLocators.commitCommentInput).type("Initial Commit");
|
||||
cy.get(gitSyncLocators.commitButton).click();
|
||||
cy.wait("@commit").should(
|
||||
"have.nested.property",
|
||||
"response.body.responseMeta.status",
|
||||
400,
|
||||
);
|
||||
cy.switchGitBranch(mainBranch);
|
||||
|
||||
cy.contains(Cypress.env("MESSAGES").GIT_UPSTREAM_CHANGES());
|
||||
cy.get(gitSyncLocators.pullButton).click();
|
||||
cy.contains(Cypress.env("MESSAGES").GIT_CONFLICTING_INFO());
|
||||
cy.get(gitSyncLocators.closeGitSyncModal).click();
|
||||
});
|
||||
cy.widgetText(
|
||||
inputNameTempBranch31,
|
||||
widgetsPage.inputWidget,
|
||||
widgetsPage.widgetNameSpan,
|
||||
);
|
||||
|
||||
it.skip("2. Detect conflicts when merging head to base branch", function () {
|
||||
cy.switchGitBranch(mainBranch);
|
||||
PageLeftPane.switchSegment(PagePaneSegment.Widgets);
|
||||
cy.wait(2000); // wait for transition
|
||||
cy.dragAndDropToCanvas("buttonwidget", { x: 300, y: 300 });
|
||||
_.gitSync.CreateGitBranch(tempBranch1, false);
|
||||
cy.widgetText(
|
||||
buttonNameTempBranch1,
|
||||
widgetsPage.buttonWidget,
|
||||
widgetsPage.widgetNameSpan,
|
||||
);
|
||||
cy.commitAndPush();
|
||||
cy.commitAndPush(true);
|
||||
|
||||
cy.switchGitBranch(mainBranch);
|
||||
cy.widgetText(
|
||||
buttonNameMainBranchEdited,
|
||||
widgetsPage.buttonWidget,
|
||||
widgetsPage.widgetNameSpan,
|
||||
);
|
||||
cy.commitAndPush();
|
||||
// reset git status
|
||||
cy.get(gitSyncLocators.bottomBarMergeButton).click();
|
||||
cy.get(gitSyncLocators.closeGitSyncModal).click();
|
||||
|
||||
cy.switchGitBranch(tempBranch1);
|
||||
cy.get(gitSyncLocators.gitPullCount);
|
||||
|
||||
cy.get(gitSyncLocators.bottomBarMergeButton).click();
|
||||
cy.wait(5000); // wait for git status call to finish
|
||||
cy.get(gitSyncLocators.mergeBranchDropdownDestination).click();
|
||||
cy.get(commonlocators.dropdownmenu).contains(mainBranch).click();
|
||||
// assert conflicting status
|
||||
cy.contains(Cypress.env("MESSAGES").GIT_CONFLICTING_INFO());
|
||||
cy.get(gitSyncLocators.closeGitSyncModal).click();
|
||||
});
|
||||
|
||||
it("3. Supports merging head to base branch", function () {
|
||||
//cy.switchGitBranch(mainBranch);
|
||||
_.gitSync.CreateGitBranch(tempBranch2, true);
|
||||
PageLeftPane.switchSegment(PagePaneSegment.Explorer);
|
||||
cy.CheckAndUnfoldEntityItem("Pages");
|
||||
cy.Createpage("NewPage");
|
||||
cy.commitAndPush();
|
||||
cy.merge(mainBranch);
|
||||
cy.get(gitSyncLocators.closeGitSyncModal).click();
|
||||
cy.wait(4000);
|
||||
cy.switchGitBranch(mainBranch);
|
||||
cy.wait(4000); // wait for switch branch
|
||||
cy.contains("NewPage");
|
||||
});
|
||||
|
||||
it.skip("4. Enables pulling remote changes from bottom bar", function () {
|
||||
_.gitSync.CreateGitBranch(tempBranch3, false);
|
||||
PageLeftPane.switchSegment(PagePaneSegment.Widgets);
|
||||
cy.wait(2000); // wait for transition
|
||||
cy.dragAndDropToCanvas("inputwidgetv2", { x: 300, y: 300 });
|
||||
cy.wait("@updateLayout");
|
||||
cy.commitAndPush();
|
||||
cy.mergeViaGithubApi({
|
||||
repo: repoName,
|
||||
base: mainBranch,
|
||||
head: tempBranch3,
|
||||
});
|
||||
cy.switchGitBranch(mainBranch);
|
||||
cy.get(gitSyncLocators.bottomBarCommitButton).should("be.visible");
|
||||
cy.get(gitSyncLocators.gitPullCount);
|
||||
|
||||
cy.intercept("GET", "/api/v1/git/pull/app/*").as("gitPull");
|
||||
|
||||
cy.get(gitSyncLocators.bottomBarPullButton).click();
|
||||
|
||||
cy.wait("@gitPull");
|
||||
|
||||
cy.get(".ads-v2-spinner").should("exist");
|
||||
cy.get(".ads-v2-spinner").should("not.exist");
|
||||
|
||||
cy.get(widgetsPage.inputWidget);
|
||||
|
||||
cy.switchGitBranch(tempBranch3);
|
||||
|
||||
cy.widgetText(
|
||||
inputNameTempBranch3,
|
||||
widgetsPage.inputWidget,
|
||||
widgetsPage.widgetNameSpan,
|
||||
);
|
||||
|
||||
cy.commitAndPush();
|
||||
|
||||
cy.mergeViaGithubApi({
|
||||
repo: repoName,
|
||||
base: mainBranch,
|
||||
head: tempBranch3,
|
||||
cy.get(gitSyncLocators.bottomBarPullButton).click();
|
||||
cy.contains(Cypress.env("MESSAGES").GIT_CONFLICTING_INFO());
|
||||
cy.xpath("//span[@name='close-modal']").click({ force: true });
|
||||
});
|
||||
|
||||
cy.switchGitBranch(mainBranch);
|
||||
|
||||
cy.widgetText(
|
||||
inputNameTempBranch31,
|
||||
widgetsPage.inputWidget,
|
||||
widgetsPage.widgetNameSpan,
|
||||
);
|
||||
|
||||
cy.commitAndPush(true);
|
||||
|
||||
// reset git status
|
||||
cy.get(gitSyncLocators.bottomBarMergeButton).click();
|
||||
cy.get(gitSyncLocators.closeGitSyncModal).click();
|
||||
|
||||
cy.get(gitSyncLocators.gitPullCount);
|
||||
|
||||
cy.get(gitSyncLocators.bottomBarPullButton).click();
|
||||
cy.contains(Cypress.env("MESSAGES").GIT_CONFLICTING_INFO());
|
||||
cy.xpath("//span[@name='close-modal']").click({ force: true });
|
||||
});
|
||||
|
||||
it("5. Clicking '+' icon on bottom bar should open deploy popup", function () {
|
||||
cy.get(gitSyncLocators.bottomBarCommitButton).click({ force: true });
|
||||
cy.get(gitSyncLocators.gitSyncModal).should("exist");
|
||||
cy.get("[data-testid=t--tab-DEPLOY]").should("exist");
|
||||
cy.get("[data-testid=t--tab-DEPLOY]")
|
||||
.invoke("attr", "aria-selected")
|
||||
.should("eq", "true");
|
||||
cy.get(gitSyncLocators.closeGitSyncModal).click({ force: true });
|
||||
});
|
||||
|
||||
it("6. Checks clean url updates across branches", () => {
|
||||
cy.Deletepage("NewPage");
|
||||
cy.wait(1000);
|
||||
let legacyPathname = "";
|
||||
let newPathname = "";
|
||||
cy.intercept("GET", "/api/v1/pages?*mode=EDIT", (req) => {
|
||||
req.continue();
|
||||
}).as("appAndPages");
|
||||
cy.reload();
|
||||
cy.wait("@appAndPages").then((intercept2) => {
|
||||
const { application, pages } = intercept2.response.body.data;
|
||||
const defaultPage = pages.find((p) => p.isDefault);
|
||||
legacyPathname = `/applications/${application.id}/pages/${defaultPage.id}`;
|
||||
newPathname = `/app/${application.slug}/${defaultPage.slug}-${defaultPage.id}`;
|
||||
it("5. Clicking '+' icon on bottom bar should open deploy popup", function () {
|
||||
cy.get(gitSyncLocators.bottomBarCommitButton).click({ force: true });
|
||||
cy.get(gitSyncLocators.gitSyncModal).should("exist");
|
||||
cy.get("[data-testid=t--tab-DEPLOY]").should("exist");
|
||||
cy.get("[data-testid=t--tab-DEPLOY]")
|
||||
.invoke("attr", "aria-selected")
|
||||
.should("eq", "true");
|
||||
cy.get(gitSyncLocators.closeGitSyncModal).click({ force: true });
|
||||
});
|
||||
|
||||
cy.location().should((location) => {
|
||||
expect(location.pathname).includes(newPathname);
|
||||
it("6. Checks clean url updates across branches", () => {
|
||||
cy.Deletepage("NewPage");
|
||||
cy.wait(1000);
|
||||
let legacyPathname = "";
|
||||
let newPathname = "";
|
||||
cy.intercept("GET", "/api/v1/pages?*mode=EDIT", (req) => {
|
||||
req.continue();
|
||||
}).as("appAndPages");
|
||||
cy.reload();
|
||||
cy.wait("@appAndPages").then((intercept2) => {
|
||||
const { application, pages } = intercept2.response.body.data;
|
||||
const defaultPage = pages.find((p) => p.isDefault);
|
||||
legacyPathname = `/applications/${application.id}/pages/${defaultPage.id}`;
|
||||
newPathname = `/app/${application.slug}/${defaultPage.slug}-${defaultPage.id}`;
|
||||
});
|
||||
|
||||
cy.location().should((location) => {
|
||||
expect(location.pathname).includes(newPathname);
|
||||
});
|
||||
|
||||
cy.request("PUT", `/api/v1/applications/${applicationId}`, {
|
||||
applicationVersion: 1,
|
||||
});
|
||||
|
||||
_.gitSync.CreateGitBranch(cleanUrlBranch, true);
|
||||
|
||||
cy.location().should((location) => {
|
||||
expect(location.pathname).includes(legacyPathname);
|
||||
});
|
||||
|
||||
cy.switchGitBranch(mainBranch);
|
||||
|
||||
cy.get(".t--upgrade").click({ force: true });
|
||||
|
||||
cy.get(".t--upgrade-confirm").click({ force: true });
|
||||
|
||||
cy.location().should((location) => {
|
||||
expect(location.pathname).includes(newPathname);
|
||||
});
|
||||
|
||||
_.gitSync.CreateGitBranch(cleanUrlBranch, false, false); //false is sent for assertCreateBranch since here it only goes to the branch already created
|
||||
cy.location().should((location) => {
|
||||
expect(location.pathname).includes(legacyPathname);
|
||||
});
|
||||
});
|
||||
|
||||
cy.request("PUT", `/api/v1/applications/${applicationId}`, {
|
||||
applicationVersion: 1,
|
||||
});
|
||||
|
||||
_.gitSync.CreateGitBranch(cleanUrlBranch, true);
|
||||
|
||||
cy.location().should((location) => {
|
||||
expect(location.pathname).includes(legacyPathname);
|
||||
});
|
||||
|
||||
cy.switchGitBranch(mainBranch);
|
||||
|
||||
cy.get(".t--upgrade").click({ force: true });
|
||||
|
||||
cy.get(".t--upgrade-confirm").click({ force: true });
|
||||
|
||||
cy.location().should((location) => {
|
||||
expect(location.pathname).includes(newPathname);
|
||||
});
|
||||
|
||||
_.gitSync.CreateGitBranch(cleanUrlBranch, false, false); //false is sent for assertCreateBranch since here it only goes to the branch already created
|
||||
cy.location().should((location) => {
|
||||
expect(location.pathname).includes(legacyPathname);
|
||||
});
|
||||
});
|
||||
|
||||
// after(() => {
|
||||
// // _.gitSync.DeleteTestGithubRepo(repoName);
|
||||
// // //cy.deleteTestGithubRepo(repoName);
|
||||
// // // TODO remove when app deletion with conflicts is fixed
|
||||
// // cy.get(homePage.homeIcon).click({ force: true });
|
||||
// // cy.get(homePage.createNew)
|
||||
// // .first()
|
||||
// // .click({ force: true });
|
||||
// // cy.wait("@createNewApplication").should(
|
||||
// // "have.nested.property",
|
||||
// // "response.body.responseMeta.status",
|
||||
// // 201,
|
||||
// // );
|
||||
// // cy.get("#loading").should("not.exist");
|
||||
// // cy.wait(2000);
|
||||
// // cy.AppSetupForRename();
|
||||
// // cy.get(homePage.applicationName).type(repoName + "{enter}");
|
||||
// // cy.wait("@updateApplication").should(
|
||||
// // "have.nested.property",
|
||||
// // "response.body.responseMeta.status",
|
||||
// // 200,
|
||||
// // );
|
||||
// });
|
||||
});
|
||||
// after(() => {
|
||||
// // _.gitSync.DeleteTestGithubRepo(repoName);
|
||||
// // //cy.deleteTestGithubRepo(repoName);
|
||||
// // // TODO remove when app deletion with conflicts is fixed
|
||||
// // cy.get(homePage.homeIcon).click({ force: true });
|
||||
// // cy.get(homePage.createNew)
|
||||
// // .first()
|
||||
// // .click({ force: true });
|
||||
// // cy.wait("@createNewApplication").should(
|
||||
// // "have.nested.property",
|
||||
// // "response.body.responseMeta.status",
|
||||
// // 201,
|
||||
// // );
|
||||
// // cy.get("#loading").should("not.exist");
|
||||
// // cy.wait(2000);
|
||||
// // cy.AppSetupForRename();
|
||||
// // cy.get(homePage.applicationName).type(repoName + "{enter}");
|
||||
// // cy.wait("@updateApplication").should(
|
||||
// // "have.nested.property",
|
||||
// // "response.body.responseMeta.status",
|
||||
// // 200,
|
||||
// // );
|
||||
// });
|
||||
},
|
||||
);
|
||||
|
|
|
|||
|
|
@ -5,48 +5,52 @@ import * as _ from "../../../../../support/Objects/ObjectsCore";
|
|||
let repoName;
|
||||
let childBranchKey = "ChildBranch";
|
||||
let mainBranch = "master";
|
||||
describe("Git sync modal: merge tab", { tags: ["@tag.Git"] }, function () {
|
||||
before(() => {
|
||||
_.homePage.NavigateToHome();
|
||||
cy.createWorkspace();
|
||||
cy.wait("@createWorkspace").then((interception) => {
|
||||
const newWorkspaceName = interception.response.body.data.name;
|
||||
cy.CreateAppForWorkspace(newWorkspaceName, newWorkspaceName);
|
||||
describe(
|
||||
"Git sync modal: merge tab",
|
||||
{ tags: ["@tag.Git", "@tag.Git"] },
|
||||
function () {
|
||||
before(() => {
|
||||
_.homePage.NavigateToHome();
|
||||
cy.createWorkspace();
|
||||
cy.wait("@createWorkspace").then((interception) => {
|
||||
const newWorkspaceName = interception.response.body.data.name;
|
||||
cy.CreateAppForWorkspace(newWorkspaceName, newWorkspaceName);
|
||||
});
|
||||
|
||||
_.gitSync.CreateNConnectToGit(repoName);
|
||||
cy.get("@gitRepoName").then((repName) => {
|
||||
repoName = repName;
|
||||
});
|
||||
});
|
||||
|
||||
_.gitSync.CreateNConnectToGit(repoName);
|
||||
cy.get("@gitRepoName").then((repName) => {
|
||||
repoName = repName;
|
||||
it("1. Verify the functionality of the default dropdown under merge tab", function () {
|
||||
cy.get(commonLocators.canvas).click({ force: true });
|
||||
_.gitSync.CreateGitBranch(childBranchKey);
|
||||
cy.get(gitSyncLocators.bottomBarMergeButton).click();
|
||||
cy.get(gitSyncLocators.gitSyncModal).should("exist");
|
||||
cy.get("[data-testid=t--tab-MERGE]").should("exist");
|
||||
cy.get("[data-testid=t--tab-MERGE]")
|
||||
.invoke("attr", "aria-selected")
|
||||
.should("eq", "true");
|
||||
|
||||
cy.get(gitSyncLocators.mergeButton).should("be.disabled");
|
||||
cy.wait(3000);
|
||||
cy.get(gitSyncLocators.mergeBranchDropdownDestination).click();
|
||||
cy.get(commonLocators.dropdownmenu).contains(mainBranch).click();
|
||||
_.agHelper.AssertElementAbsence(_.gitSync._checkMergeability, 30000);
|
||||
|
||||
cy.wait("@mergeStatus", { timeout: 35000 }).should(
|
||||
"have.nested.property",
|
||||
"response.body.data.isMergeAble",
|
||||
true,
|
||||
);
|
||||
cy.wait(2000);
|
||||
cy.get(gitSyncLocators.mergeButton).should("be.enabled");
|
||||
cy.get(gitSyncLocators.closeGitSyncModal).click();
|
||||
});
|
||||
});
|
||||
|
||||
it("1. Verify the functionality of the default dropdown under merge tab", function () {
|
||||
cy.get(commonLocators.canvas).click({ force: true });
|
||||
_.gitSync.CreateGitBranch(childBranchKey);
|
||||
cy.get(gitSyncLocators.bottomBarMergeButton).click();
|
||||
cy.get(gitSyncLocators.gitSyncModal).should("exist");
|
||||
cy.get("[data-testid=t--tab-MERGE]").should("exist");
|
||||
cy.get("[data-testid=t--tab-MERGE]")
|
||||
.invoke("attr", "aria-selected")
|
||||
.should("eq", "true");
|
||||
|
||||
cy.get(gitSyncLocators.mergeButton).should("be.disabled");
|
||||
cy.wait(3000);
|
||||
cy.get(gitSyncLocators.mergeBranchDropdownDestination).click();
|
||||
cy.get(commonLocators.dropdownmenu).contains(mainBranch).click();
|
||||
_.agHelper.AssertElementAbsence(_.gitSync._checkMergeability, 30000);
|
||||
|
||||
cy.wait("@mergeStatus", { timeout: 35000 }).should(
|
||||
"have.nested.property",
|
||||
"response.body.data.isMergeAble",
|
||||
true,
|
||||
);
|
||||
cy.wait(2000);
|
||||
cy.get(gitSyncLocators.mergeButton).should("be.enabled");
|
||||
cy.get(gitSyncLocators.closeGitSyncModal).click();
|
||||
});
|
||||
|
||||
after(() => {
|
||||
_.gitSync.DeleteTestGithubRepo(repoName);
|
||||
});
|
||||
});
|
||||
after(() => {
|
||||
_.gitSync.DeleteTestGithubRepo(repoName);
|
||||
});
|
||||
},
|
||||
);
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import homePage from "../../../../../locators/HomePage";
|
|||
import * as _ from "../../../../../support/Objects/ObjectsCore";
|
||||
import gitSyncLocators from "../../../../../locators/gitSyncLocators";
|
||||
|
||||
describe("Pre git connection spec:", function () {
|
||||
describe("Pre git connection spec:", { tags: ["@tag.Git"] }, function () {
|
||||
it("1. Deploy menu at the application dropdown menu", () => {
|
||||
// create new app
|
||||
_.homePage.NavigateToHome();
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import {
|
|||
gitSync,
|
||||
} from "../../../../../support/Objects/ObjectsCore";
|
||||
|
||||
describe("Git regenerate SSH key flow", function () {
|
||||
describe("Git regenerate SSH key flow", { tags: ["@tag.Git"] }, function () {
|
||||
let repoName;
|
||||
|
||||
it("1. Verify SSH key regeneration flow ", () => {
|
||||
|
|
|
|||
|
|
@ -9,96 +9,100 @@ import {
|
|||
import { REPO, CURRENT_REPO } from "../../../../../fixtures/REPO";
|
||||
|
||||
let repoName1, repoName2, repoName3, repoName4, windowOpenSpy;
|
||||
describe("Repo Limit Exceeded Error Modal", function () {
|
||||
before(() => {
|
||||
const uuid = require("uuid");
|
||||
repoName1 = uuid.v4().split("-")[0];
|
||||
repoName2 = uuid.v4().split("-")[0];
|
||||
repoName3 = uuid.v4().split("-")[0];
|
||||
repoName4 = uuid.v4().split("-")[0];
|
||||
agHelper.AssertElementVisibility(locators._sidebar);
|
||||
onboarding.closeIntroModal();
|
||||
});
|
||||
describe(
|
||||
"Repo Limit Exceeded Error Modal",
|
||||
{ tags: ["@tag.Git"] },
|
||||
function () {
|
||||
before(() => {
|
||||
const uuid = require("uuid");
|
||||
repoName1 = uuid.v4().split("-")[0];
|
||||
repoName2 = uuid.v4().split("-")[0];
|
||||
repoName3 = uuid.v4().split("-")[0];
|
||||
repoName4 = uuid.v4().split("-")[0];
|
||||
agHelper.AssertElementVisibility(locators._sidebar);
|
||||
onboarding.closeIntroModal();
|
||||
});
|
||||
|
||||
it("1. Verify Repo limit flow for CE instance", function () {
|
||||
agHelper.Sleep(2000); // adding wait for app to load
|
||||
homePage.LogOutviaAPI();
|
||||
cy.generateUUID().then((uid) => {
|
||||
cy.Signup(`${uid}@appsmithtest.com`, uid);
|
||||
});
|
||||
homePage.NavigateToHome();
|
||||
homePage.CreateNewApplication();
|
||||
gitSync.CreateNConnectToGit(repoName1, true, true);
|
||||
cy.get("@gitRepoName").then((repName) => {
|
||||
repoName1 = repName;
|
||||
});
|
||||
homePage.NavigateToHome();
|
||||
homePage.CreateNewApplication();
|
||||
gitSync.CreateNConnectToGit(repoName2, true, true);
|
||||
cy.get("@gitRepoName").then((repName) => {
|
||||
repoName2 = repName;
|
||||
});
|
||||
homePage.NavigateToHome();
|
||||
homePage.CreateNewApplication();
|
||||
gitSync.CreateNConnectToGit(repoName3, true, true);
|
||||
cy.get("@gitRepoName").then((repName) => {
|
||||
repoName3 = repName;
|
||||
});
|
||||
homePage.NavigateToHome();
|
||||
homePage.CreateNewApplication();
|
||||
gitSync.CreateNConnectToGit(repoName4, false, true);
|
||||
cy.get("@gitRepoName").then((repName) => {
|
||||
repoName4 = repName;
|
||||
});
|
||||
if (CURRENT_REPO === REPO.CE) {
|
||||
cy.get(gitSyncLocators.repoLimitExceededErrorModal).should("exist");
|
||||
|
||||
// title and info text checking
|
||||
cy.get(gitSyncLocators.repoLimitExceededErrorModal).contains(
|
||||
Cypress.env("MESSAGES").REPOSITORY_LIMIT_REACHED(),
|
||||
);
|
||||
cy.get(gitSyncLocators.repoLimitExceededErrorModal).contains(
|
||||
Cypress.env("MESSAGES").REPOSITORY_LIMIT_REACHED_INFO(),
|
||||
);
|
||||
cy.get(gitSyncLocators.repoLimitExceededErrorModal).contains(
|
||||
Cypress.env("MESSAGES").CONTACT_SUPPORT_TO_UPGRADE(),
|
||||
);
|
||||
cy.get(gitSyncLocators.gitModalLink).should(
|
||||
"contain.text",
|
||||
"Contact support",
|
||||
);
|
||||
cy.get(gitSyncLocators.repoLimitExceededErrorModal).contains(
|
||||
Cypress.env("MESSAGES").REVOKE_CAUSE_APPLICATION_BREAK(),
|
||||
);
|
||||
|
||||
// learn more link checking
|
||||
cy.window().then((window) => {
|
||||
windowOpenSpy = cy.stub(window, "open").callsFake((url) => {
|
||||
expect(url.startsWith("https://docs.appsmith.com/")).to.be.true;
|
||||
windowOpenSpy.restore();
|
||||
});
|
||||
it("1. Verify Repo limit flow for CE instance", function () {
|
||||
agHelper.Sleep(2000); // adding wait for app to load
|
||||
homePage.LogOutviaAPI();
|
||||
cy.generateUUID().then((uid) => {
|
||||
cy.Signup(`${uid}@appsmithtest.com`, uid);
|
||||
});
|
||||
cy.get(gitSyncLocators.gitModalLink).contains("Learn more").click();
|
||||
homePage.NavigateToHome();
|
||||
homePage.CreateNewApplication();
|
||||
gitSync.CreateNConnectToGit(repoName1, true, true);
|
||||
cy.get("@gitRepoName").then((repName) => {
|
||||
repoName1 = repName;
|
||||
});
|
||||
homePage.NavigateToHome();
|
||||
homePage.CreateNewApplication();
|
||||
gitSync.CreateNConnectToGit(repoName2, true, true);
|
||||
cy.get("@gitRepoName").then((repName) => {
|
||||
repoName2 = repName;
|
||||
});
|
||||
homePage.NavigateToHome();
|
||||
homePage.CreateNewApplication();
|
||||
gitSync.CreateNConnectToGit(repoName3, true, true);
|
||||
cy.get("@gitRepoName").then((repName) => {
|
||||
repoName3 = repName;
|
||||
});
|
||||
homePage.NavigateToHome();
|
||||
homePage.CreateNewApplication();
|
||||
gitSync.CreateNConnectToGit(repoName4, false, true);
|
||||
cy.get("@gitRepoName").then((repName) => {
|
||||
repoName4 = repName;
|
||||
});
|
||||
if (CURRENT_REPO === REPO.CE) {
|
||||
cy.get(gitSyncLocators.repoLimitExceededErrorModal).should("exist");
|
||||
|
||||
cy.get(gitSyncLocators.connectedApplication).should("have.length", 3);
|
||||
cy.get(gitSyncLocators.diconnectLink).first().click();
|
||||
// title and info text checking
|
||||
cy.get(gitSyncLocators.repoLimitExceededErrorModal).contains(
|
||||
Cypress.env("MESSAGES").REPOSITORY_LIMIT_REACHED(),
|
||||
);
|
||||
cy.get(gitSyncLocators.repoLimitExceededErrorModal).contains(
|
||||
Cypress.env("MESSAGES").REPOSITORY_LIMIT_REACHED_INFO(),
|
||||
);
|
||||
cy.get(gitSyncLocators.repoLimitExceededErrorModal).contains(
|
||||
Cypress.env("MESSAGES").CONTACT_SUPPORT_TO_UPGRADE(),
|
||||
);
|
||||
cy.get(gitSyncLocators.gitModalLink).should(
|
||||
"contain.text",
|
||||
"Contact support",
|
||||
);
|
||||
cy.get(gitSyncLocators.repoLimitExceededErrorModal).contains(
|
||||
Cypress.env("MESSAGES").REVOKE_CAUSE_APPLICATION_BREAK(),
|
||||
);
|
||||
|
||||
cy.get(gitSyncLocators.repoLimitExceededErrorModal).should("not.exist");
|
||||
cy.get(gitSyncLocators.disconnectGitModal).should("exist");
|
||||
// learn more link checking
|
||||
cy.window().then((window) => {
|
||||
windowOpenSpy = cy.stub(window, "open").callsFake((url) => {
|
||||
expect(url.startsWith("https://docs.appsmith.com/")).to.be.true;
|
||||
windowOpenSpy.restore();
|
||||
});
|
||||
});
|
||||
cy.get(gitSyncLocators.gitModalLink).contains("Learn more").click();
|
||||
|
||||
cy.get(gitSyncLocators.closeGitSyncModal).click();
|
||||
cy.get(gitSyncLocators.repoLimitExceededErrorModal).should("not.exist");
|
||||
}
|
||||
});
|
||||
cy.get(gitSyncLocators.connectedApplication).should("have.length", 3);
|
||||
cy.get(gitSyncLocators.diconnectLink).first().click();
|
||||
|
||||
after(() => {
|
||||
homePage.DeleteAppviaAPI(repoName1);
|
||||
homePage.DeleteAppviaAPI(repoName2);
|
||||
homePage.DeleteAppviaAPI(repoName3);
|
||||
homePage.DeleteAppviaAPI(repoName4);
|
||||
gitSync.DeleteTestGithubRepo(repoName1);
|
||||
gitSync.DeleteTestGithubRepo(repoName2);
|
||||
gitSync.DeleteTestGithubRepo(repoName3);
|
||||
gitSync.DeleteTestGithubRepo(repoName4);
|
||||
});
|
||||
});
|
||||
cy.get(gitSyncLocators.repoLimitExceededErrorModal).should("not.exist");
|
||||
cy.get(gitSyncLocators.disconnectGitModal).should("exist");
|
||||
|
||||
cy.get(gitSyncLocators.closeGitSyncModal).click();
|
||||
cy.get(gitSyncLocators.repoLimitExceededErrorModal).should("not.exist");
|
||||
}
|
||||
});
|
||||
|
||||
after(() => {
|
||||
homePage.DeleteAppviaAPI(repoName1);
|
||||
homePage.DeleteAppviaAPI(repoName2);
|
||||
homePage.DeleteAppviaAPI(repoName3);
|
||||
homePage.DeleteAppviaAPI(repoName4);
|
||||
gitSync.DeleteTestGithubRepo(repoName1);
|
||||
gitSync.DeleteTestGithubRepo(repoName2);
|
||||
gitSync.DeleteTestGithubRepo(repoName3);
|
||||
gitSync.DeleteTestGithubRepo(repoName4);
|
||||
});
|
||||
},
|
||||
);
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ let parentBranchKey = "ParentBranch",
|
|||
branchQueryKey = "branch";
|
||||
|
||||
let repoName;
|
||||
describe("Git sync:", function () {
|
||||
describe("Git sync:", { tags: ["@tag.Git"] }, function () {
|
||||
before(() => {
|
||||
homePage.NavigateToHome();
|
||||
cy.createWorkspace();
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ let parentBranchKey = "ParentBranch",
|
|||
childBranchKey = "ChildBranch";
|
||||
|
||||
let repoName;
|
||||
describe("Git sync:", function () {
|
||||
describe("Git sync:", { tags: ["@tag.Git"] }, function () {
|
||||
before(() => {
|
||||
homePage.NavigateToHome();
|
||||
agHelper.GenerateUUID();
|
||||
|
|
|
|||
|
|
@ -15,82 +15,87 @@ const mainBranch = "master";
|
|||
const tempBranch = "feat/tempBranch";
|
||||
let repoName;
|
||||
|
||||
describe("excludeForAirgap", "Tests JS Library with Git", () => {
|
||||
before(() => {
|
||||
homePage.NavigateToHome();
|
||||
cy.createWorkspace();
|
||||
cy.wait("@createWorkspace").then((interception) => {
|
||||
const newWorkspaceName = interception.response.body.data.name;
|
||||
cy.CreateAppForWorkspace(newWorkspaceName, newWorkspaceName);
|
||||
describe(
|
||||
"excludeForAirgap",
|
||||
"Tests JS Library with Git",
|
||||
{ tags: ["@tag.Git"] },
|
||||
() => {
|
||||
before(() => {
|
||||
homePage.NavigateToHome();
|
||||
cy.createWorkspace();
|
||||
cy.wait("@createWorkspace").then((interception) => {
|
||||
const newWorkspaceName = interception.response.body.data.name;
|
||||
cy.CreateAppForWorkspace(newWorkspaceName, newWorkspaceName);
|
||||
});
|
||||
// connect app to git
|
||||
gitSync.CreateNConnectToGit(repoName);
|
||||
cy.get("@gitRepoName").then((repName) => {
|
||||
repoName = repName;
|
||||
});
|
||||
});
|
||||
// connect app to git
|
||||
gitSync.CreateNConnectToGit(repoName);
|
||||
cy.get("@gitRepoName").then((repName) => {
|
||||
repoName = repName;
|
||||
|
||||
it("1. Install JS Library and commit changes, create branch and verify JS library changes are present on new branch ", () => {
|
||||
AppSidebar.navigate(AppSidebarButton.Libraries);
|
||||
installer.OpenInstaller();
|
||||
installer.InstallLibrary("uuidjs", "UUID");
|
||||
gitSync.CommitAndPush();
|
||||
// create new branch
|
||||
gitSync.CreateGitBranch(tempBranch, true);
|
||||
// verify js library changes are present
|
||||
AppSidebar.navigate(AppSidebarButton.Libraries);
|
||||
installer.AssertLibraryinExplorer("uuidjs");
|
||||
});
|
||||
});
|
||||
|
||||
it("1. Install JS Library and commit changes, create branch and verify JS library changes are present on new branch ", () => {
|
||||
AppSidebar.navigate(AppSidebarButton.Libraries);
|
||||
installer.OpenInstaller();
|
||||
installer.InstallLibrary("uuidjs", "UUID");
|
||||
gitSync.CommitAndPush();
|
||||
// create new branch
|
||||
gitSync.CreateGitBranch(tempBranch, true);
|
||||
// verify js library changes are present
|
||||
AppSidebar.navigate(AppSidebarButton.Libraries);
|
||||
installer.AssertLibraryinExplorer("uuidjs");
|
||||
});
|
||||
it("2. Discard custom js library changes, verify changes are discarded also verify it deosnt show uncommitted changes", () => {
|
||||
AppSidebar.navigate(AppSidebarButton.Libraries);
|
||||
installer.uninstallLibrary("uuidjs");
|
||||
// discard js library uninstallation
|
||||
gitSync.DiscardChanges();
|
||||
// verify js library is present
|
||||
AppSidebar.navigate(AppSidebarButton.Libraries);
|
||||
installer.AssertLibraryinExplorer("uuidjs");
|
||||
// verify no uncommitted changes are there
|
||||
agHelper.AssertElementExist(gitSync._bottomBarPull);
|
||||
cy.get(gitSyncLocators.bottomBarCommitButton).click();
|
||||
cy.get(gitSyncLocators.commitCommentInput).should("be.disabled");
|
||||
cy.get(gitSyncLocators.commitButton).should("be.disabled");
|
||||
cy.get(gitSyncLocators.closeGitSyncModal).click();
|
||||
// swtich to master, verify no uncommitted changes
|
||||
cy.switchGitBranch("master");
|
||||
agHelper.AssertElementExist(gitSync._bottomBarPull);
|
||||
cy.get(gitSyncLocators.bottomBarCommitButton).click();
|
||||
cy.get(gitSyncLocators.commitCommentInput).should("be.disabled");
|
||||
cy.get(gitSyncLocators.commitButton).should("be.disabled");
|
||||
cy.get(gitSyncLocators.closeGitSyncModal).click();
|
||||
});
|
||||
|
||||
it("2. Discard custom js library changes, verify changes are discarded also verify it deosnt show uncommitted changes", () => {
|
||||
AppSidebar.navigate(AppSidebarButton.Libraries);
|
||||
installer.uninstallLibrary("uuidjs");
|
||||
// discard js library uninstallation
|
||||
gitSync.DiscardChanges();
|
||||
// verify js library is present
|
||||
AppSidebar.navigate(AppSidebarButton.Libraries);
|
||||
installer.AssertLibraryinExplorer("uuidjs");
|
||||
// verify no uncommitted changes are there
|
||||
agHelper.AssertElementExist(gitSync._bottomBarPull);
|
||||
cy.get(gitSyncLocators.bottomBarCommitButton).click();
|
||||
cy.get(gitSyncLocators.commitCommentInput).should("be.disabled");
|
||||
cy.get(gitSyncLocators.commitButton).should("be.disabled");
|
||||
cy.get(gitSyncLocators.closeGitSyncModal).click();
|
||||
// swtich to master, verify no uncommitted changes
|
||||
cy.switchGitBranch("master");
|
||||
agHelper.AssertElementExist(gitSync._bottomBarPull);
|
||||
cy.get(gitSyncLocators.bottomBarCommitButton).click();
|
||||
cy.get(gitSyncLocators.commitCommentInput).should("be.disabled");
|
||||
cy.get(gitSyncLocators.commitButton).should("be.disabled");
|
||||
cy.get(gitSyncLocators.closeGitSyncModal).click();
|
||||
});
|
||||
it("3. Merge custom js lib changes from child branch to master, verify changes are merged", () => {
|
||||
cy.switchGitBranch(tempBranch);
|
||||
agHelper.AssertElementExist(gitSync._bottomBarPull);
|
||||
AppSidebar.navigate(AppSidebarButton.Libraries);
|
||||
installer.OpenInstaller();
|
||||
installer.InstallLibrary("jspdf", "jspdf");
|
||||
//cy.commitAndPush();
|
||||
|
||||
it("3. Merge custom js lib changes from child branch to master, verify changes are merged", () => {
|
||||
cy.switchGitBranch(tempBranch);
|
||||
agHelper.AssertElementExist(gitSync._bottomBarPull);
|
||||
AppSidebar.navigate(AppSidebarButton.Libraries);
|
||||
installer.OpenInstaller();
|
||||
installer.InstallLibrary("jspdf", "jspdf");
|
||||
//cy.commitAndPush();
|
||||
|
||||
cy.get(HomePage.publishButton).click();
|
||||
agHelper.AssertElementExist(gitSync._bottomBarPull);
|
||||
cy.get(gitSyncLocators.commitCommentInput).type("Initial Commit");
|
||||
cy.get(gitSyncLocators.commitButton).click();
|
||||
agHelper.AssertElementExist(gitSync._bottomBarPull);
|
||||
cy.get(gitSyncLocators.closeGitSyncModal).click();
|
||||
cy.wait(2000);
|
||||
cy.merge(mainBranch);
|
||||
cy.get(gitSyncLocators.closeGitSyncModal).click();
|
||||
cy.wait(2000);
|
||||
// verify custom js library is present in master branch
|
||||
cy.switchGitBranch(mainBranch);
|
||||
agHelper.AssertElementExist(gitSync._bottomBarPull);
|
||||
AppSidebar.navigate(AppSidebarButton.Libraries);
|
||||
installer.AssertLibraryinExplorer("jspdf");
|
||||
});
|
||||
after(() => {
|
||||
//clean up
|
||||
gitSync.DeleteTestGithubRepo(repoName);
|
||||
});
|
||||
});
|
||||
cy.get(HomePage.publishButton).click();
|
||||
agHelper.AssertElementExist(gitSync._bottomBarPull);
|
||||
cy.get(gitSyncLocators.commitCommentInput).type("Initial Commit");
|
||||
cy.get(gitSyncLocators.commitButton).click();
|
||||
agHelper.AssertElementExist(gitSync._bottomBarPull);
|
||||
cy.get(gitSyncLocators.closeGitSyncModal).click();
|
||||
cy.wait(2000);
|
||||
cy.merge(mainBranch);
|
||||
cy.get(gitSyncLocators.closeGitSyncModal).click();
|
||||
cy.wait(2000);
|
||||
// verify custom js library is present in master branch
|
||||
cy.switchGitBranch(mainBranch);
|
||||
agHelper.AssertElementExist(gitSync._bottomBarPull);
|
||||
AppSidebar.navigate(AppSidebarButton.Libraries);
|
||||
installer.AssertLibraryinExplorer("jspdf");
|
||||
});
|
||||
after(() => {
|
||||
//clean up
|
||||
gitSync.DeleteTestGithubRepo(repoName);
|
||||
});
|
||||
},
|
||||
);
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import * as _ from "../../../../../support/Objects/ObjectsCore";
|
|||
const widgetsPage = require("../../../../../locators/Widgets.json");
|
||||
const commonlocators = require("../../../../../locators/commonlocators.json");
|
||||
|
||||
describe("Git with Theming:", function () {
|
||||
describe("Git with Theming:", { tags: ["@tag.Git"] }, function () {
|
||||
const backgroudColorMaster = "rgb(22, 163, 74)";
|
||||
const backgroudColorChildBranch = "rgb(100, 116, 139)";
|
||||
const tempBranch = "tempBranch";
|
||||
|
|
|
|||
|
|
@ -32,5 +32,7 @@ module.exports = {
|
|||
"@tag.Theme",
|
||||
"@tag.Settings",
|
||||
"@tag.ImportExport",
|
||||
"@tag.AutoHeight",
|
||||
"@tag.Fork",
|
||||
],
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user