diff --git a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/DisplayWidgets/Table_spec.js b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/DisplayWidgets/Table_spec.js index 1bfbed6a6b..4fabdef2c4 100644 --- a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/DisplayWidgets/Table_spec.js +++ b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/DisplayWidgets/Table_spec.js @@ -3,7 +3,6 @@ const widgetsPage = require("../../../../locators/Widgets.json"); const commonlocators = require("../../../../locators/commonlocators.json"); const publish = require("../../../../locators/publishWidgetspage.json"); const dsl = require("../../../../fixtures/tableWidgetDsl.json"); -const pages = require("../../../../locators/Pages.json"); describe("Table Widget Functionality", function() { before(() => { @@ -83,7 +82,9 @@ describe("Table Widget Functionality", function() { cy.wait(5000); cy.get(publish.searchInput) .first() - .clear() + .within(() => { + return cy.get("input").clear(); + }) .type("7434532"); // eslint-disable-next-line cypress/no-unnecessary-waiting cy.wait(1000); @@ -97,7 +98,9 @@ describe("Table Widget Functionality", function() { it("Table Widget Functionality To Filter The Data", function() { cy.get(publish.searchInput) .first() - .clear(); + .within(() => { + return cy.get("input").clear(); + }); // eslint-disable-next-line cypress/no-unnecessary-waiting cy.wait(1000); cy.isSelectRow(1); diff --git a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/ExplorerTests/Entity_Explorer_Tab_rename_Delete_spec.js b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/ExplorerTests/Entity_Explorer_Tab_rename_Delete_spec.js index 178635df67..1b0841806c 100644 --- a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/ExplorerTests/Entity_Explorer_Tab_rename_Delete_spec.js +++ b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/ExplorerTests/Entity_Explorer_Tab_rename_Delete_spec.js @@ -31,10 +31,9 @@ describe("Tab widget test", function() { cy.RenameEntity(tabname); cy.validateMessage(tabname); cy.deleteEntity(); - cy.get(commonlocators.entityExplorersearch).should("be.visible"); cy.get(commonlocators.entityExplorersearch) - .clear() - .type("Tab 2"); + .clear({ force: true }) + .type("Tab 2", { force: true }); cy.get( commonlocators.entitySearchResult.concat("Tab 2").concat("')"), ).should("not.exist"); diff --git a/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/ExplorerTests/Entity_Explorer_CopyQuery_RenameDatasource_spec.js b/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/ExplorerTests/Entity_Explorer_CopyQuery_RenameDatasource_spec.js index bf7a8c4c50..da45d8d1a5 100644 --- a/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/ExplorerTests/Entity_Explorer_CopyQuery_RenameDatasource_spec.js +++ b/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/ExplorerTests/Entity_Explorer_CopyQuery_RenameDatasource_spec.js @@ -88,7 +88,7 @@ describe("Entity explorer tests related to copy query", function() { }); it("Delete query and rename datasource in explorer", function() { - cy.get(commonlocators.entityExplorersearch).clear(); + cy.get(commonlocators.entityExplorersearch).clear({ force: true }); cy.NavigateToDatasourceEditor(); cy.GlobalSearchEntity(`${datasourceName}`); cy.get(`.t--entity-name:contains(${datasourceName})`) diff --git a/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/ExplorerTests/Entity_Explorer_Datasource_Structure_spec.js b/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/ExplorerTests/Entity_Explorer_Datasource_Structure_spec.js index ff72c2c1c5..fccf4a4aa8 100644 --- a/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/ExplorerTests/Entity_Explorer_Datasource_Structure_spec.js +++ b/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/ExplorerTests/Entity_Explorer_Datasource_Structure_spec.js @@ -79,7 +79,7 @@ describe("Entity explorer datasource structure", function() { 200, ); - cy.get(commonlocators.entityExplorersearch).clear(); + cy.get(commonlocators.entityExplorersearch).clear({ force: true }); cy.deleteDatasource(datasourceName); }); @@ -102,7 +102,7 @@ describe("Entity explorer datasource structure", function() { 200, ); - cy.get(commonlocators.entityExplorersearch).clear(); + cy.get(commonlocators.entityExplorersearch).clear({ force: true }); const tableName = Math.random() .toString(36) @@ -158,7 +158,7 @@ describe("Entity explorer datasource structure", function() { 200, ); - cy.get(commonlocators.entityExplorersearch).clear(); + cy.get(commonlocators.entityExplorersearch).clear({ force: true }); cy.deleteDatasource(datasourceName); }); }); diff --git a/app/client/cypress/locators/publishWidgetspage.json b/app/client/cypress/locators/publishWidgetspage.json index b4a75d5dad..d1eb7eb40b 100644 --- a/app/client/cypress/locators/publishWidgetspage.json +++ b/app/client/cypress/locators/publishWidgetspage.json @@ -22,7 +22,7 @@ "pickMyLocation": ".t--widget-mapwidget div[title='Pick My Location']", "rectChart": ".t--widget-chartwidget g rect", "chartLab": ".t--widget-chartwidget g:nth-child(5) text", - "searchInput": "input", + "searchInput": ".t--search-input", "downloadBtn": ".t--table-download-btn", "filterBtn": ".t--table-filter-toggle-btn", "attributeDropdown": ".t--table-filter-columns-dropdown", diff --git a/app/client/cypress/support/commands.js b/app/client/cypress/support/commands.js index aa74b07d33..e467b7b416 100644 --- a/app/client/cypress/support/commands.js +++ b/app/client/cypress/support/commands.js @@ -459,10 +459,9 @@ Cypress.Commands.add("SearchApp", (appname) => { }); Cypress.Commands.add("SearchEntity", (apiname1, apiname2) => { - cy.get(commonlocators.entityExplorersearch).should("be.visible"); cy.get(commonlocators.entityExplorersearch) - .clear() - .type(apiname1); + .clear({ force: true }) + .type(apiname1, { force: true }); // eslint-disable-next-line cypress/no-unnecessary-waiting cy.wait(500); cy.get( @@ -474,10 +473,10 @@ Cypress.Commands.add("SearchEntity", (apiname1, apiname2) => { }); Cypress.Commands.add("GlobalSearchEntity", (apiname1) => { - cy.get(commonlocators.entityExplorersearch).should("be.visible"); + // entity explorer search will be hidden cy.get(commonlocators.entityExplorersearch) - .clear() - .type(apiname1); + .clear({ force: true }) + .type(apiname1, { force: true }); // eslint-disable-next-line cypress/no-unnecessary-waiting cy.wait(500); cy.get( @@ -634,8 +633,7 @@ Cypress.Commands.add("SelectAction", (action) => { }); Cypress.Commands.add("ClearSearch", () => { - cy.get(commonlocators.entityExplorersearch).should("be.visible"); - cy.get(commonlocators.entityExplorersearch).clear(); + cy.get(commonlocators.entityExplorersearch).clear({ force: true }); }); Cypress.Commands.add( @@ -649,8 +647,8 @@ Cypress.Commands.add( const lastChar = text.slice(-1); cy.get(commonlocators.entityExplorersearch) - .clear() - .click() + .clear({ force: true }) + .click({ force: true }) .then(() => { $element.text(subString); $element.val(subString); @@ -660,10 +658,9 @@ Cypress.Commands.add( ); Cypress.Commands.add("SearchEntityandOpen", (apiname1) => { - cy.get(commonlocators.entityExplorersearch).should("be.visible"); cy.get(commonlocators.entityExplorersearch) - .clear() - .type(apiname1); + .clear({ force: true }) + .type(apiname1, { force: true }); // eslint-disable-next-line cypress/no-unnecessary-waiting cy.wait(500); cy.get( diff --git a/app/client/src/pages/Editor/Explorer/EntityExplorer.tsx b/app/client/src/pages/Editor/Explorer/EntityExplorer.tsx index 5d0fe93033..6c24de0fe6 100644 --- a/app/client/src/pages/Editor/Explorer/EntityExplorer.tsx +++ b/app/client/src/pages/Editor/Explorer/EntityExplorer.tsx @@ -86,7 +86,7 @@ function EntityExplorer(props: IPanelProps) { return ( - + ` + display: ${(props) => (props.isHidden ? "none" : "grid")}; grid-template-columns: 30px 1fr 30px; margin-bottom: 5px; height: 48px; @@ -64,11 +64,16 @@ const Underline = styled.div` /*eslint-disable react/display-name */ export const ExplorerSearch = forwardRef( ( - props: { clear: () => void; placeholder?: string; autoFocus?: boolean }, + props: { + clear: () => void; + placeholder?: string; + autoFocus?: boolean; + isHidden?: boolean; + }, ref: Ref, ) => { return ( - + { global label="Search entities" onKeyDown={(e: any) => { - const entitySearchInput = document.getElementById( - ENTITY_EXPLORER_SEARCH_ID, - ); const widgetSearchInput = document.getElementById( WIDGETS_SEARCH_ID, ); - if (entitySearchInput) entitySearchInput.focus(); - if (widgetSearchInput) widgetSearchInput.focus(); - e.preventDefault(); - e.stopPropagation(); + if (widgetSearchInput) { + widgetSearchInput.focus(); + e.preventDefault(); + e.stopPropagation(); + } }} />