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:
Shailesh Parmar 2023-06-23 21:42:05 +05:30 committed by GitHub
parent 881a63e5b4
commit 9c2d21d496
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 27 additions and 32 deletions

View File

@ -80,7 +80,7 @@ describe('Add nested teams and test TeamsSelectable', () => {
cy.get('[data-testid="add-user"]').should('be.visible').click();
// Enter team name
cy.get('#create-user-bot-form .ant-select-selector')
cy.get('[data-testid="team-select"] .ant-select-selector')
.should('exist')
.scrollIntoView()
.should('be.visible')
@ -94,7 +94,7 @@ describe('Add nested teams and test TeamsSelectable', () => {
});
teamNames.forEach((teamName) => {
cy.get('#create-user-bot-form .ant-select-selector')
cy.get('[data-testid="team-select"] .ant-select-selector')
.should('exist')
.scrollIntoView()
.should('be.visible')

View File

@ -106,15 +106,15 @@ describe('Test Add role and assign it to the user', () => {
.click();
verifyResponseStatusCode('@generatePassword', 200);
cy.get(`[id="menu-button-Roles"]`)
.should('exist')
.should('be.visible')
.click();
cy.get(`[data-testid="${roleName}"]`)
cy.get(`[data-testid="roles-dropdown"]`)
.scrollIntoView()
.should('be.visible')
.click();
.should('be.visible');
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="save-user"]').scrollIntoView().click();

View File

@ -252,10 +252,7 @@ const updateTags = (inTerm) => {
.scrollIntoView()
.should('be.visible')
.type('personal');
cy.get('.ant-select-item-option-content')
.contains('Personal')
.should('be.visible')
.click();
cy.get('[role="tree"] [title="Personal"]').click();
// to close popup
cy.clickOutside();
@ -492,7 +489,7 @@ describe('Glossary page should work properly', () => {
it('Verify and Remove Tags from 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')
.should('be.visible');

View File

@ -398,7 +398,7 @@ describe('Tags page should work', () => {
cy.get('@count')
.invoke('text')
.then((text) => {
expect(text).to.equal('2');
expect(text).to.equal('1');
});
interceptURL(

View File

@ -526,7 +526,7 @@ export const DataAssetsHeader = ({
entityFQN={dataAsset.fullyQualifiedName}
entityId={dataAsset.id}
entityName={entityName}
entityType={EntityType.TABLE}
entityType={entityType}
onAnnouncementClick={
permissions?.EditAll
? () => setIsAnnouncementDrawer(true)

View File

@ -91,6 +91,7 @@ const TeamsSelectable = ({
multiple
showSearch
treeDefaultExpandAll
data-testid="team-select"
dropdownStyle={{ maxHeight: 300, overflow: 'auto' }}
placeholder={placeholder}
showCheckedStrategy={TreeSelect.SHOW_CHILD}

View File

@ -20,6 +20,7 @@ import ActivityThreadPanel from 'components/ActivityFeed/ActivityThreadPanel/Act
import { CustomPropertyTable } from 'components/common/CustomPropertyTable/CustomPropertyTable';
import { CustomPropertyProps } from 'components/common/CustomPropertyTable/CustomPropertyTable.interface';
import DescriptionV1 from 'components/common/description/DescriptionV1';
import ErrorPlaceHolder from 'components/common/error-with-placeholder/ErrorPlaceHolder';
import PageLayoutV1 from 'components/containers/PageLayoutV1';
import { DataAssetsHeader } from 'components/DataAssets/DataAssetsHeader/DataAssetsHeader.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 TabsLabel from 'components/TabsLabel/TabsLabel.component';
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 { EntityField } from 'constants/Feeds.constants';
import { EntityTabs, EntityType, FqnPart } from 'enums/entity.enum';
import { SearchIndex } from 'enums/search.enum';
import { compare } from 'fast-json-patch';
import { CreateThread } from 'generated/api/feed/createThread';
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 { useHistory, useParams } from 'react-router-dom';
import { postThread } from 'rest/feedsAPI';
import { searchQuery } from 'rest/searchAPI';
import { getQueriesList } from 'rest/queryAPI';
import {
addFollower,
getTableDetailsByFQN,
@ -74,7 +74,6 @@ import { defaultFields } from 'utils/DatasetDetailsUtils';
import { getEntityName, getEntityThreadLink } from 'utils/EntityUtils';
import { getEntityFieldThreadCounts } from 'utils/FeedUtils';
import { DEFAULT_ENTITY_PERMISSION } from 'utils/PermissionsUtils';
import { createQueryFilter } from 'utils/Query/QueryUtils';
import { getTagsWithoutTier, getTierTags } from 'utils/TableUtils';
import { showErrorToast, showSuccessToast } from 'utils/ToastUtils';
import { FrequentlyJoinedTables } from './FrequentlyJoinedTables/FrequentlyJoinedTables.component';
@ -121,17 +120,11 @@ const TableDetailsPageV1 = () => {
return;
}
try {
const response = await searchQuery({
query: WILD_CARD_CHAR,
pageNumber: 0,
pageSize: 0,
queryFilter: createQueryFilter([], tableDetails.id),
searchIndex: SearchIndex.QUERY,
includeDeleted: false,
trackTotalHits: true,
fetchSource: false,
const response = await getQueriesList({
limit: 0,
entityId: tableDetails.id,
});
setQueryCount(response.hits.total.value);
setQueryCount(response.paging.total);
} catch (error) {
setQueryCount(0);
}
@ -790,10 +783,14 @@ const TableDetailsPageV1 = () => {
}
};
if (loading || !tableDetails) {
if (loading) {
return <Loader />;
}
if (!tableDetails) {
return <ErrorPlaceHolder className="m-0" />;
}
return (
<PageLayoutV1
className="bg-white"