test: Fix to run Upgrade cypress test only in CE (#20472)

## Description
- We need to add the license key to start the server for EE and to
authorise gsheet we need to connect to actual cloud services. So, until
we find a solution we are skipping the gsheet test in EE.

## Type of change
- Cypress


## How Has This Been Tested?
- Cypress

## Checklist:
### QA activity:
- [x] Added Test Plan Approved label after reveiwing all Cypress test
This commit is contained in:
Saroj 2023-02-14 17:05:59 +05:30 committed by GitHub
parent a3fb818c7c
commit 9a80b6d856
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 59 additions and 84 deletions

View File

@ -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);

View File

@ -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);
});
},