mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-09-27 18:05:00 +00:00
cypress: fixed failing cypress tests of main (#12126)
* cypress: fixed failing cypress test in main * fixed delete and restore not working in other than table assets
This commit is contained in:
parent
881a63e5b4
commit
9c2d21d496
@ -80,7 +80,7 @@ describe('Add nested teams and test TeamsSelectable', () => {
|
|||||||
cy.get('[data-testid="add-user"]').should('be.visible').click();
|
cy.get('[data-testid="add-user"]').should('be.visible').click();
|
||||||
|
|
||||||
// Enter team name
|
// Enter team name
|
||||||
cy.get('#create-user-bot-form .ant-select-selector')
|
cy.get('[data-testid="team-select"] .ant-select-selector')
|
||||||
.should('exist')
|
.should('exist')
|
||||||
.scrollIntoView()
|
.scrollIntoView()
|
||||||
.should('be.visible')
|
.should('be.visible')
|
||||||
@ -94,7 +94,7 @@ describe('Add nested teams and test TeamsSelectable', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
teamNames.forEach((teamName) => {
|
teamNames.forEach((teamName) => {
|
||||||
cy.get('#create-user-bot-form .ant-select-selector')
|
cy.get('[data-testid="team-select"] .ant-select-selector')
|
||||||
.should('exist')
|
.should('exist')
|
||||||
.scrollIntoView()
|
.scrollIntoView()
|
||||||
.should('be.visible')
|
.should('be.visible')
|
||||||
|
@ -106,15 +106,15 @@ describe('Test Add role and assign it to the user', () => {
|
|||||||
.click();
|
.click();
|
||||||
verifyResponseStatusCode('@generatePassword', 200);
|
verifyResponseStatusCode('@generatePassword', 200);
|
||||||
|
|
||||||
cy.get(`[id="menu-button-Roles"]`)
|
cy.get(`[data-testid="roles-dropdown"]`)
|
||||||
.should('exist')
|
|
||||||
.should('be.visible')
|
|
||||||
.click();
|
|
||||||
|
|
||||||
cy.get(`[data-testid="${roleName}"]`)
|
|
||||||
.scrollIntoView()
|
.scrollIntoView()
|
||||||
.should('be.visible')
|
.should('be.visible');
|
||||||
.click();
|
|
||||||
|
cy.get(`[data-testid="roles-dropdown"]`).click();
|
||||||
|
|
||||||
|
cy.get(`[title="${roleName}"]`).scrollIntoView().should('be.visible');
|
||||||
|
|
||||||
|
cy.get(`[title="${roleName}"]`).click();
|
||||||
|
|
||||||
cy.get('[data-testid="roles-dropdown"]').click();
|
cy.get('[data-testid="roles-dropdown"]').click();
|
||||||
cy.get('[data-testid="save-user"]').scrollIntoView().click();
|
cy.get('[data-testid="save-user"]').scrollIntoView().click();
|
||||||
|
@ -252,10 +252,7 @@ const updateTags = (inTerm) => {
|
|||||||
.scrollIntoView()
|
.scrollIntoView()
|
||||||
.should('be.visible')
|
.should('be.visible')
|
||||||
.type('personal');
|
.type('personal');
|
||||||
cy.get('.ant-select-item-option-content')
|
cy.get('[role="tree"] [title="Personal"]').click();
|
||||||
.contains('Personal')
|
|
||||||
.should('be.visible')
|
|
||||||
.click();
|
|
||||||
// to close popup
|
// to close popup
|
||||||
cy.clickOutside();
|
cy.clickOutside();
|
||||||
|
|
||||||
@ -492,7 +489,7 @@ describe('Glossary page should work properly', () => {
|
|||||||
|
|
||||||
it('Verify and Remove Tags from Glossary', () => {
|
it('Verify and Remove Tags from Glossary', () => {
|
||||||
// Verify Tags which is added at the time of creating glossary
|
// Verify Tags which is added at the time of creating glossary
|
||||||
cy.get('[data-testid="tag-container"]')
|
cy.get('[data-testid="tags-container"]')
|
||||||
.contains('Personal')
|
.contains('Personal')
|
||||||
.should('be.visible');
|
.should('be.visible');
|
||||||
|
|
||||||
|
@ -398,7 +398,7 @@ describe('Tags page should work', () => {
|
|||||||
cy.get('@count')
|
cy.get('@count')
|
||||||
.invoke('text')
|
.invoke('text')
|
||||||
.then((text) => {
|
.then((text) => {
|
||||||
expect(text).to.equal('2');
|
expect(text).to.equal('1');
|
||||||
});
|
});
|
||||||
|
|
||||||
interceptURL(
|
interceptURL(
|
||||||
|
@ -526,7 +526,7 @@ export const DataAssetsHeader = ({
|
|||||||
entityFQN={dataAsset.fullyQualifiedName}
|
entityFQN={dataAsset.fullyQualifiedName}
|
||||||
entityId={dataAsset.id}
|
entityId={dataAsset.id}
|
||||||
entityName={entityName}
|
entityName={entityName}
|
||||||
entityType={EntityType.TABLE}
|
entityType={entityType}
|
||||||
onAnnouncementClick={
|
onAnnouncementClick={
|
||||||
permissions?.EditAll
|
permissions?.EditAll
|
||||||
? () => setIsAnnouncementDrawer(true)
|
? () => setIsAnnouncementDrawer(true)
|
||||||
|
@ -91,6 +91,7 @@ const TeamsSelectable = ({
|
|||||||
multiple
|
multiple
|
||||||
showSearch
|
showSearch
|
||||||
treeDefaultExpandAll
|
treeDefaultExpandAll
|
||||||
|
data-testid="team-select"
|
||||||
dropdownStyle={{ maxHeight: 300, overflow: 'auto' }}
|
dropdownStyle={{ maxHeight: 300, overflow: 'auto' }}
|
||||||
placeholder={placeholder}
|
placeholder={placeholder}
|
||||||
showCheckedStrategy={TreeSelect.SHOW_CHILD}
|
showCheckedStrategy={TreeSelect.SHOW_CHILD}
|
||||||
|
@ -20,6 +20,7 @@ import ActivityThreadPanel from 'components/ActivityFeed/ActivityThreadPanel/Act
|
|||||||
import { CustomPropertyTable } from 'components/common/CustomPropertyTable/CustomPropertyTable';
|
import { CustomPropertyTable } from 'components/common/CustomPropertyTable/CustomPropertyTable';
|
||||||
import { CustomPropertyProps } from 'components/common/CustomPropertyTable/CustomPropertyTable.interface';
|
import { CustomPropertyProps } from 'components/common/CustomPropertyTable/CustomPropertyTable.interface';
|
||||||
import DescriptionV1 from 'components/common/description/DescriptionV1';
|
import DescriptionV1 from 'components/common/description/DescriptionV1';
|
||||||
|
import ErrorPlaceHolder from 'components/common/error-with-placeholder/ErrorPlaceHolder';
|
||||||
import PageLayoutV1 from 'components/containers/PageLayoutV1';
|
import PageLayoutV1 from 'components/containers/PageLayoutV1';
|
||||||
import { DataAssetsHeader } from 'components/DataAssets/DataAssetsHeader/DataAssetsHeader.component';
|
import { DataAssetsHeader } from 'components/DataAssets/DataAssetsHeader/DataAssetsHeader.component';
|
||||||
import DbtTab from 'components/DatasetDetails/DbtTab/DbtTab.component';
|
import DbtTab from 'components/DatasetDetails/DbtTab/DbtTab.component';
|
||||||
@ -37,11 +38,10 @@ import TableProfilerV1 from 'components/TableProfiler/TableProfilerV1';
|
|||||||
import TableQueries from 'components/TableQueries/TableQueries';
|
import TableQueries from 'components/TableQueries/TableQueries';
|
||||||
import TabsLabel from 'components/TabsLabel/TabsLabel.component';
|
import TabsLabel from 'components/TabsLabel/TabsLabel.component';
|
||||||
import TagsContainerV1 from 'components/Tag/TagsContainerV1/TagsContainerV1';
|
import TagsContainerV1 from 'components/Tag/TagsContainerV1/TagsContainerV1';
|
||||||
import { FQN_SEPARATOR_CHAR, WILD_CARD_CHAR } from 'constants/char.constants';
|
import { FQN_SEPARATOR_CHAR } from 'constants/char.constants';
|
||||||
import { getTableTabPath, getVersionPath, ROUTES } from 'constants/constants';
|
import { getTableTabPath, getVersionPath, ROUTES } from 'constants/constants';
|
||||||
import { EntityField } from 'constants/Feeds.constants';
|
import { EntityField } from 'constants/Feeds.constants';
|
||||||
import { EntityTabs, EntityType, FqnPart } from 'enums/entity.enum';
|
import { EntityTabs, EntityType, FqnPart } from 'enums/entity.enum';
|
||||||
import { SearchIndex } from 'enums/search.enum';
|
|
||||||
import { compare } from 'fast-json-patch';
|
import { compare } from 'fast-json-patch';
|
||||||
import { CreateThread } from 'generated/api/feed/createThread';
|
import { CreateThread } from 'generated/api/feed/createThread';
|
||||||
import { JoinedWith, Table } from 'generated/entity/data/table';
|
import { JoinedWith, Table } from 'generated/entity/data/table';
|
||||||
@ -54,7 +54,7 @@ import React, { useCallback, useEffect, useMemo, useState } from 'react';
|
|||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { useHistory, useParams } from 'react-router-dom';
|
import { useHistory, useParams } from 'react-router-dom';
|
||||||
import { postThread } from 'rest/feedsAPI';
|
import { postThread } from 'rest/feedsAPI';
|
||||||
import { searchQuery } from 'rest/searchAPI';
|
import { getQueriesList } from 'rest/queryAPI';
|
||||||
import {
|
import {
|
||||||
addFollower,
|
addFollower,
|
||||||
getTableDetailsByFQN,
|
getTableDetailsByFQN,
|
||||||
@ -74,7 +74,6 @@ import { defaultFields } from 'utils/DatasetDetailsUtils';
|
|||||||
import { getEntityName, getEntityThreadLink } from 'utils/EntityUtils';
|
import { getEntityName, getEntityThreadLink } from 'utils/EntityUtils';
|
||||||
import { getEntityFieldThreadCounts } from 'utils/FeedUtils';
|
import { getEntityFieldThreadCounts } from 'utils/FeedUtils';
|
||||||
import { DEFAULT_ENTITY_PERMISSION } from 'utils/PermissionsUtils';
|
import { DEFAULT_ENTITY_PERMISSION } from 'utils/PermissionsUtils';
|
||||||
import { createQueryFilter } from 'utils/Query/QueryUtils';
|
|
||||||
import { getTagsWithoutTier, getTierTags } from 'utils/TableUtils';
|
import { getTagsWithoutTier, getTierTags } from 'utils/TableUtils';
|
||||||
import { showErrorToast, showSuccessToast } from 'utils/ToastUtils';
|
import { showErrorToast, showSuccessToast } from 'utils/ToastUtils';
|
||||||
import { FrequentlyJoinedTables } from './FrequentlyJoinedTables/FrequentlyJoinedTables.component';
|
import { FrequentlyJoinedTables } from './FrequentlyJoinedTables/FrequentlyJoinedTables.component';
|
||||||
@ -121,17 +120,11 @@ const TableDetailsPageV1 = () => {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
const response = await searchQuery({
|
const response = await getQueriesList({
|
||||||
query: WILD_CARD_CHAR,
|
limit: 0,
|
||||||
pageNumber: 0,
|
entityId: tableDetails.id,
|
||||||
pageSize: 0,
|
|
||||||
queryFilter: createQueryFilter([], tableDetails.id),
|
|
||||||
searchIndex: SearchIndex.QUERY,
|
|
||||||
includeDeleted: false,
|
|
||||||
trackTotalHits: true,
|
|
||||||
fetchSource: false,
|
|
||||||
});
|
});
|
||||||
setQueryCount(response.hits.total.value);
|
setQueryCount(response.paging.total);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
setQueryCount(0);
|
setQueryCount(0);
|
||||||
}
|
}
|
||||||
@ -790,10 +783,14 @@ const TableDetailsPageV1 = () => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
if (loading || !tableDetails) {
|
if (loading) {
|
||||||
return <Loader />;
|
return <Loader />;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!tableDetails) {
|
||||||
|
return <ErrorPlaceHolder className="m-0" />;
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<PageLayoutV1
|
<PageLayoutV1
|
||||||
className="bg-white"
|
className="bg-white"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user