diff --git a/README.md b/README.md index bacaccf60b..861820a3ce 100644 --- a/README.md +++ b/README.md @@ -10,14 +10,14 @@
-[](https://github.com/appsmithorg/appsmith/releases/latest) +[](https://github.com/appsmithorg/appsmith/releases/latest) [](https://appsmith.com) [](https://discord.gg/rBTTVJp) [](https://docs.appsmith.com) -
+- Built with ❤︎ & empathy + Built with empathy, not just ❤︎
@@ -37,7 +37,7 @@ Appsmith provides a better way of building internal tools by visualising them as ## Features -* **Build custom UI**: Drag & drop, resize and style widgets **without HTLM / CSS**. [Read more](https://docs.appsmith.com/core-concepts/building-the-ui) +* **Build custom UI**: Drag & drop, resize and style widgets **without HTML / CSS**. [Read more](https://docs.appsmith.com/core-concepts/building-the-ui) * **Query data**: Query & update your database directly from the UI. Supports **postgres, mongo, REST & GraphQL APIs**. [Read more](https://docs.appsmith.com/core-concepts/building-the-ui/displaying-api-data) * **JS Logic**: Write snippets of business logic using JS to transform data, manipuate UI or trigger workflows * **Data Workflows**: Simple configuration to create flows when users interact with the UI. [Read more](https://docs.appsmith.com/core-concepts/building-the-ui/calling-apis-from-widgets) diff --git a/app/client/cypress/fixtures/testdata.json b/app/client/cypress/fixtures/testdata.json index 0d31926877..ea75e9ee3d 100644 --- a/app/client/cypress/fixtures/testdata.json +++ b/app/client/cypress/fixtures/testdata.json @@ -37,5 +37,9 @@ "prevUrl": ".data.previous}}", "methodsWithParam": "users?page=2", "invalidHeader": "invalid", - "invalidValue": "invalid" -} + "invalidValue": "invalid", + "Put": "PUT", + "Get": "GET", + "next": "?page=2&pageSize=10", + "prev": "?page=1&pageSize=10" +} \ No newline at end of file diff --git a/app/client/cypress/integration/Smoke_TestSuite/ApiPaneTests/API_All_Verb_spec.js b/app/client/cypress/integration/Smoke_TestSuite/ApiPaneTests/API_All_Verb_spec.js index a5a9c85f6f..166a3d6701 100644 --- a/app/client/cypress/integration/Smoke_TestSuite/ApiPaneTests/API_All_Verb_spec.js +++ b/app/client/cypress/integration/Smoke_TestSuite/ApiPaneTests/API_All_Verb_spec.js @@ -30,9 +30,10 @@ describe("API Panel Test Functionality", function() { .click({ force: true }) .focus() .type(json, { force: true }); + cy.WaitAutoSave(); + cy.RunAPI(); + cy.validateRequest(testdata.baseUrl2, testdata.methodput, testdata.Put); }); - cy.WaitAutoSave(); - cy.RunAPI(); cy.ResponseStatusCheck("200 OK"); cy.log("Response code check successful"); cy.ResponseCheck("updatedAt"); @@ -55,9 +56,10 @@ describe("API Panel Test Functionality", function() { .click({ force: true }) .focus() .type(json, { force: true }); + cy.WaitAutoSave(); + cy.RunAPI(); + cy.validateRequest(testdata.baseUrl2, testdata.methodpost, testdata.Post); }); - cy.WaitAutoSave(); - cy.RunAPI(); cy.ResponseStatusCheck("201 CREATED"); cy.log("Response code check successful"); cy.ResponseCheck("createdAt"); @@ -80,9 +82,14 @@ describe("API Panel Test Functionality", function() { .click({ force: true }) .focus() .type(json, { force: true }); + cy.WaitAutoSave(); + cy.RunAPI(); + cy.validateRequest( + testdata.baseUrl2, + testdata.methodpatch, + testdata.Patch, + ); }); - cy.WaitAutoSave(); - cy.RunAPI(); cy.ResponseStatusCheck("200 OK"); cy.log("Response code check successful"); cy.ResponseCheck("updatedAt"); @@ -101,6 +108,11 @@ describe("API Panel Test Functionality", function() { ); cy.WaitAutoSave(); cy.RunAPI(); + cy.validateRequest( + testdata.baseUrl2, + testdata.methodpatch, + testdata.Delete, + ); cy.ResponseStatusCheck("204 NO_CONTENT"); cy.log("Response code check successful"); }); @@ -112,6 +124,7 @@ describe("API Panel Test Functionality", function() { cy.enterDatasourceAndPath(testdata.baseUrl, testdata.methods); cy.WaitAutoSave(); cy.RunAPI(); + cy.validateRequest(testdata.baseUrl, testdata.methods, testdata.Get); cy.ResponseStatusCheck(testdata.successStatusCode); cy.log("Response code check successful"); cy.ResponseCheck(testdata.responsetext); @@ -120,12 +133,22 @@ describe("API Panel Test Functionality", function() { cy.selectPaginationType(apiwidget.paginationWithUrl); cy.enterUrl(apiname, apiwidget.panigationNextUrl, testdata.nextUrl); cy.clickTest(apiwidget.TestNextUrl); + cy.validateRequest( + testdata.baseUrl, + testdata.methods.concat(testdata.next), + testdata.Get, + ); cy.ResponseStatusCheck(testdata.successStatusCode); cy.log("Response code check successful"); cy.ResponseCheck("Josh M Krantz"); cy.log("Response data check successful"); cy.enterUrl(apiname, apiwidget.panigationPrevUrl, testdata.prevUrl); cy.clickTest(apiwidget.TestPreUrl); + cy.validateRequest( + testdata.baseUrl, + testdata.methods.concat(testdata.prev), + testdata.Get, + ); cy.ResponseStatusCheck(testdata.successStatusCode); cy.log("Response code check successful"); cy.ResponseCheck(testdata.responsetext); @@ -138,6 +161,7 @@ describe("API Panel Test Functionality", function() { cy.enterDatasourceAndPath(testdata.baseUrl, testdata.queryAndValue); cy.WaitAutoSave(); cy.RunAPI(); + cy.validateRequest(testdata.baseUrl, testdata.queryAndValue, testdata.Get); cy.ResponseStatusCheck("200 OK"); cy.log("Response code check successful"); cy.ResponseCheck(testdata.responsetext3); @@ -157,6 +181,7 @@ describe("API Panel Test Functionality", function() { ); cy.WaitAutoSave(); cy.RunAPI(); + cy.validateRequest(testdata.baseUrl, testdata.methods, testdata.Get); cy.ResponseStatusCheck("5000"); cy.log("Response code check successful"); cy.ResponseCheck("Invalid value for Content-Type"); diff --git a/app/client/cypress/integration/Smoke_TestSuite/ApiPaneTests/API_Edit_spec.js b/app/client/cypress/integration/Smoke_TestSuite/ApiPaneTests/API_Edit_spec.js index 7629cee44e..32ed8cc158 100644 --- a/app/client/cypress/integration/Smoke_TestSuite/ApiPaneTests/API_Edit_spec.js +++ b/app/client/cypress/integration/Smoke_TestSuite/ApiPaneTests/API_Edit_spec.js @@ -9,8 +9,8 @@ describe("API Panel Test Functionality", function() { cy.CreateAPI("FirstAPI"); cy.log("Creation of FirstAPI Action successful"); cy.enterDatasourceAndPath(testdata.baseUrl, testdata.methods); - cy.WaitAutoSave(); - cy.RunAPI(); + cy.SaveAndRunAPI(); + cy.validateRequest(testdata.baseUrl, testdata.methods, testdata.Get); cy.ResponseStatusCheck(testdata.successStatusCode); cy.get(apiwidget.createApiOnSideBar) .first() diff --git a/app/client/cypress/locators/apiWidgetslocator.json b/app/client/cypress/locators/apiWidgetslocator.json index 4d94ca1b2a..263257a37c 100644 --- a/app/client/cypress/locators/apiWidgetslocator.json +++ b/app/client/cypress/locators/apiWidgetslocator.json @@ -34,5 +34,12 @@ "TestNextUrl": ".t--apiFormPaginationNextTest", "TestPreUrl": ".t--apiFormPaginationPrevTest", "EditApiName": "img[alt='Edit pen']", - "ApiName": ".t--action-name-edit-field span" + "ApiName": ".t--action-name-edit-field span", + "Request": "//li[text()='Request']", + "RequestURL": "(//span[@class='bp3-tree-node-label']/span)[1]", + "RequestMethod": "(//span[@class='bp3-tree-node-label']/span)[2]", + "content-Type": "(//span[@class='bp3-tree-node-label']/span)[3]", + "requestBody": "(//div[contains(@class,'bp3-collapse-body')]//textarea)[1]", + "showrequest": "span:contains('Show Request')", + "Responsetab": "//li[text()='Response Body']" } diff --git a/app/client/cypress/support/commands.js b/app/client/cypress/support/commands.js index 65cac3a16d..183ce923da 100644 --- a/app/client/cypress/support/commands.js +++ b/app/client/cypress/support/commands.js @@ -377,6 +377,17 @@ Cypress.Commands.add("SaveAndRunAPI", () => { cy.RunAPI(); }); +Cypress.Commands.add("validateRequest", (baseurl, path, verb) => { + cy.xpath(apiwidget.Request) + .should("be.visible") + .click({ force: true }); + cy.xpath(apiwidget.RequestURL).contains(baseurl.concat(path)); + cy.xpath(apiwidget.RequestMethod).contains(verb); + cy.xpath(apiwidget.Responsetab) + .should("be.visible") + .click({ force: true }); +}); + Cypress.Commands.add("SelectAction", action => { cy.get(ApiEditor.ApiVerb) .first() @@ -471,9 +482,12 @@ Cypress.Commands.add("selectPaginationType", option => { }); Cypress.Commands.add("clickTest", testbutton => { + cy.wait(2000); + cy.wait("@saveAction"); cy.get(testbutton) .first() .click({ force: true }); + cy.wait("@postExecute"); }); Cypress.Commands.add("enterUrl", (apiname, url, value) => { diff --git a/app/client/src/widgets/TableWidget.tsx b/app/client/src/widgets/TableWidget.tsx index 4dad1fd1b2..a40569f824 100644 --- a/app/client/src/widgets/TableWidget.tsx +++ b/app/client/src/widgets/TableWidget.tsx @@ -34,14 +34,14 @@ class TableWidget extends BaseWidget