diff --git a/app/client/cypress/integration/Smoke_TestSuite/ExplorerTests/Entity_Explorer_Query_Datasource_spec.js b/app/client/cypress/integration/Smoke_TestSuite/ExplorerTests/Entity_Explorer_Query_Datasource_spec.js index ccbae34c2d..3f4dd52608 100644 --- a/app/client/cypress/integration/Smoke_TestSuite/ExplorerTests/Entity_Explorer_Query_Datasource_spec.js +++ b/app/client/cypress/integration/Smoke_TestSuite/ExplorerTests/Entity_Explorer_Query_Datasource_spec.js @@ -50,7 +50,38 @@ describe("Entity explorer tests related to query and datasource", function() { 200, ); - cy.get(queryLocators.templateMenu).click(); + cy.wait(2000); + cy.go("back"); + + cy.contains(".t--datasource-name", datasourceName) + .find(queryLocators.editDatasourceButton) + .click(); + + cy.get(".t--edit-datasource-name").click(); + cy.get(".t--edit-datasource-name input") + .clear() + .type(`${datasourceName}new`, { force: true }) + .blur(); + + cy.contains(commonlocators.entityName, `${datasourceName}new`); + + // reverting the name + cy.get(".t--edit-datasource-name").click(); + cy.get(".t--edit-datasource-name input") + .clear() + .type(`${datasourceName}`, { force: true }) + .blur(); + + // going to the query create page + cy.contains(commonlocators.entityName, "Query1").click(); + + cy.get("@getPluginForm").should( + "have.nested.property", + "response.body.responseMeta.status", + 200, + ); + + // cy.get(queryLocators.templateMenu).click(); cy.get(".CodeMirror textarea") .first() .focus() diff --git a/app/client/cypress/locators/QueryEditor.json b/app/client/cypress/locators/QueryEditor.json index b5cb009914..28929954ba 100644 --- a/app/client/cypress/locators/QueryEditor.json +++ b/app/client/cypress/locators/QueryEditor.json @@ -6,5 +6,6 @@ "deleteQuery": ".t--delete-query", "createQuery": ".t--create-query", "addQueryEntity": ".//div[contains(@class,'t--entity group queries')]//div[contains(@class,'t--entity-add-btn')]", - "addDatasource": ".t--add-datasource" + "addDatasource": ".t--add-datasource", + "editDatasourceButton": ".t--edit-datasource" } diff --git a/app/client/cypress/locators/commonlocators.json b/app/client/cypress/locators/commonlocators.json index 57ded168de..f685e3827c 100644 --- a/app/client/cypress/locators/commonlocators.json +++ b/app/client/cypress/locators/commonlocators.json @@ -81,9 +81,9 @@ "selectedZoomlevel": ".t--property-control-maxzoomlevel button span", "imgWidget": "div[data-testid='styledImage']", "selectTab": ".t--tab-Tab", + "entityName": ".t--entity-name", "filePickerButton": ".t--widget-filepickerwidget", "filePickerInput": ".uppy-Dashboard-input", "filePickerUploadButton": ".uppy-StatusBar-actionBtn--upload", "filePickerOnFilesSelected": ".t--property-control-onfilesselected" - } diff --git a/app/client/src/pages/Editor/Explorer/Pages/PageGroup.tsx b/app/client/src/pages/Editor/Explorer/Pages/PageGroup.tsx index 872ae61d76..5765fff65f 100644 --- a/app/client/src/pages/Editor/Explorer/Pages/PageGroup.tsx +++ b/app/client/src/pages/Editor/Explorer/Pages/PageGroup.tsx @@ -31,6 +31,7 @@ const pageGroupEqualityCheck = ( return ( prev.widgets === next.widgets && prev.actions === next.actions && + prev.datasources === next.datasources && prev.searchKeyword === next.searchKeyword ); };