Merge branch 'feature/locatorsUpdate' into 'release'

Feature/locators update

See merge request theappsmith/internal-tools-client!772
This commit is contained in:
Nandan H A 2020-06-24 13:52:41 +00:00
commit 3b7ffdba18
5 changed files with 27 additions and 24 deletions

View File

@ -31,6 +31,7 @@
"putAction": "//div[contains(@id,'react-select') and contains(text(),'PUT')]",
"postAction": "//div[contains(@id,'react-select') and contains(text(),'POST')]",
"patchAction": "//div[contains(@id,'react-select') and contains(text(),'PATCH')]",
"deleteAction": "//div[contains(@id,'react-select') and contains(text(),'DELETE')]",
"moustacheMethod": "{{Api.text}}",
"nextUrl": ".data.next}}",
"prevUrl": ".data.previous}}"

View File

@ -20,13 +20,13 @@ describe("Test curl import flow", function() {
expect(someText).to.equal(response.response.body.data.name);
});
});
// cy.WaitAutoSave();
//cy.WaitAutoSave();
cy.RunAPI();
cy.ResponseStatusCheck("200 OK");
cy.get(ApiEditor.formActionButtons).should("be.visible");
cy.get(ApiEditor.ApiDeleteBtn).click();
cy.get(ApiEditor.ApiDeleteBtn).should("be.disabled");
cy.testDeleteApi();
cy.wait("@deleteAction");
cy.get("@deleteAction").then(response => {
cy.expect(response.response.body.responseMeta.success).to.eq(true);
});

View File

@ -89,6 +89,22 @@ describe("API Panel Test Functionality", function() {
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() {
const apiname = "FirstAPI";
cy.CreateAPI(apiname);
@ -138,7 +154,7 @@ describe("API Panel Test Functionality", function() {
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.log("Creation of SecondAPI Action successful");
cy.EnterSourceDetailsWithQueryParam(

View File

@ -9,8 +9,8 @@ describe("API Panel Test Functionality", function() {
cy.CreateAPI("FirstAPI");
cy.log("Creation of FirstAPI Action successful");
cy.EnterSourceDetailsWithHeader(
testdata.baseUrl2,
testdata.methods1,
testdata.baseUrl,
testdata.methods,
testdata.headerKey,
testdata.headerValue,
);
@ -24,7 +24,7 @@ describe("API Panel Test Functionality", function() {
cy.ClearSearch();
cy.SearchAPIandClick("SecondAPI");
//invalid api end point check
cy.EditSourceDetail(testdata.baseUrl3, testdata.invalidPath);
cy.EditSourceDetail(testdata.baseUrl, testdata.invalidPath);
cy.RunAPI();
cy.ResponseStatusCheck("404 NOT_FOUND");
cy.DeleteAPI();

View File

@ -176,7 +176,7 @@ Cypress.Commands.add("CreateAPI", apiname => {
.first()
.click({ force: true });
cy.get(apiwidget.createapi).click({ force: true });
cy.wait("@createNewApi");
//cy.wait("@createNewApi");
//cy.wait("@getUser");
cy.get(apiwidget.resourceUrl).should("be.visible");
cy.xpath(apiwidget.EditApiName).click();
@ -184,7 +184,7 @@ Cypress.Commands.add("CreateAPI", apiname => {
.clear()
.type(apiname)
.should("have.value", apiname);
cy.WaitAutoSave();
//cy.WaitAutoSave();
// Added because api name edit takes some time to
// reflect in api sidebar after the call passes.
cy.wait(4000);
@ -214,8 +214,8 @@ Cypress.Commands.add("EditApiName", apiname => {
});
Cypress.Commands.add("WaitAutoSave", () => {
//cy.wait("@saveQuery");
// cy.wait("@postExecute");
cy.wait("@saveQuery");
//cy.wait("@postExecute");
});
Cypress.Commands.add("RunAPI", () => {
@ -439,11 +439,6 @@ Cypress.Commands.add("DeleteAPI", apiname => {
.first()
.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", () => {
@ -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", () => {
cy.get(ApiEditor.curlImportBtn).click({ force: true });
cy.wait("@curlImport").should(