diff --git a/openmetadata-ui/src/main/resources/ui/cypress/common/DataInsightUtils.js b/openmetadata-ui/src/main/resources/ui/cypress/common/DataInsightUtils.js index 7081ac672768..1af1eafa5098 100644 --- a/openmetadata-ui/src/main/resources/ui/cypress/common/DataInsightUtils.js +++ b/openmetadata-ui/src/main/resources/ui/cypress/common/DataInsightUtils.js @@ -10,7 +10,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { BASE_WAIT_TIME, RETRY_TIMES } from './common'; +import { RETRY_TIMES } from './common'; + +const BASE_WAIT_TIME = 4000; export const checkDataInsightSuccessStatus = ( count = 1, @@ -27,7 +29,7 @@ export const checkDataInsightSuccessStatus = ( $ingestionStatus.text() !== 'Failed' && count <= RETRY_TIMES ) { - // retry after waiting with log1 method [20s,40s,80s,160s,320s] + // retry after waiting with log1 method [4s,8s,16s,32s,64s] cy.wait(timer); timer *= 2; cy.reload(); diff --git a/openmetadata-ui/src/main/resources/ui/cypress/common/common.js b/openmetadata-ui/src/main/resources/ui/cypress/common/common.js index ee5ea115b47e..4a00ad70d3dd 100644 --- a/openmetadata-ui/src/main/resources/ui/cypress/common/common.js +++ b/openmetadata-ui/src/main/resources/ui/cypress/common/common.js @@ -573,21 +573,41 @@ export const visitEntityDetailsPage = ({ .first() .click(); } else { - // if term is not available in search suggestion, - // hitting enter to search box so it will redirect to explore page - cy.get('body').click(1, 1); - cy.get('[data-testid="searchBox"]').type('{enter}'); - verifyResponseStatusCode('@explorePageSearch', 200); - - const tabName = EXPLORE_PAGE_TABS?.[entity] ?? entity; - - cy.get(`[data-testid="${tabName}-tab"]`).click(); - - verifyResponseStatusCode('@explorePageTabSearch', 200); - - cy.get(`[data-testid="${id}"] [data-testid="entity-link"]`) - .scrollIntoView() - .click(); + cy.get(`[data-testid="global-search-suggestion-box"]`) + .contains(term) + .then(($body) => { + if ($body.length) { + cy.get(`[data-testid="global-search-suggestion-box"]`) + .contains(term) + .click(); + } else { + // if term is not available in search suggestion, + // hitting enter to search box so it will redirect to explore page + cy.get('body').click(1, 1); + cy.get('[data-testid="searchBox"]').type('{enter}'); + verifyResponseStatusCode('@explorePageSearch', 200); + + const tabName = EXPLORE_PAGE_TABS?.[entity] ?? entity; + + cy.get(`[data-testid="${tabName}-tab"]`).click(); + + verifyResponseStatusCode('@explorePageTabSearch', 200); + + if ( + $body.find(`[data-testid="${id}"] [data-testid="entity-link"]`) + .length + ) { + cy.get(`[data-testid="${id}"] [data-testid="entity-link"]`) + .scrollIntoView() + .click(); + } else { + cy.get(`[data-testid="entity-link"]`) + .contains(term) + .eq(0) + .click(); + } + } + }); } }); diff --git a/openmetadata-ui/src/main/resources/ui/cypress/e2e/Service/postgres.spec.js b/openmetadata-ui/src/main/resources/ui/cypress/e2e/Service/postgres.spec.js index 82dbcd44d7ee..c49d12e53678 100644 --- a/openmetadata-ui/src/main/resources/ui/cypress/e2e/Service/postgres.spec.js +++ b/openmetadata-ui/src/main/resources/ui/cypress/e2e/Service/postgres.spec.js @@ -128,6 +128,10 @@ describe('Postgres Ingestion', () => { .scrollIntoView() .contains('Usage Ingestion') .click(); + + cy.get('#root\\/filterCondition') + .scrollIntoView() + .type(`s.query like '%${tableName}%'`); cy.get('[data-testid="submit-btn"]') .scrollIntoView() .should('be.visible') diff --git a/openmetadata-ui/src/main/resources/ui/src/components/AppBar/Suggestions.tsx b/openmetadata-ui/src/main/resources/ui/src/components/AppBar/Suggestions.tsx index 24080ac4cd42..d62568422c86 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/AppBar/Suggestions.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/AppBar/Suggestions.tsx @@ -148,7 +148,7 @@ const Suggestions = ({ const getEntitiesSuggestions = () => { return ( -
+
{[ { suggestions: tableSuggestions, searchIndex: SearchIndex.TABLE }, { suggestions: topicSuggestions, searchIndex: SearchIndex.TOPIC },