From c9f3b4a2cd74284d9fb568ea48fa03a386a14c6c Mon Sep 17 00:00:00 2001 From: Aniket Katkar Date: Fri, 17 May 2024 19:45:37 +0530 Subject: [PATCH] Minor: Bug fixes and improvements (#16323) * Fix the flaky observability alert cypress tests * Add glossary entity Creation details object in EntityConstant file for cypress * Fix the icons in observability alert destination options --------- Co-authored-by: Shailesh Parmar --- .../resources/ui/cypress/common/AlertUtils.ts | 12 ++++++++--- .../ui/cypress/constants/EntityConstant.ts | 11 ++++++++++ .../e2e/Flow/ObservabilityAlerts.spec.ts | 2 +- .../ui/src/utils/ObservabilityUtils.tsx | 20 ++++++++++++++++--- 4 files changed, 38 insertions(+), 7 deletions(-) diff --git a/openmetadata-ui/src/main/resources/ui/cypress/common/AlertUtils.ts b/openmetadata-ui/src/main/resources/ui/cypress/common/AlertUtils.ts index 03153333ff2..5d28c7de56c 100644 --- a/openmetadata-ui/src/main/resources/ui/cypress/common/AlertUtils.ts +++ b/openmetadata-ui/src/main/resources/ui/cypress/common/AlertUtils.ts @@ -53,7 +53,9 @@ export const addOwnerFilter = ( cy.get('[data-testid="owner-name-select"]').click().type(ownerName); verifyResponseStatusCode('@getSearchResult', 200); cy.get(`[title="${ownerName}"]`).filter(':visible').scrollIntoView().click(); - cy.get('[data-testid="owner-name-select"]').should('contain', ownerName); + cy.get(`[data-testid="owner-name-select"] [title="${ownerName}"]`).should( + 'exist' + ); if (exclude) { // Change filter effect @@ -82,7 +84,9 @@ export const addEntityFQNFilter = ( cy.get('[data-testid="fqn-list-select"]').click().type(entityFQN); verifyResponseStatusCode('@getSearchResult', 200); cy.get(`[title="${entityFQN}"]`).filter(':visible').scrollIntoView().click(); - cy.get(`[title="${entityFQN}"] [aria-label="check"]`).should('exist'); + cy.get(`[data-testid="fqn-list-select"] [title="${entityFQN}"]`).should( + 'exist' + ); if (exclude) { // Change filter effect @@ -170,7 +174,9 @@ export const addDomainFilter = ( cy.get('[data-testid="domain-select"]').click().type(domainName); verifyResponseStatusCode('@getSearchResult', 200); cy.get(`[title="${domainName}"]`).filter(':visible').scrollIntoView().click(); - cy.get('[data-testid="domain-select"]').should('contain', domainName); + cy.get(`[data-testid="domain-select"] [title="${domainName}"]`).should( + 'exist' + ); if (exclude) { // Change filter effect diff --git a/openmetadata-ui/src/main/resources/ui/cypress/constants/EntityConstant.ts b/openmetadata-ui/src/main/resources/ui/cypress/constants/EntityConstant.ts index 89d477c80d4..9f76bc15f84 100644 --- a/openmetadata-ui/src/main/resources/ui/cypress/constants/EntityConstant.ts +++ b/openmetadata-ui/src/main/resources/ui/cypress/constants/EntityConstant.ts @@ -463,3 +463,14 @@ export const TEAM_CREATION_DETAILS = { name: `0%team-name-${uuid()}`, teamType: 'Group', }; + +export const GLOSSARY_DETAILS = { + name: `0%glossary-${uuid()}`, + description: 'glossary description', +}; + +export const GLOSSARY_TERM_DETAILS = { + name: `0%glossary-term-${uuid()}`, + glossary: GLOSSARY_DETAILS.name, + description: 'glossary term description', +}; diff --git a/openmetadata-ui/src/main/resources/ui/cypress/e2e/Flow/ObservabilityAlerts.spec.ts b/openmetadata-ui/src/main/resources/ui/cypress/e2e/Flow/ObservabilityAlerts.spec.ts index a2a2970e375..ea44849a518 100644 --- a/openmetadata-ui/src/main/resources/ui/cypress/e2e/Flow/ObservabilityAlerts.spec.ts +++ b/openmetadata-ui/src/main/resources/ui/cypress/e2e/Flow/ObservabilityAlerts.spec.ts @@ -423,7 +423,7 @@ describe( // Check if option is selected cy.get( - `[title="${filter.inputValue}"] .ant-select-item-option-state` + `[data-testid="${filter.inputSelector}"] [title="${filter.inputValue}"]` ).should('exist'); if (filter.exclude) { diff --git a/openmetadata-ui/src/main/resources/ui/src/utils/ObservabilityUtils.tsx b/openmetadata-ui/src/main/resources/ui/src/utils/ObservabilityUtils.tsx index df58fce7619..df50553b462 100644 --- a/openmetadata-ui/src/main/resources/ui/src/utils/ObservabilityUtils.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/utils/ObservabilityUtils.tsx @@ -16,11 +16,15 @@ import React from 'react'; import { ReactComponent as AdminIcon } from '../assets/svg/admin-colored-icon.svg'; import { ReactComponent as GChatIcon } from '../assets/svg/gchat.svg'; import { ReactComponent as MentionIcon } from '../assets/svg/ic-mentions.svg'; +import { ReactComponent as FollowingIcon } from '../assets/svg/ic-star.svg'; import { ReactComponent as MSTeamsIcon } from '../assets/svg/ms-teams.svg'; import { ReactComponent as SlackIcon } from '../assets/svg/slack.svg'; import { ReactComponent as TeamIcon } from '../assets/svg/team-colored-icon.svg'; import { ReactComponent as UserIcon } from '../assets/svg/user-colored-icon.svg'; -import { ReactComponent as AssigneeIcon } from '../assets/svg/user.svg'; +import { + ReactComponent as AssigneeIcon, + ReactComponent as OwnerIcon, +} from '../assets/svg/user.svg'; import { ReactComponent as GenericIcon } from '../assets/svg/webhook.svg'; import { SubscriptionCategory } from '../generated/events/eventSubscription'; @@ -60,15 +64,25 @@ export const getAlertDestinationCategoryIcons = (type: string) => { Icon = MailOutlined; break; + case 'MsTeams': - case 'Followers': Icon = MSTeamsIcon; break; + + case 'Followers': + Icon = FollowingIcon; + + break; + case 'Webhook': - case 'Owners': Icon = GenericIcon; + break; + + case 'Owners': + Icon = OwnerIcon; + break; }