Merge branch 'feature/locatorsUpdate' into 'release'
Feature/locators update See merge request theappsmith/internal-tools-client!772
This commit is contained in:
commit
3b7ffdba18
|
|
@ -31,6 +31,7 @@
|
||||||
"putAction": "//div[contains(@id,'react-select') and contains(text(),'PUT')]",
|
"putAction": "//div[contains(@id,'react-select') and contains(text(),'PUT')]",
|
||||||
"postAction": "//div[contains(@id,'react-select') and contains(text(),'POST')]",
|
"postAction": "//div[contains(@id,'react-select') and contains(text(),'POST')]",
|
||||||
"patchAction": "//div[contains(@id,'react-select') and contains(text(),'PATCH')]",
|
"patchAction": "//div[contains(@id,'react-select') and contains(text(),'PATCH')]",
|
||||||
|
"deleteAction": "//div[contains(@id,'react-select') and contains(text(),'DELETE')]",
|
||||||
"moustacheMethod": "{{Api.text}}",
|
"moustacheMethod": "{{Api.text}}",
|
||||||
"nextUrl": ".data.next}}",
|
"nextUrl": ".data.next}}",
|
||||||
"prevUrl": ".data.previous}}"
|
"prevUrl": ".data.previous}}"
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ describe("Test curl import flow", function() {
|
||||||
cy.get(ApiEditor.formActionButtons).should("be.visible");
|
cy.get(ApiEditor.formActionButtons).should("be.visible");
|
||||||
cy.get(ApiEditor.ApiDeleteBtn).click();
|
cy.get(ApiEditor.ApiDeleteBtn).click();
|
||||||
cy.get(ApiEditor.ApiDeleteBtn).should("be.disabled");
|
cy.get(ApiEditor.ApiDeleteBtn).should("be.disabled");
|
||||||
cy.testDeleteApi();
|
cy.wait("@deleteAction");
|
||||||
cy.get("@deleteAction").then(response => {
|
cy.get("@deleteAction").then(response => {
|
||||||
cy.expect(response.response.body.responseMeta.success).to.eq(true);
|
cy.expect(response.response.body.responseMeta.success).to.eq(true);
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -89,6 +89,22 @@ describe("API Panel Test Functionality", function() {
|
||||||
cy.log("Response data check successful");
|
cy.log("Response data check successful");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("Delete Action test API fetaure", function() {
|
||||||
|
cy.CreateAPI("FirstAPI");
|
||||||
|
cy.log("Creation of FirstAPI Action successful");
|
||||||
|
cy.SelectAction(testdata.deleteAction);
|
||||||
|
cy.EnterSourceDetailsWithbody(
|
||||||
|
testdata.baseUrl2,
|
||||||
|
testdata.methodpatch,
|
||||||
|
testdata.headerKey,
|
||||||
|
testdata.headerValue,
|
||||||
|
);
|
||||||
|
cy.WaitAutoSave();
|
||||||
|
cy.RunAPI();
|
||||||
|
cy.ResponseStatusCheck("204 NO_CONTENT");
|
||||||
|
cy.log("Response code check successful");
|
||||||
|
});
|
||||||
|
|
||||||
it("Test GET Action for mock API with header and pagination", function() {
|
it("Test GET Action for mock API with header and pagination", function() {
|
||||||
const apiname = "FirstAPI";
|
const apiname = "FirstAPI";
|
||||||
cy.CreateAPI(apiname);
|
cy.CreateAPI(apiname);
|
||||||
|
|
@ -138,7 +154,7 @@ describe("API Panel Test Functionality", function() {
|
||||||
cy.log("Response data check successful");
|
cy.log("Response data check successful");
|
||||||
});
|
});
|
||||||
|
|
||||||
it.skip("API check with Invalid Header", function() {
|
it("API check with Invalid Header", function() {
|
||||||
cy.CreateAPI("FirstAPI");
|
cy.CreateAPI("FirstAPI");
|
||||||
cy.log("Creation of SecondAPI Action successful");
|
cy.log("Creation of SecondAPI Action successful");
|
||||||
cy.EnterSourceDetailsWithQueryParam(
|
cy.EnterSourceDetailsWithQueryParam(
|
||||||
|
|
|
||||||
|
|
@ -9,8 +9,8 @@ describe("API Panel Test Functionality", function() {
|
||||||
cy.CreateAPI("FirstAPI");
|
cy.CreateAPI("FirstAPI");
|
||||||
cy.log("Creation of FirstAPI Action successful");
|
cy.log("Creation of FirstAPI Action successful");
|
||||||
cy.EnterSourceDetailsWithHeader(
|
cy.EnterSourceDetailsWithHeader(
|
||||||
testdata.baseUrl2,
|
testdata.baseUrl,
|
||||||
testdata.methods1,
|
testdata.methods,
|
||||||
testdata.headerKey,
|
testdata.headerKey,
|
||||||
testdata.headerValue,
|
testdata.headerValue,
|
||||||
);
|
);
|
||||||
|
|
@ -24,7 +24,7 @@ describe("API Panel Test Functionality", function() {
|
||||||
cy.ClearSearch();
|
cy.ClearSearch();
|
||||||
cy.SearchAPIandClick("SecondAPI");
|
cy.SearchAPIandClick("SecondAPI");
|
||||||
//invalid api end point check
|
//invalid api end point check
|
||||||
cy.EditSourceDetail(testdata.baseUrl3, testdata.invalidPath);
|
cy.EditSourceDetail(testdata.baseUrl, testdata.invalidPath);
|
||||||
cy.RunAPI();
|
cy.RunAPI();
|
||||||
cy.ResponseStatusCheck("404 NOT_FOUND");
|
cy.ResponseStatusCheck("404 NOT_FOUND");
|
||||||
cy.DeleteAPI();
|
cy.DeleteAPI();
|
||||||
|
|
|
||||||
|
|
@ -176,7 +176,7 @@ Cypress.Commands.add("CreateAPI", apiname => {
|
||||||
.first()
|
.first()
|
||||||
.click({ force: true });
|
.click({ force: true });
|
||||||
cy.get(apiwidget.createapi).click({ force: true });
|
cy.get(apiwidget.createapi).click({ force: true });
|
||||||
cy.wait("@createNewApi");
|
//cy.wait("@createNewApi");
|
||||||
//cy.wait("@getUser");
|
//cy.wait("@getUser");
|
||||||
cy.get(apiwidget.resourceUrl).should("be.visible");
|
cy.get(apiwidget.resourceUrl).should("be.visible");
|
||||||
cy.xpath(apiwidget.EditApiName).click();
|
cy.xpath(apiwidget.EditApiName).click();
|
||||||
|
|
@ -184,7 +184,7 @@ Cypress.Commands.add("CreateAPI", apiname => {
|
||||||
.clear()
|
.clear()
|
||||||
.type(apiname)
|
.type(apiname)
|
||||||
.should("have.value", apiname);
|
.should("have.value", apiname);
|
||||||
cy.WaitAutoSave();
|
//cy.WaitAutoSave();
|
||||||
// Added because api name edit takes some time to
|
// Added because api name edit takes some time to
|
||||||
// reflect in api sidebar after the call passes.
|
// reflect in api sidebar after the call passes.
|
||||||
cy.wait(4000);
|
cy.wait(4000);
|
||||||
|
|
@ -214,7 +214,7 @@ Cypress.Commands.add("EditApiName", apiname => {
|
||||||
});
|
});
|
||||||
|
|
||||||
Cypress.Commands.add("WaitAutoSave", () => {
|
Cypress.Commands.add("WaitAutoSave", () => {
|
||||||
//cy.wait("@saveQuery");
|
cy.wait("@saveQuery");
|
||||||
//cy.wait("@postExecute");
|
//cy.wait("@postExecute");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -439,11 +439,6 @@ Cypress.Commands.add("DeleteAPI", apiname => {
|
||||||
.first()
|
.first()
|
||||||
.click({ force: true });
|
.click({ force: true });
|
||||||
cy.get(apiwidget.delete).click({ force: true });
|
cy.get(apiwidget.delete).click({ force: true });
|
||||||
cy.wait("@deleteAction").should(
|
|
||||||
"have.nested.property",
|
|
||||||
"response.body.responseMeta.status",
|
|
||||||
200,
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
Cypress.Commands.add("CreateModal", () => {
|
Cypress.Commands.add("CreateModal", () => {
|
||||||
|
|
@ -913,15 +908,6 @@ Cypress.Commands.add("testSaveDeleteDatasource", () => {
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
Cypress.Commands.add("testDeleteApi", () => {
|
|
||||||
cy.get(ApiEditor.createBlankApiCard).click({ force: true });
|
|
||||||
cy.wait("@deleteAction").should(
|
|
||||||
"have.nested.property",
|
|
||||||
"response.body.responseMeta.status",
|
|
||||||
200,
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
Cypress.Commands.add("importCurl", () => {
|
Cypress.Commands.add("importCurl", () => {
|
||||||
cy.get(ApiEditor.curlImportBtn).click({ force: true });
|
cy.get(ApiEditor.curlImportBtn).click({ force: true });
|
||||||
cy.wait("@curlImport").should(
|
cy.wait("@curlImport").should(
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user