diff --git a/app/client/cypress/integration/Regression_TestSuite/UpgradeAppsmith/UpgradeAppsimth_spec.js b/app/client/cypress/integration/Regression_TestSuite/UpgradeAppsmith/UpgradeAppsimth_spec.js index e7d46e7fd5..7a9053b27c 100644 --- a/app/client/cypress/integration/Regression_TestSuite/UpgradeAppsmith/UpgradeAppsimth_spec.js +++ b/app/client/cypress/integration/Regression_TestSuite/UpgradeAppsmith/UpgradeAppsimth_spec.js @@ -18,8 +18,8 @@ describe("Upgrade appsmith version", () => { localStorage.setItem("ContainerName", `appsmith-${name}`); - //Start CE Container with old stack - cy.StartCEContainer( + //Start a new Container with old stack + cy.StartNewContainer( tedUrl, path + "/oldstack/tempStacks/oldstacks", "cicontainer", @@ -32,63 +32,63 @@ describe("Upgrade appsmith version", () => { cy.GetAndVerifyLogs(tedUrl, `appsmith-${name}`); }); - //verify the Applications after upgrade - cy.forceVisit(testdata.APPURL); - //Commenting this to fix the test - // agHelper.GetNClick(".t--widget-iconbuttonwidget button", 0, true); - // agHelper.Sleep(1000); - // agHelper.GetNAssertElementText( - // ".tbody>div", - // "1Developmentexpertise", - // "have.text", - // 1, - // ); + //verify the Applications after upgrade only on CE and skip for BE + if (Cypress.env("Edition") !== 0) { + cy.forceVisit(testdata.APPURL); + agHelper.GetNClick(".t--widget-iconbuttonwidget button", 0, true); + agHelper.Sleep(1000); + agHelper.GetNAssertElementText( + ".tbody>div", + "1Developmentexpertise", + "have.text", + 1, + ); - // agHelper.GetNClick(".tbody>div", 1, true, 1000); - // agHelper.GetNAssertElementText( - // ".t--jsonformfield-label input", - // "Development", - // "have.value", - // ); - // agHelper.GetNAssertElementText( - // ".t--jsonformfield-type input", - // "expertise", - // "have.value", - // ); - // agHelper.GetNAssertElementText( - // ".t--jsonformfield-rowIndex input", - // "1", - // "have.value", - // ); + agHelper.GetNClick(".tbody>div", 1, true, 1000); + agHelper.GetNAssertElementText( + ".t--jsonformfield-label input", + "Development", + "have.value", + ); + agHelper.GetNAssertElementText( + ".t--jsonformfield-type input", + "expertise", + "have.value", + ); + agHelper.GetNAssertElementText( + ".t--jsonformfield-rowIndex input", + "1", + "have.value", + ); - // cy.get(".t--jsonformfield-label input") - // .clear() - // .type("DevelopmentUpdate"); - // agHelper.GetNClick(".t--jsonform-footer button", 1, true); - // agHelper.Sleep(2000); - // agHelper.GetNClick(".t--widget-iconbuttonwidget button", 0, true, 1000); - // agHelper.GetNAssertElementText( - // ".tbody>div", - // "1DevelopmentUpdateexpertise", - // "have.text", - // 1, - // ); - - // //Resetting the data - // agHelper.GetNClick(".tbody>div", 1, true, 1000); - // cy.get(".t--jsonformfield-label input") - // .clear() - // .type("Development"); - // agHelper.GetNClick(".t--jsonform-footer button", 1, true); - // agHelper.Sleep(2000); - // agHelper.GetNClick(".t--widget-iconbuttonwidget button", 0, true, 1000); - // agHelper.GetNAssertElementText( - // ".tbody>div", - // "1Developmentexpertise", - // "have.text", - // 1, - // ); + cy.get(".t--jsonformfield-label input") + .clear() + .type("DevelopmentUpdate"); + agHelper.GetNClick(".t--jsonform-footer button", 1, true); + agHelper.Sleep(2000); + agHelper.GetNClick(".t--widget-iconbuttonwidget button", 0, true, 1000); + agHelper.GetNAssertElementText( + ".tbody>div", + "1DevelopmentUpdateexpertise", + "have.text", + 1, + ); + //Resetting the data + agHelper.GetNClick(".tbody>div", 1, true, 1000); + cy.get(".t--jsonformfield-label input") + .clear() + .type("Development"); + agHelper.GetNClick(".t--jsonform-footer button", 1, true); + agHelper.Sleep(2000); + agHelper.GetNClick(".t--widget-iconbuttonwidget button", 0, true, 1000); + agHelper.GetNAssertElementText( + ".tbody>div", + "1Developmentexpertise", + "have.text", + 1, + ); + } // stop the container cy.StopContainer(tedUrl, localStorage.getItem("ContainerName")); agHelper.Sleep(2000); diff --git a/app/client/cypress/support/commands.js b/app/client/cypress/support/commands.js index 17eab346c2..30657fab6f 100644 --- a/app/client/cypress/support/commands.js +++ b/app/client/cypress/support/commands.js @@ -1884,33 +1884,7 @@ Cypress.Commands.add("StartContainer", (path, containerName) => { }); Cypress.Commands.add( - "StartCEContainer", - (url, path, version, containerName) => { - let comm = - "docker run -d --name " + - containerName + - ' -p 8081:80 -p 9002:9002 -v "' + - path + - '/stacks:/appsmith-stacks" -e APPSMITH_CLOUD_SERVICES_BASE_URL=http://host.docker.internal:5001 ' + - version; - - cy.log(comm); - cy.request({ - method: "GET", - url: url, - qs: { - cmd: comm, - }, - }).then((res) => { - cy.log("ContainerID", res.body.stdout); - cy.log(res.body.stderr); - expect(res.status).equal(200); - }); - }, -); - -Cypress.Commands.add( - "StartEEContainer", + "StartNewContainer", (url, path, version, containerName) => { let comm = "docker run -d --name " + @@ -1928,7 +1902,8 @@ Cypress.Commands.add( cmd: comm, }, }).then((res) => { - cy.log(res.body.stdout, res.body.stderr); + cy.log("ContainerID", res.body.stdout); + cy.log(res.body.stderr); expect(res.status).equal(200); }); },