diff --git a/openmetadata-ui/src/main/resources/ui/cypress/e2e/Flow/Explore.spec.ts b/openmetadata-ui/src/main/resources/ui/cypress/e2e/Flow/Explore.spec.ts deleted file mode 100644 index 20e5ed6f6f0..00000000000 --- a/openmetadata-ui/src/main/resources/ui/cypress/e2e/Flow/Explore.spec.ts +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright 2024 Collate. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { interceptURL, verifyResponseStatusCode } from '../../common/common'; -import { SidebarItem } from '../../constants/Entity.interface'; - -describe.skip('Explore Page', { tags: 'DataAssets' }, () => { - before(() => { - cy.login(); - }); - - it('should verify order of search results', () => { - const searchText = 'customer'; - interceptURL( - 'GET', - `api/v1/search/query?q=**&index=dataAsset**`, - 'suggestAPI' - ); - - interceptURL( - 'GET', - `api/v1/search/query?q=**&index=table_search_index**`, - 'searchAPI' - ); - - cy.sidebarClick(SidebarItem.EXPLORE); - cy.get('[data-testid="searchBox"]').clear(); - cy.get('[data-testid="searchBox"]').type(searchText); - - verifyResponseStatusCode('@suggestAPI', 200); - - const linksArray = []; - cy.get('[data-testid="group-table_search_index"] button a').each( - ($link) => { - linksArray.push($link.attr('href')); - } - ); - - cy.get('[data-testid="searchBox"]').type('{enter}'); - verifyResponseStatusCode('@searchAPI', 200); - - cy.wrap(linksArray).each((link, index) => { - cy.get(`[data-testid="entity-link"]`) - .eq(index) - .should('have.attr', 'href', link); - }); - }); -}); diff --git a/openmetadata-ui/src/main/resources/ui/playwright/e2e/Flow/AddRoleAndAssignToUser.spec.ts b/openmetadata-ui/src/main/resources/ui/playwright/e2e/Flow/AddRoleAndAssignToUser.spec.ts index bf6b6e04211..17eb412ac46 100644 --- a/openmetadata-ui/src/main/resources/ui/playwright/e2e/Flow/AddRoleAndAssignToUser.spec.ts +++ b/openmetadata-ui/src/main/resources/ui/playwright/e2e/Flow/AddRoleAndAssignToUser.spec.ts @@ -22,6 +22,7 @@ import { uuid, } from '../../utils/common'; import { settingClick } from '../../utils/sidebar'; +import { visitUserProfilePage } from '../../utils/user'; const roleName = `Role-test-${uuid()}`; const user = generateRandomUsername(); @@ -29,7 +30,7 @@ const userDisplayName = user.firstName + ' ' + user.lastName; const userName = user.email.split('@')[0].toLowerCase(); // use the admin user to login -test.use({ storageState: 'playwright/.auth/admin.json', trace: 'off' }); +test.use({ storageState: 'playwright/.auth/admin.json' }); test.describe.serial('Add role and assign it to the user', () => { test.beforeEach(async ({ page }) => { @@ -47,6 +48,7 @@ test.describe.serial('Add role and assign it to the user', () => { test('Create role', async ({ page }) => { await settingClick(page, GlobalSettingOptions.ROLES); + await page.waitForLoadState('networkidle'); await page.click('[data-testid="add-role"]'); @@ -79,12 +81,18 @@ test.describe.serial('Add role and assign it to the user', () => { test('Create new user and assign new role to him', async ({ page }) => { await settingClick(page, GlobalSettingOptions.USERS); + await page.waitForLoadState('networkidle'); + await page.click('[data-testid="add-user"]'); await page.fill('[data-testid="email"]', user.email); await page.fill('[data-testid="displayName"]', userDisplayName); await page.fill(descriptionBox, 'Adding user'); + const generatePasswordResponse = page.waitForResponse( + `/api/v1/users/generateRandomPwd` + ); await page.click('[data-testid="password-generator"]'); + await generatePasswordResponse; await page.click('[data-testid="roles-dropdown"]'); await page.fill('#roles', roleName); @@ -98,26 +106,15 @@ test.describe.serial('Add role and assign it to the user', () => { }); test('Verify assigned role to new user', async ({ page }) => { - await settingClick(page, GlobalSettingOptions.USERS); + await visitUserProfilePage(page, userName); - const searchUser = page.waitForResponse( - `/api/v1/search/query?q=*${encodeURIComponent(userDisplayName)}*` - ); - await page.waitForSelector('[data-testid="searchbar"]'); - await page.fill('[data-testid="searchbar"]', userDisplayName); - - await searchUser; - await page.waitForSelector(`[data-testid="${userName}"]`); - await page.click(`[data-testid="${userName}"]`); await page.waitForSelector('[data-testid="user-profile"]'); await page.click( '[data-testid="user-profile"] .ant-collapse-expand-icon > .anticon' ); - expect( - await page.textContent( - '[data-testid="user-profile"] [data-testid="user-profile-roles"]' - ) - ).toContain(roleName); + await expect( + page.getByTestId('user-profile').getByTestId('user-profile-roles') + ).toContainText(roleName); }); }); diff --git a/openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/Entity.spec.ts b/openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/Entity.spec.ts index 0808bdc99c1..a65e251a496 100644 --- a/openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/Entity.spec.ts +++ b/openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/Entity.spec.ts @@ -133,6 +133,8 @@ entities.forEach((EntityClass) => { }); test('User as Owner with unsorted list', async ({ page }) => { + test.slow(true); + const { afterAction, apiContext } = await getApiContext(page); const owner1Data = generateRandomUsername('PW_A_'); const owner2Data = generateRandomUsername('PW_B_'); diff --git a/openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/TestCases.spec.ts b/openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/TestCases.spec.ts index 79030666d1e..948bd99b927 100644 --- a/openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/TestCases.spec.ts +++ b/openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/TestCases.spec.ts @@ -54,14 +54,15 @@ test('Table difference test case', async ({ page }) => { await page.getByTestId('test-case-name').fill(testCase.name); await page.getByTestId('test-type').click(); await page.getByTitle('Compare 2 tables for').click(); - const tableSearchResponse = page.waitForResponse( - `/api/v1/search/query?q=*${encodeURIComponent( - testCase.table2 - )}*index=table_search_index*` - ); await page.click('#tableTestForm_params_table2'); + const tableSearchResponse = page.waitForResponse( + `/api/v1/search/query?q=*index=table_search_index*` + ); await page.fill(`#tableTestForm_params_table2`, testCase.table2); await tableSearchResponse; + // The 'networkidle' parameter tells Playwright to wait until there are no network connections + // for at least 500 ms. + await page.waitForLoadState('networkidle'); await page .getByTitle(table2.entityResponseData?.['fullyQualifiedName']) .click(); diff --git a/openmetadata-ui/src/main/resources/ui/playwright/utils/lineage.ts b/openmetadata-ui/src/main/resources/ui/playwright/utils/lineage.ts index bd98c694e2b..13523fe2f53 100644 --- a/openmetadata-ui/src/main/resources/ui/playwright/utils/lineage.ts +++ b/openmetadata-ui/src/main/resources/ui/playwright/utils/lineage.ts @@ -173,7 +173,6 @@ export const setupEntitiesForLineage = async ( for (const entity of entities) { await entity.create(apiContext); } - await currentEntity.create(apiContext); const cleanup = async () => { diff --git a/openmetadata-ui/src/main/resources/ui/src/components/Domain/DomainTabs/DocumentationTab/DocumentationTab.component.tsx b/openmetadata-ui/src/main/resources/ui/src/components/Domain/DomainTabs/DocumentationTab/DocumentationTab.component.tsx index feabcdd0289..dedea541f7c 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/Domain/DomainTabs/DocumentationTab/DocumentationTab.component.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/Domain/DomainTabs/DocumentationTab/DocumentationTab.component.tsx @@ -178,6 +178,7 @@ const DocumentationTab = ({ children: (
= ({ JSON.stringify(combinedQueryFilter) ), key === TIER_FQN_KEY - ? getTags({ parent: 'Tier' }) + ? getTags({ parent: 'Tier', limit: 50 }) : Promise.resolve(null), ]); diff --git a/openmetadata-ui/src/main/resources/ui/src/components/Glossary/GlossaryDetails/GlossaryDetails.component.tsx b/openmetadata-ui/src/main/resources/ui/src/components/Glossary/GlossaryDetails/GlossaryDetails.component.tsx index fd2e290be3d..6f3ede3e481 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/Glossary/GlossaryDetails/GlossaryDetails.component.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/Glossary/GlossaryDetails/GlossaryDetails.component.tsx @@ -12,6 +12,7 @@ */ import { Col, Row, Space, Tabs } from 'antd'; +import classNames from 'classnames'; import { isEmpty, noop } from 'lodash'; import React, { useCallback, useEffect, useMemo, useState } from 'react'; import { useTranslation } from 'react-i18next'; @@ -271,7 +272,11 @@ const GlossaryDetails = ({ className="glossary-details" data-testid="glossary-details" gutter={[0, 16]}> - +
- {createButtons} + {!isVersionView && createButtons} {updateVote && ( diff --git a/openmetadata-ui/src/main/resources/ui/src/utils/AdvancedSearchUtils.tsx b/openmetadata-ui/src/main/resources/ui/src/utils/AdvancedSearchUtils.tsx index 565a32253dd..05bcdea6cf1 100644 --- a/openmetadata-ui/src/main/resources/ui/src/utils/AdvancedSearchUtils.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/utils/AdvancedSearchUtils.tsx @@ -417,6 +417,7 @@ export const getTierOptions: () => Promise = async () => { try { const { data: tiers } = await getTags({ parent: 'Tier', + limit: 50, }); const tierFields = tiers.map((tier) => ({