Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

784 lines
23 KiB
TypeScript
Raw Normal View History

/*
* 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 test, { APIRequestContext, expect, Page } from '@playwright/test';
[RbacDomain] RBAC with Domain Restrictions (#16586) * Add domain field to entity jsons * add subdomains ui * Add Domain To create Request * Typo fix * commit progress * allow multiple domains * - add userDomains and teamDomains * - Restrict Api Access * allow multiple domain support * - Add Listing Restricition - Add Search Restrictions * - Field Fix * - Inherit Team Domains * remove glossary filter from ui * - Fix Tag and User Filter * - Id -> FQN in create * - Missing domain on indexes * add domain in creation of team, user and glossary * fix merge conflicts * fix feedbacks * fix tests * add domain playwright * minor changes * fix domain fetching calls * Add Thread Listing with EntityDomain * Fixes for Team Join * Mkae list mutable * Add missing import * Fix Team Test * User Test case fix * Fix User Domain * Minor bug fixes related to sub domains * Fix data retaining in add sub domain modal after closing * fix NavBar unit test * Make Domain Access Work Via Policies * Fix errors introduced after conflict resolutions * update render function in SubDomainsTable.component.tsx to accept an array of owners instead of a single owner * fix java checkstyle * fix py-test * format * Fix the domain e2e owner field type * Fix Failing Tests * fixed pytest list index * update userDomains and teamDomains to domains * Entity Domain to Domain for thread and changeEvent * FIx fields * @Ovveride * FIx * Remove Duplicate Field * Remove Duplicate Field * Fix Failing Test * fix domain related changes * fix subdomains loader * Fix Owners Order * Enforce Domain Permissions * fix domain cleanup * Fix Test * rever owner change --------- Co-authored-by: karanh37 <karanh37@gmail.com> Co-authored-by: Aniket Katkar <aniketkatkar97@gmail.com> Co-authored-by: Pere Miquel Brull <peremiquelbrull@gmail.com> Co-authored-by: sonikashah <sonikashah94@gmail.com> Co-authored-by: Sriharsha Chintalapani <harshach@users.noreply.github.com> Co-authored-by: Onkar Ravgan <onkar.10r@gmail.com> Co-authored-by: Karan Hotchandani <33024356+karanh37@users.noreply.github.com>
2024-08-02 10:16:14 +05:30
import { get, isEmpty, isUndefined } from 'lodash';
import { SidebarItem } from '../constant/sidebar';
import { PolicyClass } from '../support/access-control/PoliciesClass';
import { RolesClass } from '../support/access-control/RolesClass';
[RbacDomain] RBAC with Domain Restrictions (#16586) * Add domain field to entity jsons * add subdomains ui * Add Domain To create Request * Typo fix * commit progress * allow multiple domains * - add userDomains and teamDomains * - Restrict Api Access * allow multiple domain support * - Add Listing Restricition - Add Search Restrictions * - Field Fix * - Inherit Team Domains * remove glossary filter from ui * - Fix Tag and User Filter * - Id -> FQN in create * - Missing domain on indexes * add domain in creation of team, user and glossary * fix merge conflicts * fix feedbacks * fix tests * add domain playwright * minor changes * fix domain fetching calls * Add Thread Listing with EntityDomain * Fixes for Team Join * Mkae list mutable * Add missing import * Fix Team Test * User Test case fix * Fix User Domain * Minor bug fixes related to sub domains * Fix data retaining in add sub domain modal after closing * fix NavBar unit test * Make Domain Access Work Via Policies * Fix errors introduced after conflict resolutions * update render function in SubDomainsTable.component.tsx to accept an array of owners instead of a single owner * fix java checkstyle * fix py-test * format * Fix the domain e2e owner field type * Fix Failing Tests * fixed pytest list index * update userDomains and teamDomains to domains * Entity Domain to Domain for thread and changeEvent * FIx fields * @Ovveride * FIx * Remove Duplicate Field * Remove Duplicate Field * Fix Failing Test * fix domain related changes * fix subdomains loader * Fix Owners Order * Enforce Domain Permissions * fix domain cleanup * Fix Test * rever owner change --------- Co-authored-by: karanh37 <karanh37@gmail.com> Co-authored-by: Aniket Katkar <aniketkatkar97@gmail.com> Co-authored-by: Pere Miquel Brull <peremiquelbrull@gmail.com> Co-authored-by: sonikashah <sonikashah94@gmail.com> Co-authored-by: Sriharsha Chintalapani <harshach@users.noreply.github.com> Co-authored-by: Onkar Ravgan <onkar.10r@gmail.com> Co-authored-by: Karan Hotchandani <33024356+karanh37@users.noreply.github.com>
2024-08-02 10:16:14 +05:30
import { DataProduct } from '../support/domain/DataProduct';
import { Domain } from '../support/domain/Domain';
import { SubDomain } from '../support/domain/SubDomain';
[RbacDomain] RBAC with Domain Restrictions (#16586) * Add domain field to entity jsons * add subdomains ui * Add Domain To create Request * Typo fix * commit progress * allow multiple domains * - add userDomains and teamDomains * - Restrict Api Access * allow multiple domain support * - Add Listing Restricition - Add Search Restrictions * - Field Fix * - Inherit Team Domains * remove glossary filter from ui * - Fix Tag and User Filter * - Id -> FQN in create * - Missing domain on indexes * add domain in creation of team, user and glossary * fix merge conflicts * fix feedbacks * fix tests * add domain playwright * minor changes * fix domain fetching calls * Add Thread Listing with EntityDomain * Fixes for Team Join * Mkae list mutable * Add missing import * Fix Team Test * User Test case fix * Fix User Domain * Minor bug fixes related to sub domains * Fix data retaining in add sub domain modal after closing * fix NavBar unit test * Make Domain Access Work Via Policies * Fix errors introduced after conflict resolutions * update render function in SubDomainsTable.component.tsx to accept an array of owners instead of a single owner * fix java checkstyle * fix py-test * format * Fix the domain e2e owner field type * Fix Failing Tests * fixed pytest list index * update userDomains and teamDomains to domains * Entity Domain to Domain for thread and changeEvent * FIx fields * @Ovveride * FIx * Remove Duplicate Field * Remove Duplicate Field * Fix Failing Test * fix domain related changes * fix subdomains loader * Fix Owners Order * Enforce Domain Permissions * fix domain cleanup * Fix Test * rever owner change --------- Co-authored-by: karanh37 <karanh37@gmail.com> Co-authored-by: Aniket Katkar <aniketkatkar97@gmail.com> Co-authored-by: Pere Miquel Brull <peremiquelbrull@gmail.com> Co-authored-by: sonikashah <sonikashah94@gmail.com> Co-authored-by: Sriharsha Chintalapani <harshach@users.noreply.github.com> Co-authored-by: Onkar Ravgan <onkar.10r@gmail.com> Co-authored-by: Karan Hotchandani <33024356+karanh37@users.noreply.github.com>
2024-08-02 10:16:14 +05:30
import { DashboardClass } from '../support/entity/DashboardClass';
import { EntityTypeEndpoint } from '../support/entity/Entity.interface';
import { EntityClass } from '../support/entity/EntityClass';
import { TableClass } from '../support/entity/TableClass';
import { TopicClass } from '../support/entity/TopicClass';
import { TeamClass } from '../support/team/TeamClass';
import { UserClass } from '../support/user/UserClass';
[RbacDomain] RBAC with Domain Restrictions (#16586) * Add domain field to entity jsons * add subdomains ui * Add Domain To create Request * Typo fix * commit progress * allow multiple domains * - add userDomains and teamDomains * - Restrict Api Access * allow multiple domain support * - Add Listing Restricition - Add Search Restrictions * - Field Fix * - Inherit Team Domains * remove glossary filter from ui * - Fix Tag and User Filter * - Id -> FQN in create * - Missing domain on indexes * add domain in creation of team, user and glossary * fix merge conflicts * fix feedbacks * fix tests * add domain playwright * minor changes * fix domain fetching calls * Add Thread Listing with EntityDomain * Fixes for Team Join * Mkae list mutable * Add missing import * Fix Team Test * User Test case fix * Fix User Domain * Minor bug fixes related to sub domains * Fix data retaining in add sub domain modal after closing * fix NavBar unit test * Make Domain Access Work Via Policies * Fix errors introduced after conflict resolutions * update render function in SubDomainsTable.component.tsx to accept an array of owners instead of a single owner * fix java checkstyle * fix py-test * format * Fix the domain e2e owner field type * Fix Failing Tests * fixed pytest list index * update userDomains and teamDomains to domains * Entity Domain to Domain for thread and changeEvent * FIx fields * @Ovveride * FIx * Remove Duplicate Field * Remove Duplicate Field * Fix Failing Test * fix domain related changes * fix subdomains loader * Fix Owners Order * Enforce Domain Permissions * fix domain cleanup * Fix Test * rever owner change --------- Co-authored-by: karanh37 <karanh37@gmail.com> Co-authored-by: Aniket Katkar <aniketkatkar97@gmail.com> Co-authored-by: Pere Miquel Brull <peremiquelbrull@gmail.com> Co-authored-by: sonikashah <sonikashah94@gmail.com> Co-authored-by: Sriharsha Chintalapani <harshach@users.noreply.github.com> Co-authored-by: Onkar Ravgan <onkar.10r@gmail.com> Co-authored-by: Karan Hotchandani <33024356+karanh37@users.noreply.github.com>
2024-08-02 10:16:14 +05:30
import {
closeFirstPopupAlert,
[RbacDomain] RBAC with Domain Restrictions (#16586) * Add domain field to entity jsons * add subdomains ui * Add Domain To create Request * Typo fix * commit progress * allow multiple domains * - add userDomains and teamDomains * - Restrict Api Access * allow multiple domain support * - Add Listing Restricition - Add Search Restrictions * - Field Fix * - Inherit Team Domains * remove glossary filter from ui * - Fix Tag and User Filter * - Id -> FQN in create * - Missing domain on indexes * add domain in creation of team, user and glossary * fix merge conflicts * fix feedbacks * fix tests * add domain playwright * minor changes * fix domain fetching calls * Add Thread Listing with EntityDomain * Fixes for Team Join * Mkae list mutable * Add missing import * Fix Team Test * User Test case fix * Fix User Domain * Minor bug fixes related to sub domains * Fix data retaining in add sub domain modal after closing * fix NavBar unit test * Make Domain Access Work Via Policies * Fix errors introduced after conflict resolutions * update render function in SubDomainsTable.component.tsx to accept an array of owners instead of a single owner * fix java checkstyle * fix py-test * format * Fix the domain e2e owner field type * Fix Failing Tests * fixed pytest list index * update userDomains and teamDomains to domains * Entity Domain to Domain for thread and changeEvent * FIx fields * @Ovveride * FIx * Remove Duplicate Field * Remove Duplicate Field * Fix Failing Test * fix domain related changes * fix subdomains loader * Fix Owners Order * Enforce Domain Permissions * fix domain cleanup * Fix Test * rever owner change --------- Co-authored-by: karanh37 <karanh37@gmail.com> Co-authored-by: Aniket Katkar <aniketkatkar97@gmail.com> Co-authored-by: Pere Miquel Brull <peremiquelbrull@gmail.com> Co-authored-by: sonikashah <sonikashah94@gmail.com> Co-authored-by: Sriharsha Chintalapani <harshach@users.noreply.github.com> Co-authored-by: Onkar Ravgan <onkar.10r@gmail.com> Co-authored-by: Karan Hotchandani <33024356+karanh37@users.noreply.github.com>
2024-08-02 10:16:14 +05:30
descriptionBox,
getApiContext,
INVALID_NAMES,
NAME_MAX_LENGTH_VALIDATION_ERROR,
NAME_VALIDATION_ERROR,
redirectToHomePage,
uuid,
[RbacDomain] RBAC with Domain Restrictions (#16586) * Add domain field to entity jsons * add subdomains ui * Add Domain To create Request * Typo fix * commit progress * allow multiple domains * - add userDomains and teamDomains * - Restrict Api Access * allow multiple domain support * - Add Listing Restricition - Add Search Restrictions * - Field Fix * - Inherit Team Domains * remove glossary filter from ui * - Fix Tag and User Filter * - Id -> FQN in create * - Missing domain on indexes * add domain in creation of team, user and glossary * fix merge conflicts * fix feedbacks * fix tests * add domain playwright * minor changes * fix domain fetching calls * Add Thread Listing with EntityDomain * Fixes for Team Join * Mkae list mutable * Add missing import * Fix Team Test * User Test case fix * Fix User Domain * Minor bug fixes related to sub domains * Fix data retaining in add sub domain modal after closing * fix NavBar unit test * Make Domain Access Work Via Policies * Fix errors introduced after conflict resolutions * update render function in SubDomainsTable.component.tsx to accept an array of owners instead of a single owner * fix java checkstyle * fix py-test * format * Fix the domain e2e owner field type * Fix Failing Tests * fixed pytest list index * update userDomains and teamDomains to domains * Entity Domain to Domain for thread and changeEvent * FIx fields * @Ovveride * FIx * Remove Duplicate Field * Remove Duplicate Field * Fix Failing Test * fix domain related changes * fix subdomains loader * Fix Owners Order * Enforce Domain Permissions * fix domain cleanup * Fix Test * rever owner change --------- Co-authored-by: karanh37 <karanh37@gmail.com> Co-authored-by: Aniket Katkar <aniketkatkar97@gmail.com> Co-authored-by: Pere Miquel Brull <peremiquelbrull@gmail.com> Co-authored-by: sonikashah <sonikashah94@gmail.com> Co-authored-by: Sriharsha Chintalapani <harshach@users.noreply.github.com> Co-authored-by: Onkar Ravgan <onkar.10r@gmail.com> Co-authored-by: Karan Hotchandani <33024356+karanh37@users.noreply.github.com>
2024-08-02 10:16:14 +05:30
} from './common';
import { addOwner } from './entity';
import { sidebarClick } from './sidebar';
export const assignDomain = async (page: Page, domain: Domain['data']) => {
await page.getByTestId('add-domain').click();
await page.waitForSelector('[data-testid="loader"]', { state: 'detached' });
const searchDomain = page.waitForResponse(
`/api/v1/search/query?q=*${encodeURIComponent(domain.name)}*`
);
await page
.getByTestId('selectable-list')
.getByTestId('searchbar')
.fill(domain.name);
await searchDomain;
await page.getByRole('listitem', { name: domain.displayName }).click();
await expect(page.getByTestId('domain-link')).toContainText(
domain.displayName
);
};
export const updateDomain = async (page: Page, domain: Domain['data']) => {
await page.getByTestId('add-domain').click();
await page.waitForSelector('[data-testid="loader"]', { state: 'detached' });
await page.getByTestId('selectable-list').getByTestId('searchbar').clear();
const searchDomain = page.waitForResponse(
`/api/v1/search/query?q=*${encodeURIComponent(domain.name)}*`
);
await page
.getByTestId('selectable-list')
.getByTestId('searchbar')
.fill(domain.name);
await searchDomain;
await page.getByRole('listitem', { name: domain.displayName }).click();
await expect(page.getByTestId('domain-link')).toContainText(
domain.displayName
);
};
export const removeDomain = async (page: Page) => {
await page.getByTestId('add-domain').click();
await page.waitForSelector('[data-testid="loader"]', { state: 'detached' });
await expect(page.getByTestId('remove-owner').locator('path')).toBeVisible();
await page.getByTestId('remove-owner').locator('svg').click();
await expect(page.getByTestId('no-domain-text')).toContainText('No Domain');
};
[RbacDomain] RBAC with Domain Restrictions (#16586) * Add domain field to entity jsons * add subdomains ui * Add Domain To create Request * Typo fix * commit progress * allow multiple domains * - add userDomains and teamDomains * - Restrict Api Access * allow multiple domain support * - Add Listing Restricition - Add Search Restrictions * - Field Fix * - Inherit Team Domains * remove glossary filter from ui * - Fix Tag and User Filter * - Id -> FQN in create * - Missing domain on indexes * add domain in creation of team, user and glossary * fix merge conflicts * fix feedbacks * fix tests * add domain playwright * minor changes * fix domain fetching calls * Add Thread Listing with EntityDomain * Fixes for Team Join * Mkae list mutable * Add missing import * Fix Team Test * User Test case fix * Fix User Domain * Minor bug fixes related to sub domains * Fix data retaining in add sub domain modal after closing * fix NavBar unit test * Make Domain Access Work Via Policies * Fix errors introduced after conflict resolutions * update render function in SubDomainsTable.component.tsx to accept an array of owners instead of a single owner * fix java checkstyle * fix py-test * format * Fix the domain e2e owner field type * Fix Failing Tests * fixed pytest list index * update userDomains and teamDomains to domains * Entity Domain to Domain for thread and changeEvent * FIx fields * @Ovveride * FIx * Remove Duplicate Field * Remove Duplicate Field * Fix Failing Test * fix domain related changes * fix subdomains loader * Fix Owners Order * Enforce Domain Permissions * fix domain cleanup * Fix Test * rever owner change --------- Co-authored-by: karanh37 <karanh37@gmail.com> Co-authored-by: Aniket Katkar <aniketkatkar97@gmail.com> Co-authored-by: Pere Miquel Brull <peremiquelbrull@gmail.com> Co-authored-by: sonikashah <sonikashah94@gmail.com> Co-authored-by: Sriharsha Chintalapani <harshach@users.noreply.github.com> Co-authored-by: Onkar Ravgan <onkar.10r@gmail.com> Co-authored-by: Karan Hotchandani <33024356+karanh37@users.noreply.github.com>
2024-08-02 10:16:14 +05:30
export const validateDomainForm = async (page: Page) => {
[RbacDomain] RBAC with Domain Restrictions (#16586) * Add domain field to entity jsons * add subdomains ui * Add Domain To create Request * Typo fix * commit progress * allow multiple domains * - add userDomains and teamDomains * - Restrict Api Access * allow multiple domain support * - Add Listing Restricition - Add Search Restrictions * - Field Fix * - Inherit Team Domains * remove glossary filter from ui * - Fix Tag and User Filter * - Id -> FQN in create * - Missing domain on indexes * add domain in creation of team, user and glossary * fix merge conflicts * fix feedbacks * fix tests * add domain playwright * minor changes * fix domain fetching calls * Add Thread Listing with EntityDomain * Fixes for Team Join * Mkae list mutable * Add missing import * Fix Team Test * User Test case fix * Fix User Domain * Minor bug fixes related to sub domains * Fix data retaining in add sub domain modal after closing * fix NavBar unit test * Make Domain Access Work Via Policies * Fix errors introduced after conflict resolutions * update render function in SubDomainsTable.component.tsx to accept an array of owners instead of a single owner * fix java checkstyle * fix py-test * format * Fix the domain e2e owner field type * Fix Failing Tests * fixed pytest list index * update userDomains and teamDomains to domains * Entity Domain to Domain for thread and changeEvent * FIx fields * @Ovveride * FIx * Remove Duplicate Field * Remove Duplicate Field * Fix Failing Test * fix domain related changes * fix subdomains loader * Fix Owners Order * Enforce Domain Permissions * fix domain cleanup * Fix Test * rever owner change --------- Co-authored-by: karanh37 <karanh37@gmail.com> Co-authored-by: Aniket Katkar <aniketkatkar97@gmail.com> Co-authored-by: Pere Miquel Brull <peremiquelbrull@gmail.com> Co-authored-by: sonikashah <sonikashah94@gmail.com> Co-authored-by: Sriharsha Chintalapani <harshach@users.noreply.github.com> Co-authored-by: Onkar Ravgan <onkar.10r@gmail.com> Co-authored-by: Karan Hotchandani <33024356+karanh37@users.noreply.github.com>
2024-08-02 10:16:14 +05:30
// Error messages
await expect(page.locator('#name_help')).toHaveText('Name is required');
await expect(page.locator('#description_help')).toHaveText(
'Description is required'
);
// Max length validation
await page.locator('[data-testid="name"]').type(INVALID_NAMES.MAX_LENGTH);
await expect(page.locator('#name_help')).toHaveText(
NAME_MAX_LENGTH_VALIDATION_ERROR
);
// With special char validation
await page.locator('[data-testid="name"]').clear();
await page
.locator('[data-testid="name"]')
.type(INVALID_NAMES.WITH_SPECIAL_CHARS);
await expect(page.locator('#name_help')).toHaveText(NAME_VALIDATION_ERROR);
};
export const selectDomain = async (page: Page, domain: Domain['data']) => {
await page
.getByRole('menuitem', { name: domain.displayName })
.locator('span')
.click();
2025-06-26 19:08:53 +05:30
await page.waitForLoadState('networkidle');
[RbacDomain] RBAC with Domain Restrictions (#16586) * Add domain field to entity jsons * add subdomains ui * Add Domain To create Request * Typo fix * commit progress * allow multiple domains * - add userDomains and teamDomains * - Restrict Api Access * allow multiple domain support * - Add Listing Restricition - Add Search Restrictions * - Field Fix * - Inherit Team Domains * remove glossary filter from ui * - Fix Tag and User Filter * - Id -> FQN in create * - Missing domain on indexes * add domain in creation of team, user and glossary * fix merge conflicts * fix feedbacks * fix tests * add domain playwright * minor changes * fix domain fetching calls * Add Thread Listing with EntityDomain * Fixes for Team Join * Mkae list mutable * Add missing import * Fix Team Test * User Test case fix * Fix User Domain * Minor bug fixes related to sub domains * Fix data retaining in add sub domain modal after closing * fix NavBar unit test * Make Domain Access Work Via Policies * Fix errors introduced after conflict resolutions * update render function in SubDomainsTable.component.tsx to accept an array of owners instead of a single owner * fix java checkstyle * fix py-test * format * Fix the domain e2e owner field type * Fix Failing Tests * fixed pytest list index * update userDomains and teamDomains to domains * Entity Domain to Domain for thread and changeEvent * FIx fields * @Ovveride * FIx * Remove Duplicate Field * Remove Duplicate Field * Fix Failing Test * fix domain related changes * fix subdomains loader * Fix Owners Order * Enforce Domain Permissions * fix domain cleanup * Fix Test * rever owner change --------- Co-authored-by: karanh37 <karanh37@gmail.com> Co-authored-by: Aniket Katkar <aniketkatkar97@gmail.com> Co-authored-by: Pere Miquel Brull <peremiquelbrull@gmail.com> Co-authored-by: sonikashah <sonikashah94@gmail.com> Co-authored-by: Sriharsha Chintalapani <harshach@users.noreply.github.com> Co-authored-by: Onkar Ravgan <onkar.10r@gmail.com> Co-authored-by: Karan Hotchandani <33024356+karanh37@users.noreply.github.com>
2024-08-02 10:16:14 +05:30
};
export const selectSubDomain = async (
page: Page,
domain: Domain['data'],
subDomain: SubDomain['data']
) => {
const menuItem = page.getByRole('menuitem', { name: domain.displayName });
const isSelected = await menuItem.evaluate((element) => {
return element.classList.contains('ant-menu-item-selected');
});
if (!isSelected) {
await menuItem.click();
await page.waitForLoadState('networkidle');
}
await page.getByTestId('subdomains').getByText('Sub Domains').click();
await page.getByTestId(subDomain.name).click();
await page.waitForLoadState('networkidle');
};
export const selectDataProductFromTab = async (
page: Page,
dataProduct: DataProduct['data']
) => {
const dpRes = page.waitForResponse(
'/api/v1/search/query?*&from=0&size=50&index=data_product_search_index*'
);
await page
.locator('.domain-details-page-tabs')
.getByText('Data Products')
.click();
await dpRes;
const dpDataRes = page.waitForResponse('/api/v1/dataProducts/name/*');
await page
.getByTestId(`explore-card-${dataProduct.name}`)
.getByTestId('entity-link')
.click();
await dpDataRes;
};
[RbacDomain] RBAC with Domain Restrictions (#16586) * Add domain field to entity jsons * add subdomains ui * Add Domain To create Request * Typo fix * commit progress * allow multiple domains * - add userDomains and teamDomains * - Restrict Api Access * allow multiple domain support * - Add Listing Restricition - Add Search Restrictions * - Field Fix * - Inherit Team Domains * remove glossary filter from ui * - Fix Tag and User Filter * - Id -> FQN in create * - Missing domain on indexes * add domain in creation of team, user and glossary * fix merge conflicts * fix feedbacks * fix tests * add domain playwright * minor changes * fix domain fetching calls * Add Thread Listing with EntityDomain * Fixes for Team Join * Mkae list mutable * Add missing import * Fix Team Test * User Test case fix * Fix User Domain * Minor bug fixes related to sub domains * Fix data retaining in add sub domain modal after closing * fix NavBar unit test * Make Domain Access Work Via Policies * Fix errors introduced after conflict resolutions * update render function in SubDomainsTable.component.tsx to accept an array of owners instead of a single owner * fix java checkstyle * fix py-test * format * Fix the domain e2e owner field type * Fix Failing Tests * fixed pytest list index * update userDomains and teamDomains to domains * Entity Domain to Domain for thread and changeEvent * FIx fields * @Ovveride * FIx * Remove Duplicate Field * Remove Duplicate Field * Fix Failing Test * fix domain related changes * fix subdomains loader * Fix Owners Order * Enforce Domain Permissions * fix domain cleanup * Fix Test * rever owner change --------- Co-authored-by: karanh37 <karanh37@gmail.com> Co-authored-by: Aniket Katkar <aniketkatkar97@gmail.com> Co-authored-by: Pere Miquel Brull <peremiquelbrull@gmail.com> Co-authored-by: sonikashah <sonikashah94@gmail.com> Co-authored-by: Sriharsha Chintalapani <harshach@users.noreply.github.com> Co-authored-by: Onkar Ravgan <onkar.10r@gmail.com> Co-authored-by: Karan Hotchandani <33024356+karanh37@users.noreply.github.com>
2024-08-02 10:16:14 +05:30
export const selectDataProduct = async (
page: Page,
domain: Domain['data'],
dataProduct: DataProduct['data']
) => {
await page
.getByRole('menuitem', { name: domain.displayName })
.locator('span')
.click();
await selectDataProductFromTab(page, dataProduct);
[RbacDomain] RBAC with Domain Restrictions (#16586) * Add domain field to entity jsons * add subdomains ui * Add Domain To create Request * Typo fix * commit progress * allow multiple domains * - add userDomains and teamDomains * - Restrict Api Access * allow multiple domain support * - Add Listing Restricition - Add Search Restrictions * - Field Fix * - Inherit Team Domains * remove glossary filter from ui * - Fix Tag and User Filter * - Id -> FQN in create * - Missing domain on indexes * add domain in creation of team, user and glossary * fix merge conflicts * fix feedbacks * fix tests * add domain playwright * minor changes * fix domain fetching calls * Add Thread Listing with EntityDomain * Fixes for Team Join * Mkae list mutable * Add missing import * Fix Team Test * User Test case fix * Fix User Domain * Minor bug fixes related to sub domains * Fix data retaining in add sub domain modal after closing * fix NavBar unit test * Make Domain Access Work Via Policies * Fix errors introduced after conflict resolutions * update render function in SubDomainsTable.component.tsx to accept an array of owners instead of a single owner * fix java checkstyle * fix py-test * format * Fix the domain e2e owner field type * Fix Failing Tests * fixed pytest list index * update userDomains and teamDomains to domains * Entity Domain to Domain for thread and changeEvent * FIx fields * @Ovveride * FIx * Remove Duplicate Field * Remove Duplicate Field * Fix Failing Test * fix domain related changes * fix subdomains loader * Fix Owners Order * Enforce Domain Permissions * fix domain cleanup * Fix Test * rever owner change --------- Co-authored-by: karanh37 <karanh37@gmail.com> Co-authored-by: Aniket Katkar <aniketkatkar97@gmail.com> Co-authored-by: Pere Miquel Brull <peremiquelbrull@gmail.com> Co-authored-by: sonikashah <sonikashah94@gmail.com> Co-authored-by: Sriharsha Chintalapani <harshach@users.noreply.github.com> Co-authored-by: Onkar Ravgan <onkar.10r@gmail.com> Co-authored-by: Karan Hotchandani <33024356+karanh37@users.noreply.github.com>
2024-08-02 10:16:14 +05:30
};
const goToAssetsTab = async (page: Page, domain: Domain['data']) => {
await selectDomain(page, domain);
await checkDomainDisplayName(page, domain.displayName);
await page.getByTestId('assets').click();
};
const fillCommonFormItems = async (
page: Page,
entity: Domain['data'] | DataProduct['data'] | SubDomain['data']
[RbacDomain] RBAC with Domain Restrictions (#16586) * Add domain field to entity jsons * add subdomains ui * Add Domain To create Request * Typo fix * commit progress * allow multiple domains * - add userDomains and teamDomains * - Restrict Api Access * allow multiple domain support * - Add Listing Restricition - Add Search Restrictions * - Field Fix * - Inherit Team Domains * remove glossary filter from ui * - Fix Tag and User Filter * - Id -> FQN in create * - Missing domain on indexes * add domain in creation of team, user and glossary * fix merge conflicts * fix feedbacks * fix tests * add domain playwright * minor changes * fix domain fetching calls * Add Thread Listing with EntityDomain * Fixes for Team Join * Mkae list mutable * Add missing import * Fix Team Test * User Test case fix * Fix User Domain * Minor bug fixes related to sub domains * Fix data retaining in add sub domain modal after closing * fix NavBar unit test * Make Domain Access Work Via Policies * Fix errors introduced after conflict resolutions * update render function in SubDomainsTable.component.tsx to accept an array of owners instead of a single owner * fix java checkstyle * fix py-test * format * Fix the domain e2e owner field type * Fix Failing Tests * fixed pytest list index * update userDomains and teamDomains to domains * Entity Domain to Domain for thread and changeEvent * FIx fields * @Ovveride * FIx * Remove Duplicate Field * Remove Duplicate Field * Fix Failing Test * fix domain related changes * fix subdomains loader * Fix Owners Order * Enforce Domain Permissions * fix domain cleanup * Fix Test * rever owner change --------- Co-authored-by: karanh37 <karanh37@gmail.com> Co-authored-by: Aniket Katkar <aniketkatkar97@gmail.com> Co-authored-by: Pere Miquel Brull <peremiquelbrull@gmail.com> Co-authored-by: sonikashah <sonikashah94@gmail.com> Co-authored-by: Sriharsha Chintalapani <harshach@users.noreply.github.com> Co-authored-by: Onkar Ravgan <onkar.10r@gmail.com> Co-authored-by: Karan Hotchandani <33024356+karanh37@users.noreply.github.com>
2024-08-02 10:16:14 +05:30
) => {
await page.locator('[data-testid="name"]').fill(entity.name);
await page.locator('[data-testid="display-name"]').fill(entity.displayName);
feat(#15380): replace description editor with block editor (#19003) * feat(#15380): replace the description editor with a new block editor. * chore: Add placeholder support to BlockEditor * feat: Add autofocus support to BlockEditor * chore: implement block editor in richtext editor * chore: Remove unused CSS import in RichTextEditor * fix: ensure safe access to getEditorContent in Markdown editor components * minor change * fix: add support for ttf file extension in pom.xml * fix: adjust block editor styles for better usability and overflow handling * fix: update RichTextEditorPreviewer to RichTextEditorPreviewerV1 and adjust block editor styles * fix: update description box selector to use om-block-editor for consistency * fix: disable autoFocus on BlockEditor in RichTextEditorPreviewerV1 * refactor: update RichTextEditorPreviewer references to RichTextEditorPreviewerV1 in tests * test: update timer handling in ApplicationCard and SuggestionsAlert tests * fix(diff): update diff view rendering and attributes for consistency * fix(RichTextEditor): add placeholder for empty markdown descriptions * Add data-diff in <span> * Fix test * fix: update description box selector to use locator method for better reliability * feat: integrate RichTextEditorPreviewerV1 for description rendering in Notification and Observability Alerts pages * feat: add markdown conversion for mentions and hashtags in BlockEditorUtils * fix: update initial value handling in TagsForm and formUtils * MINOR - Update description handling in Playwright tests and utilities * Refactor Playwright tests to use descriptionBox for tag and team descriptions * Refactor custom property handling and update description check logic * Enhance entity version page tests by adding description box read-only check and updating data-testid attributes * Refactor description handling and improve diff rendering logic in task pages * Fix user description clearing logic in UserDetails.spec.ts * Enhance Rich Text Editor by adding custom styles and converting markdown to HTML for backward compatibility * Remove test for rendering alert description when not present in AlertDetailsPage * Clean up RichTextEditorPreviewerV1 by removing unnecessary comments and improving readability * Update SearchIndexApplication.spec.ts to select 'Table' instead of 'Topic' in the tree widget * Refactor BlockEditor and FeedUtils to improve code organization and readability * Fix regex in getTextFromHtmlString to correctly remove HTML tags * Add tests for getTextFromHtmlString and improve HTML tag removal regex --------- Co-authored-by: mohitdeuex <mohit.y@deuexsolutions.com>
2024-12-27 20:57:37 +05:30
await page.locator(descriptionBox).fill(entity.description);
[RbacDomain] RBAC with Domain Restrictions (#16586) * Add domain field to entity jsons * add subdomains ui * Add Domain To create Request * Typo fix * commit progress * allow multiple domains * - add userDomains and teamDomains * - Restrict Api Access * allow multiple domain support * - Add Listing Restricition - Add Search Restrictions * - Field Fix * - Inherit Team Domains * remove glossary filter from ui * - Fix Tag and User Filter * - Id -> FQN in create * - Missing domain on indexes * add domain in creation of team, user and glossary * fix merge conflicts * fix feedbacks * fix tests * add domain playwright * minor changes * fix domain fetching calls * Add Thread Listing with EntityDomain * Fixes for Team Join * Mkae list mutable * Add missing import * Fix Team Test * User Test case fix * Fix User Domain * Minor bug fixes related to sub domains * Fix data retaining in add sub domain modal after closing * fix NavBar unit test * Make Domain Access Work Via Policies * Fix errors introduced after conflict resolutions * update render function in SubDomainsTable.component.tsx to accept an array of owners instead of a single owner * fix java checkstyle * fix py-test * format * Fix the domain e2e owner field type * Fix Failing Tests * fixed pytest list index * update userDomains and teamDomains to domains * Entity Domain to Domain for thread and changeEvent * FIx fields * @Ovveride * FIx * Remove Duplicate Field * Remove Duplicate Field * Fix Failing Test * fix domain related changes * fix subdomains loader * Fix Owners Order * Enforce Domain Permissions * fix domain cleanup * Fix Test * rever owner change --------- Co-authored-by: karanh37 <karanh37@gmail.com> Co-authored-by: Aniket Katkar <aniketkatkar97@gmail.com> Co-authored-by: Pere Miquel Brull <peremiquelbrull@gmail.com> Co-authored-by: sonikashah <sonikashah94@gmail.com> Co-authored-by: Sriharsha Chintalapani <harshach@users.noreply.github.com> Co-authored-by: Onkar Ravgan <onkar.10r@gmail.com> Co-authored-by: Karan Hotchandani <33024356+karanh37@users.noreply.github.com>
2024-08-02 10:16:14 +05:30
if (!isEmpty(entity.owners) && !isUndefined(entity.owners)) {
await addOwner({
[RbacDomain] RBAC with Domain Restrictions (#16586) * Add domain field to entity jsons * add subdomains ui * Add Domain To create Request * Typo fix * commit progress * allow multiple domains * - add userDomains and teamDomains * - Restrict Api Access * allow multiple domain support * - Add Listing Restricition - Add Search Restrictions * - Field Fix * - Inherit Team Domains * remove glossary filter from ui * - Fix Tag and User Filter * - Id -> FQN in create * - Missing domain on indexes * add domain in creation of team, user and glossary * fix merge conflicts * fix feedbacks * fix tests * add domain playwright * minor changes * fix domain fetching calls * Add Thread Listing with EntityDomain * Fixes for Team Join * Mkae list mutable * Add missing import * Fix Team Test * User Test case fix * Fix User Domain * Minor bug fixes related to sub domains * Fix data retaining in add sub domain modal after closing * fix NavBar unit test * Make Domain Access Work Via Policies * Fix errors introduced after conflict resolutions * update render function in SubDomainsTable.component.tsx to accept an array of owners instead of a single owner * fix java checkstyle * fix py-test * format * Fix the domain e2e owner field type * Fix Failing Tests * fixed pytest list index * update userDomains and teamDomains to domains * Entity Domain to Domain for thread and changeEvent * FIx fields * @Ovveride * FIx * Remove Duplicate Field * Remove Duplicate Field * Fix Failing Test * fix domain related changes * fix subdomains loader * Fix Owners Order * Enforce Domain Permissions * fix domain cleanup * Fix Test * rever owner change --------- Co-authored-by: karanh37 <karanh37@gmail.com> Co-authored-by: Aniket Katkar <aniketkatkar97@gmail.com> Co-authored-by: Pere Miquel Brull <peremiquelbrull@gmail.com> Co-authored-by: sonikashah <sonikashah94@gmail.com> Co-authored-by: Sriharsha Chintalapani <harshach@users.noreply.github.com> Co-authored-by: Onkar Ravgan <onkar.10r@gmail.com> Co-authored-by: Karan Hotchandani <33024356+karanh37@users.noreply.github.com>
2024-08-02 10:16:14 +05:30
page,
owner: entity.owners[0].name,
type: entity.owners[0].type as 'Users' | 'Teams',
endpoint: EntityTypeEndpoint.Domain,
dataTestId: 'owner-container',
initiatorId: 'add-owner',
});
[RbacDomain] RBAC with Domain Restrictions (#16586) * Add domain field to entity jsons * add subdomains ui * Add Domain To create Request * Typo fix * commit progress * allow multiple domains * - add userDomains and teamDomains * - Restrict Api Access * allow multiple domain support * - Add Listing Restricition - Add Search Restrictions * - Field Fix * - Inherit Team Domains * remove glossary filter from ui * - Fix Tag and User Filter * - Id -> FQN in create * - Missing domain on indexes * add domain in creation of team, user and glossary * fix merge conflicts * fix feedbacks * fix tests * add domain playwright * minor changes * fix domain fetching calls * Add Thread Listing with EntityDomain * Fixes for Team Join * Mkae list mutable * Add missing import * Fix Team Test * User Test case fix * Fix User Domain * Minor bug fixes related to sub domains * Fix data retaining in add sub domain modal after closing * fix NavBar unit test * Make Domain Access Work Via Policies * Fix errors introduced after conflict resolutions * update render function in SubDomainsTable.component.tsx to accept an array of owners instead of a single owner * fix java checkstyle * fix py-test * format * Fix the domain e2e owner field type * Fix Failing Tests * fixed pytest list index * update userDomains and teamDomains to domains * Entity Domain to Domain for thread and changeEvent * FIx fields * @Ovveride * FIx * Remove Duplicate Field * Remove Duplicate Field * Fix Failing Test * fix domain related changes * fix subdomains loader * Fix Owners Order * Enforce Domain Permissions * fix domain cleanup * Fix Test * rever owner change --------- Co-authored-by: karanh37 <karanh37@gmail.com> Co-authored-by: Aniket Katkar <aniketkatkar97@gmail.com> Co-authored-by: Pere Miquel Brull <peremiquelbrull@gmail.com> Co-authored-by: sonikashah <sonikashah94@gmail.com> Co-authored-by: Sriharsha Chintalapani <harshach@users.noreply.github.com> Co-authored-by: Onkar Ravgan <onkar.10r@gmail.com> Co-authored-by: Karan Hotchandani <33024356+karanh37@users.noreply.github.com>
2024-08-02 10:16:14 +05:30
}
};
export const fillDomainForm = async (
page: Page,
entity: Domain['data'] | SubDomain['data'],
isDomain = true
) => {
[RbacDomain] RBAC with Domain Restrictions (#16586) * Add domain field to entity jsons * add subdomains ui * Add Domain To create Request * Typo fix * commit progress * allow multiple domains * - add userDomains and teamDomains * - Restrict Api Access * allow multiple domain support * - Add Listing Restricition - Add Search Restrictions * - Field Fix * - Inherit Team Domains * remove glossary filter from ui * - Fix Tag and User Filter * - Id -> FQN in create * - Missing domain on indexes * add domain in creation of team, user and glossary * fix merge conflicts * fix feedbacks * fix tests * add domain playwright * minor changes * fix domain fetching calls * Add Thread Listing with EntityDomain * Fixes for Team Join * Mkae list mutable * Add missing import * Fix Team Test * User Test case fix * Fix User Domain * Minor bug fixes related to sub domains * Fix data retaining in add sub domain modal after closing * fix NavBar unit test * Make Domain Access Work Via Policies * Fix errors introduced after conflict resolutions * update render function in SubDomainsTable.component.tsx to accept an array of owners instead of a single owner * fix java checkstyle * fix py-test * format * Fix the domain e2e owner field type * Fix Failing Tests * fixed pytest list index * update userDomains and teamDomains to domains * Entity Domain to Domain for thread and changeEvent * FIx fields * @Ovveride * FIx * Remove Duplicate Field * Remove Duplicate Field * Fix Failing Test * fix domain related changes * fix subdomains loader * Fix Owners Order * Enforce Domain Permissions * fix domain cleanup * Fix Test * rever owner change --------- Co-authored-by: karanh37 <karanh37@gmail.com> Co-authored-by: Aniket Katkar <aniketkatkar97@gmail.com> Co-authored-by: Pere Miquel Brull <peremiquelbrull@gmail.com> Co-authored-by: sonikashah <sonikashah94@gmail.com> Co-authored-by: Sriharsha Chintalapani <harshach@users.noreply.github.com> Co-authored-by: Onkar Ravgan <onkar.10r@gmail.com> Co-authored-by: Karan Hotchandani <33024356+karanh37@users.noreply.github.com>
2024-08-02 10:16:14 +05:30
await fillCommonFormItems(page, entity);
if (isDomain) {
await page.click('[data-testid="domainType"]');
} else {
await page
.getByLabel('Add Sub Domain')
.getByTestId('domainType')
.locator('div')
.click();
}
[RbacDomain] RBAC with Domain Restrictions (#16586) * Add domain field to entity jsons * add subdomains ui * Add Domain To create Request * Typo fix * commit progress * allow multiple domains * - add userDomains and teamDomains * - Restrict Api Access * allow multiple domain support * - Add Listing Restricition - Add Search Restrictions * - Field Fix * - Inherit Team Domains * remove glossary filter from ui * - Fix Tag and User Filter * - Id -> FQN in create * - Missing domain on indexes * add domain in creation of team, user and glossary * fix merge conflicts * fix feedbacks * fix tests * add domain playwright * minor changes * fix domain fetching calls * Add Thread Listing with EntityDomain * Fixes for Team Join * Mkae list mutable * Add missing import * Fix Team Test * User Test case fix * Fix User Domain * Minor bug fixes related to sub domains * Fix data retaining in add sub domain modal after closing * fix NavBar unit test * Make Domain Access Work Via Policies * Fix errors introduced after conflict resolutions * update render function in SubDomainsTable.component.tsx to accept an array of owners instead of a single owner * fix java checkstyle * fix py-test * format * Fix the domain e2e owner field type * Fix Failing Tests * fixed pytest list index * update userDomains and teamDomains to domains * Entity Domain to Domain for thread and changeEvent * FIx fields * @Ovveride * FIx * Remove Duplicate Field * Remove Duplicate Field * Fix Failing Test * fix domain related changes * fix subdomains loader * Fix Owners Order * Enforce Domain Permissions * fix domain cleanup * Fix Test * rever owner change --------- Co-authored-by: karanh37 <karanh37@gmail.com> Co-authored-by: Aniket Katkar <aniketkatkar97@gmail.com> Co-authored-by: Pere Miquel Brull <peremiquelbrull@gmail.com> Co-authored-by: sonikashah <sonikashah94@gmail.com> Co-authored-by: Sriharsha Chintalapani <harshach@users.noreply.github.com> Co-authored-by: Onkar Ravgan <onkar.10r@gmail.com> Co-authored-by: Karan Hotchandani <33024356+karanh37@users.noreply.github.com>
2024-08-02 10:16:14 +05:30
await page.getByTitle(entity.domainType).locator('div').click();
};
export const checkDomainDisplayName = async (
page: Page,
displayName: string
) => {
feat(ui): revamp landing page (#21691) * fix: minor style for customisation pages * feat(ui): customisation of landing page (#21692) * add customise header section * fix react grid layout for widgets * fix widget height and refactor code * fix tests * address pr comments and added unit test * fix unit test * fix spacing issues and addressed pr comments * feat(ui): customise home page banner (#21793) * add structure for customise home modal * feat: customise banner background color * refactor css * add unit tests * fix color change functionality * minor fix * refactor code * minor refector * feat(ui): new layout for home page (#21901) * update new layout for home page * add unit tests * feat(ui): widgets selection modal (#21974) * add selection widgets to modal * implement add widgets functionality * fix placeholderWidgetKey for addWidget * fix handleApply call * fix erros after merging to main for react upgrade * add tests * refactor css for widget card * fix tests * add images for widgets * add localisation * fix test * Add json files for new landing page (#22116) * chore(ci): improve e2e runners with conditions (#22084) * MINOR: Fix pytest 3.9 (#22085) * feat: add support for DBX system metrics (#22044) * feat: add support for DBX system metrics * feat: add support for DBX system metrics * fix: added WRITE back * fix: failing test cases * fix: failing test * Doc: Meta Description Updation (#22074) * Doc: 404 Images Fixing (#22083) * Doc: Version change along with 404 Error Fixing (#22053) Co-authored-by: “Rounak <“rounakpreet.d@deuexsolutions.com”> * Minor: Fix the token expiry options order (#22049) * Fix the token expiry options order * Improve the logic and fix playwright tests * fix sonar cloud issue * Fix the type error * Feature #20137 Move Glossary Terms to any level including other glossaries (#21867) * allow changing of glossary term * Draft ES Index Update for Glossary term move * ES Upates in a more faster one shot bulk update * Remove validations on Parent Glossary Hierarchy and Include Circular Glossary Term Validations * Introduced a new PUT api for glossaryTerms move operation * Optimised moveGlossaryTerm * Added Transaction Scope in moveAndStore in updater * Remove Consolidate and revert changes for move operation * Improved Change Description and Versioning for move operation * Improvise request payload to have only parent and optimise the flow * Implement async functionality of Glossary Terms move * mvn spotless:apply * MoveGlossaryTermChannel, Get only the required fields * Fix: Update Parent for Glossary Term during Bulk Import * allow glossary term to be moved across glossaries * update locales * move socket listening to hierarchy dialog * Added fqn to move message for the websocket response * fix tests * add glossary tests * cleanup * fix tests * Refactor code: Resolve Conflicts * fix tests * fix permissions * cleanup * Update generated TypeScript types * Abstraction Logic in place of instanceOf logic for bulkImportExportGlossary to update the parent * Update generated TypeScript types --------- Co-authored-by: karanh37 <karanh37@gmail.com> Co-authored-by: Karan Hotchandani <33024356+karanh37@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Aniket Katkar <aniketkatkar97@gmail.com> * update the snapshots url for ossrh migration (#22090) * Update README and Ingestion Framework Documentation (#22080) * Add my task json for new landing page * update description * add domain.json * fix test --------- Co-authored-by: Chirag Madlani <12962843+chirag-madlani@users.noreply.github.com> Co-authored-by: Mayur Singal <39544459+ulixius9@users.noreply.github.com> Co-authored-by: Teddy <teddy.crepineau@gmail.com> Co-authored-by: Rounak Dhillon <162090200+RounakDhillon@users.noreply.github.com> Co-authored-by: “Rounak <“rounakpreet.d@deuexsolutions.com”> Co-authored-by: Aniket Katkar <aniketkatkar97@gmail.com> Co-authored-by: Ram Narayan Balaji <81347100+yan-3005@users.noreply.github.com> Co-authored-by: karanh37 <karanh37@gmail.com> Co-authored-by: Karan Hotchandani <33024356+karanh37@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: sonika-shah <58761340+sonika-shah@users.noreply.github.com> Co-authored-by: Ayush Shah <ayush@getcollate.io> * feat(ui): Add support to create curated assets widget (#21870) * feat(ui): Add support to create curated assets widget * revert settings.json * fix: minor style for customisation pages * feat(ui): customisation of landing page (#21692) * add customise header section * fix react grid layout for widgets * fix widget height and refactor code * fix tests * address pr comments and added unit test * fix unit test * fix spacing issues and addressed pr comments * fix locale * update icons and styles * fix view more * fix footer * add unit tests and minor fixes * add curatedAssets.json * format json file * address comments * address comments * remove unnecessary indentation and fix locale * minor fix * address comments * update json * remove unnecessary changes * update imports * add sort and size options * add unit test * fix test * revert test changes * fix unit tests * Fix failing test * fix sonar nullish operator issue * address feedback --------- Co-authored-by: Pranita <pfulsundar8@gmail.com> Co-authored-by: Chirag Madlani <12962843+chirag-madlani@users.noreply.github.com> * feat(ui): create widgets with new layout having sizes small and medium (#22082) * fix customise home modal for home page * redesign widget * fix following widget * data assets widget * fix conflicting styles --------- Co-authored-by: Chirag Madlani <12962843+chirag-madlani@users.noreply.github.com> * Remove global search bar and add functionality to new search bar (#22156) * Remove global search bar and add functionality to new search bar * add unit tests * Add support for My Task widget (#22161) * Add support for My Task widget * address comments * minor fix * fix failing tests * Hide non configured curated asset from my data page (#22209) * Hide non configured curated asset from my data page * address comments --------- Co-authored-by: Chirag Madlani <12962843+chirag-madlani@users.noreply.github.com> * Disable save button and fix UI discrepencies (#22152) * Disable save button and miscellaneous changes * fix ui * Fix failing test * address comments --------- Co-authored-by: Chirag Madlani <12962843+chirag-madlani@users.noreply.github.com> * add persona preference to uiCustomisation * Add support to update persona preferences for the user (#22235) * Add support to update persona preferences for the user * add loader * add success toast * Fix failing unit test * Update generated TypeScript types * Support background update by admin for customized landing page (#22301) * Fix failing e2e tests (#22248) * Fix failing e2e tests * fix activity feed tests * fix failing e2e tests * fix EntityDataSteward and Entity tests * fix failing tests * Fix metric tests * Fix lineage and my data page * update uuid * Add support for domains widget (#22318) * Add support for domains widget * code cleanup * minor fix * fix failing test * address comments * update .less file * import t from utils --------- Co-authored-by: Sriharsha Chintalapani <harshach@users.noreply.github.com> * Update curated assets widget for full size (#22343) * Fix customize search functionality (#22349) * Fix customize search functionality * update-my-task-icon * fix failing tests * Redesign Data Assets widget (#22353) * Redesign Data Assets widget * remove comments * add footer and its unit tests * Add new announcement widget (#22373) * Add new announcement widget * fix badge color * fix styles * address comments * fix failing test * minor fix * fix css * fix color variable * Fix KPI and Total Data Assets widgets (#22359) * fix dropdown styles * fix minor styles * remove recently viewed widget * fix kpi widget and added tests * fix total data assets widget and add tests * minor style fix * remove kpi filters * fix total data assets chart colors * add filters for total data assets * fix kpi widget styles * minor style fix * addressed pr comments * Feat(UI): Added Feed , Assets Following and My data widget (#22375) * added feeds widget * addressed comments * fixed padding * addressed comments and added new tests * addressed comments and added new tests * removed unncessary slice condition * added sorting for follwing and my data widget * fixed truncate and overflow edge condtions * fixed sonar test * remove unwanted options * Fix UI cosmetic issues (#22439) * fix: failing e2e tests (#22427) * fix Entity.spec * fix metric tests from Entity.spec * minor fix * minor fix * Fix CSS for data assets, KPI and total data assets widget (#22458) * Fix failing e2e tests (#22396) * Fix failing e2e tests * Fix tour and data quality tests * Fix description suggestion * fix customMetric tests * fix tests * fix tests * fix navbar and bulk import tests * Fix entity service tests * Fix ExploreQuickFilters.spec.ts * fix metric tests * update config * minor fix * Fix domain rbac * Fix test * fix unit test --------- Co-authored-by: Chirag Madlani <12962843+chirag-madlani@users.noreply.github.com> * fix tests * Fix failing E2E tests (#22462) * Fix failing E2E tests * Fix service entity tests * fix tests * fix kpi widget test id * fix schema definition and frequently joined tests * fix domains.spec * fix tests * fix tests and address ui feedbacks * fix unit tests --------- Co-authored-by: Chirag Madlani <12962843+chirag-madlani@users.noreply.github.com> Co-authored-by: Harshit Shah <dinkushah169@gmail.com> Co-authored-by: Mayur Singal <39544459+ulixius9@users.noreply.github.com> Co-authored-by: Teddy <teddy.crepineau@gmail.com> Co-authored-by: Rounak Dhillon <162090200+RounakDhillon@users.noreply.github.com> Co-authored-by: “Rounak <“rounakpreet.d@deuexsolutions.com”> Co-authored-by: Aniket Katkar <aniketkatkar97@gmail.com> Co-authored-by: Ram Narayan Balaji <81347100+yan-3005@users.noreply.github.com> Co-authored-by: karanh37 <karanh37@gmail.com> Co-authored-by: Karan Hotchandani <33024356+karanh37@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: sonika-shah <58761340+sonika-shah@users.noreply.github.com> Co-authored-by: Ayush Shah <ayush@getcollate.io> Co-authored-by: Sriharsha Chintalapani <harshach@users.noreply.github.com> Co-authored-by: Dhruv Parmar <83108871+dhruvjsx@users.noreply.github.com>
2025-07-19 17:59:14 +05:30
await page.waitForLoadState('networkidle');
[RbacDomain] RBAC with Domain Restrictions (#16586) * Add domain field to entity jsons * add subdomains ui * Add Domain To create Request * Typo fix * commit progress * allow multiple domains * - add userDomains and teamDomains * - Restrict Api Access * allow multiple domain support * - Add Listing Restricition - Add Search Restrictions * - Field Fix * - Inherit Team Domains * remove glossary filter from ui * - Fix Tag and User Filter * - Id -> FQN in create * - Missing domain on indexes * add domain in creation of team, user and glossary * fix merge conflicts * fix feedbacks * fix tests * add domain playwright * minor changes * fix domain fetching calls * Add Thread Listing with EntityDomain * Fixes for Team Join * Mkae list mutable * Add missing import * Fix Team Test * User Test case fix * Fix User Domain * Minor bug fixes related to sub domains * Fix data retaining in add sub domain modal after closing * fix NavBar unit test * Make Domain Access Work Via Policies * Fix errors introduced after conflict resolutions * update render function in SubDomainsTable.component.tsx to accept an array of owners instead of a single owner * fix java checkstyle * fix py-test * format * Fix the domain e2e owner field type * Fix Failing Tests * fixed pytest list index * update userDomains and teamDomains to domains * Entity Domain to Domain for thread and changeEvent * FIx fields * @Ovveride * FIx * Remove Duplicate Field * Remove Duplicate Field * Fix Failing Test * fix domain related changes * fix subdomains loader * Fix Owners Order * Enforce Domain Permissions * fix domain cleanup * Fix Test * rever owner change --------- Co-authored-by: karanh37 <karanh37@gmail.com> Co-authored-by: Aniket Katkar <aniketkatkar97@gmail.com> Co-authored-by: Pere Miquel Brull <peremiquelbrull@gmail.com> Co-authored-by: sonikashah <sonikashah94@gmail.com> Co-authored-by: Sriharsha Chintalapani <harshach@users.noreply.github.com> Co-authored-by: Onkar Ravgan <onkar.10r@gmail.com> Co-authored-by: Karan Hotchandani <33024356+karanh37@users.noreply.github.com>
2024-08-02 10:16:14 +05:30
await expect(page.getByTestId('entity-header-display-name')).toHaveText(
displayName
);
};
export const checkAssetsCount = async (page: Page, count: number) => {
await expect(page.getByTestId('assets').getByTestId('count')).toContainText(
count.toString()
);
};
export const checkDataProductCount = async (page: Page, count: number) => {
await expect(
page.getByTestId('data_products').getByTestId('count')
).toContainText(count.toString());
};
export const verifyDomain = async (
page: Page,
domain: Domain['data'] | SubDomain['data'],
parentDomain?: Domain['data'],
isDomain = true
) => {
[RbacDomain] RBAC with Domain Restrictions (#16586) * Add domain field to entity jsons * add subdomains ui * Add Domain To create Request * Typo fix * commit progress * allow multiple domains * - add userDomains and teamDomains * - Restrict Api Access * allow multiple domain support * - Add Listing Restricition - Add Search Restrictions * - Field Fix * - Inherit Team Domains * remove glossary filter from ui * - Fix Tag and User Filter * - Id -> FQN in create * - Missing domain on indexes * add domain in creation of team, user and glossary * fix merge conflicts * fix feedbacks * fix tests * add domain playwright * minor changes * fix domain fetching calls * Add Thread Listing with EntityDomain * Fixes for Team Join * Mkae list mutable * Add missing import * Fix Team Test * User Test case fix * Fix User Domain * Minor bug fixes related to sub domains * Fix data retaining in add sub domain modal after closing * fix NavBar unit test * Make Domain Access Work Via Policies * Fix errors introduced after conflict resolutions * update render function in SubDomainsTable.component.tsx to accept an array of owners instead of a single owner * fix java checkstyle * fix py-test * format * Fix the domain e2e owner field type * Fix Failing Tests * fixed pytest list index * update userDomains and teamDomains to domains * Entity Domain to Domain for thread and changeEvent * FIx fields * @Ovveride * FIx * Remove Duplicate Field * Remove Duplicate Field * Fix Failing Test * fix domain related changes * fix subdomains loader * Fix Owners Order * Enforce Domain Permissions * fix domain cleanup * Fix Test * rever owner change --------- Co-authored-by: karanh37 <karanh37@gmail.com> Co-authored-by: Aniket Katkar <aniketkatkar97@gmail.com> Co-authored-by: Pere Miquel Brull <peremiquelbrull@gmail.com> Co-authored-by: sonikashah <sonikashah94@gmail.com> Co-authored-by: Sriharsha Chintalapani <harshach@users.noreply.github.com> Co-authored-by: Onkar Ravgan <onkar.10r@gmail.com> Co-authored-by: Karan Hotchandani <33024356+karanh37@users.noreply.github.com>
2024-08-02 10:16:14 +05:30
await checkDomainDisplayName(page, domain.displayName);
const viewerContainerText = await page.textContent(
'[data-testid="viewer-container"]'
);
await expect(viewerContainerText).toContain(domain.description);
if (!isEmpty(domain.owners) && !isUndefined(domain.owners)) {
await expect(
page.getByTestId('domain-owner-name').getByTestId('owner-link')
).toContainText(domain.owners[0].name);
}
await expect(
page.getByTestId('domain-type-label').locator('div')
).toContainText(domain.domainType);
// Check breadcrumbs
if (!isDomain && parentDomain) {
await expect(
page.getByRole('link', { name: parentDomain.fullyQualifiedName })
).toBeVisible();
}
[RbacDomain] RBAC with Domain Restrictions (#16586) * Add domain field to entity jsons * add subdomains ui * Add Domain To create Request * Typo fix * commit progress * allow multiple domains * - add userDomains and teamDomains * - Restrict Api Access * allow multiple domain support * - Add Listing Restricition - Add Search Restrictions * - Field Fix * - Inherit Team Domains * remove glossary filter from ui * - Fix Tag and User Filter * - Id -> FQN in create * - Missing domain on indexes * add domain in creation of team, user and glossary * fix merge conflicts * fix feedbacks * fix tests * add domain playwright * minor changes * fix domain fetching calls * Add Thread Listing with EntityDomain * Fixes for Team Join * Mkae list mutable * Add missing import * Fix Team Test * User Test case fix * Fix User Domain * Minor bug fixes related to sub domains * Fix data retaining in add sub domain modal after closing * fix NavBar unit test * Make Domain Access Work Via Policies * Fix errors introduced after conflict resolutions * update render function in SubDomainsTable.component.tsx to accept an array of owners instead of a single owner * fix java checkstyle * fix py-test * format * Fix the domain e2e owner field type * Fix Failing Tests * fixed pytest list index * update userDomains and teamDomains to domains * Entity Domain to Domain for thread and changeEvent * FIx fields * @Ovveride * FIx * Remove Duplicate Field * Remove Duplicate Field * Fix Failing Test * fix domain related changes * fix subdomains loader * Fix Owners Order * Enforce Domain Permissions * fix domain cleanup * Fix Test * rever owner change --------- Co-authored-by: karanh37 <karanh37@gmail.com> Co-authored-by: Aniket Katkar <aniketkatkar97@gmail.com> Co-authored-by: Pere Miquel Brull <peremiquelbrull@gmail.com> Co-authored-by: sonikashah <sonikashah94@gmail.com> Co-authored-by: Sriharsha Chintalapani <harshach@users.noreply.github.com> Co-authored-by: Onkar Ravgan <onkar.10r@gmail.com> Co-authored-by: Karan Hotchandani <33024356+karanh37@users.noreply.github.com>
2024-08-02 10:16:14 +05:30
};
export const createDomain = async (
page: Page,
domain: Domain['data'],
validate = false
) => {
await page.click('[data-testid="add-domain"]');
await page.waitForSelector('[data-testid="form-heading"]');
await expect(page.locator('[data-testid="form-heading"]')).toHaveText(
'Add Domain'
);
await page.click('[data-testid="save-domain"]');
if (validate) {
await validateDomainForm(page);
}
await fillDomainForm(page, domain);
const domainRes = page.waitForResponse('/api/v1/domains');
await page.click('[data-testid="save-domain"]');
await domainRes;
await checkDomainDisplayName(page, domain.displayName);
await checkAssetsCount(page, 0);
await checkDataProductCount(page, 0);
};
export const createSubDomain = async (
page: Page,
subDomain: SubDomain['data']
) => {
await page.getByTestId('domain-details-add-button').click();
await page.getByRole('menuitem', { name: 'Sub Domains' }).click();
await expect(page.getByText('Add Sub Domain')).toBeVisible();
await fillDomainForm(page, subDomain, false);
const saveRes = page.waitForResponse('/api/v1/domains');
await page.getByTestId('save-sub-domain').click();
await saveRes;
};
[RbacDomain] RBAC with Domain Restrictions (#16586) * Add domain field to entity jsons * add subdomains ui * Add Domain To create Request * Typo fix * commit progress * allow multiple domains * - add userDomains and teamDomains * - Restrict Api Access * allow multiple domain support * - Add Listing Restricition - Add Search Restrictions * - Field Fix * - Inherit Team Domains * remove glossary filter from ui * - Fix Tag and User Filter * - Id -> FQN in create * - Missing domain on indexes * add domain in creation of team, user and glossary * fix merge conflicts * fix feedbacks * fix tests * add domain playwright * minor changes * fix domain fetching calls * Add Thread Listing with EntityDomain * Fixes for Team Join * Mkae list mutable * Add missing import * Fix Team Test * User Test case fix * Fix User Domain * Minor bug fixes related to sub domains * Fix data retaining in add sub domain modal after closing * fix NavBar unit test * Make Domain Access Work Via Policies * Fix errors introduced after conflict resolutions * update render function in SubDomainsTable.component.tsx to accept an array of owners instead of a single owner * fix java checkstyle * fix py-test * format * Fix the domain e2e owner field type * Fix Failing Tests * fixed pytest list index * update userDomains and teamDomains to domains * Entity Domain to Domain for thread and changeEvent * FIx fields * @Ovveride * FIx * Remove Duplicate Field * Remove Duplicate Field * Fix Failing Test * fix domain related changes * fix subdomains loader * Fix Owners Order * Enforce Domain Permissions * fix domain cleanup * Fix Test * rever owner change --------- Co-authored-by: karanh37 <karanh37@gmail.com> Co-authored-by: Aniket Katkar <aniketkatkar97@gmail.com> Co-authored-by: Pere Miquel Brull <peremiquelbrull@gmail.com> Co-authored-by: sonikashah <sonikashah94@gmail.com> Co-authored-by: Sriharsha Chintalapani <harshach@users.noreply.github.com> Co-authored-by: Onkar Ravgan <onkar.10r@gmail.com> Co-authored-by: Karan Hotchandani <33024356+karanh37@users.noreply.github.com>
2024-08-02 10:16:14 +05:30
export const addAssetsToDomain = async (
page: Page,
domain: Domain,
assets: EntityClass[],
navigateToAssetsTab = true
[RbacDomain] RBAC with Domain Restrictions (#16586) * Add domain field to entity jsons * add subdomains ui * Add Domain To create Request * Typo fix * commit progress * allow multiple domains * - add userDomains and teamDomains * - Restrict Api Access * allow multiple domain support * - Add Listing Restricition - Add Search Restrictions * - Field Fix * - Inherit Team Domains * remove glossary filter from ui * - Fix Tag and User Filter * - Id -> FQN in create * - Missing domain on indexes * add domain in creation of team, user and glossary * fix merge conflicts * fix feedbacks * fix tests * add domain playwright * minor changes * fix domain fetching calls * Add Thread Listing with EntityDomain * Fixes for Team Join * Mkae list mutable * Add missing import * Fix Team Test * User Test case fix * Fix User Domain * Minor bug fixes related to sub domains * Fix data retaining in add sub domain modal after closing * fix NavBar unit test * Make Domain Access Work Via Policies * Fix errors introduced after conflict resolutions * update render function in SubDomainsTable.component.tsx to accept an array of owners instead of a single owner * fix java checkstyle * fix py-test * format * Fix the domain e2e owner field type * Fix Failing Tests * fixed pytest list index * update userDomains and teamDomains to domains * Entity Domain to Domain for thread and changeEvent * FIx fields * @Ovveride * FIx * Remove Duplicate Field * Remove Duplicate Field * Fix Failing Test * fix domain related changes * fix subdomains loader * Fix Owners Order * Enforce Domain Permissions * fix domain cleanup * Fix Test * rever owner change --------- Co-authored-by: karanh37 <karanh37@gmail.com> Co-authored-by: Aniket Katkar <aniketkatkar97@gmail.com> Co-authored-by: Pere Miquel Brull <peremiquelbrull@gmail.com> Co-authored-by: sonikashah <sonikashah94@gmail.com> Co-authored-by: Sriharsha Chintalapani <harshach@users.noreply.github.com> Co-authored-by: Onkar Ravgan <onkar.10r@gmail.com> Co-authored-by: Karan Hotchandani <33024356+karanh37@users.noreply.github.com>
2024-08-02 10:16:14 +05:30
) => {
if (navigateToAssetsTab) {
await goToAssetsTab(page, domain.data);
}
[RbacDomain] RBAC with Domain Restrictions (#16586) * Add domain field to entity jsons * add subdomains ui * Add Domain To create Request * Typo fix * commit progress * allow multiple domains * - add userDomains and teamDomains * - Restrict Api Access * allow multiple domain support * - Add Listing Restricition - Add Search Restrictions * - Field Fix * - Inherit Team Domains * remove glossary filter from ui * - Fix Tag and User Filter * - Id -> FQN in create * - Missing domain on indexes * add domain in creation of team, user and glossary * fix merge conflicts * fix feedbacks * fix tests * add domain playwright * minor changes * fix domain fetching calls * Add Thread Listing with EntityDomain * Fixes for Team Join * Mkae list mutable * Add missing import * Fix Team Test * User Test case fix * Fix User Domain * Minor bug fixes related to sub domains * Fix data retaining in add sub domain modal after closing * fix NavBar unit test * Make Domain Access Work Via Policies * Fix errors introduced after conflict resolutions * update render function in SubDomainsTable.component.tsx to accept an array of owners instead of a single owner * fix java checkstyle * fix py-test * format * Fix the domain e2e owner field type * Fix Failing Tests * fixed pytest list index * update userDomains and teamDomains to domains * Entity Domain to Domain for thread and changeEvent * FIx fields * @Ovveride * FIx * Remove Duplicate Field * Remove Duplicate Field * Fix Failing Test * fix domain related changes * fix subdomains loader * Fix Owners Order * Enforce Domain Permissions * fix domain cleanup * Fix Test * rever owner change --------- Co-authored-by: karanh37 <karanh37@gmail.com> Co-authored-by: Aniket Katkar <aniketkatkar97@gmail.com> Co-authored-by: Pere Miquel Brull <peremiquelbrull@gmail.com> Co-authored-by: sonikashah <sonikashah94@gmail.com> Co-authored-by: Sriharsha Chintalapani <harshach@users.noreply.github.com> Co-authored-by: Onkar Ravgan <onkar.10r@gmail.com> Co-authored-by: Karan Hotchandani <33024356+karanh37@users.noreply.github.com>
2024-08-02 10:16:14 +05:30
await checkAssetsCount(page, 0);
await expect(page.getByTestId('no-data-placeholder')).toContainText(
'Adding a new Asset is easy, just give it a spin!'
);
await page.getByTestId('domain-details-add-button').click();
await page.getByRole('menuitem', { name: 'Assets', exact: true }).click();
[RbacDomain] RBAC with Domain Restrictions (#16586) * Add domain field to entity jsons * add subdomains ui * Add Domain To create Request * Typo fix * commit progress * allow multiple domains * - add userDomains and teamDomains * - Restrict Api Access * allow multiple domain support * - Add Listing Restricition - Add Search Restrictions * - Field Fix * - Inherit Team Domains * remove glossary filter from ui * - Fix Tag and User Filter * - Id -> FQN in create * - Missing domain on indexes * add domain in creation of team, user and glossary * fix merge conflicts * fix feedbacks * fix tests * add domain playwright * minor changes * fix domain fetching calls * Add Thread Listing with EntityDomain * Fixes for Team Join * Mkae list mutable * Add missing import * Fix Team Test * User Test case fix * Fix User Domain * Minor bug fixes related to sub domains * Fix data retaining in add sub domain modal after closing * fix NavBar unit test * Make Domain Access Work Via Policies * Fix errors introduced after conflict resolutions * update render function in SubDomainsTable.component.tsx to accept an array of owners instead of a single owner * fix java checkstyle * fix py-test * format * Fix the domain e2e owner field type * Fix Failing Tests * fixed pytest list index * update userDomains and teamDomains to domains * Entity Domain to Domain for thread and changeEvent * FIx fields * @Ovveride * FIx * Remove Duplicate Field * Remove Duplicate Field * Fix Failing Test * fix domain related changes * fix subdomains loader * Fix Owners Order * Enforce Domain Permissions * fix domain cleanup * Fix Test * rever owner change --------- Co-authored-by: karanh37 <karanh37@gmail.com> Co-authored-by: Aniket Katkar <aniketkatkar97@gmail.com> Co-authored-by: Pere Miquel Brull <peremiquelbrull@gmail.com> Co-authored-by: sonikashah <sonikashah94@gmail.com> Co-authored-by: Sriharsha Chintalapani <harshach@users.noreply.github.com> Co-authored-by: Onkar Ravgan <onkar.10r@gmail.com> Co-authored-by: Karan Hotchandani <33024356+karanh37@users.noreply.github.com>
2024-08-02 10:16:14 +05:30
for (const asset of assets) {
const name = get(asset, 'entityResponseData.name');
const fqn = get(asset, 'entityResponseData.fullyQualifiedName');
const entityDisplayName = get(asset, 'entityResponseData.displayName');
const visibleName = entityDisplayName ?? name;
[RbacDomain] RBAC with Domain Restrictions (#16586) * Add domain field to entity jsons * add subdomains ui * Add Domain To create Request * Typo fix * commit progress * allow multiple domains * - add userDomains and teamDomains * - Restrict Api Access * allow multiple domain support * - Add Listing Restricition - Add Search Restrictions * - Field Fix * - Inherit Team Domains * remove glossary filter from ui * - Fix Tag and User Filter * - Id -> FQN in create * - Missing domain on indexes * add domain in creation of team, user and glossary * fix merge conflicts * fix feedbacks * fix tests * add domain playwright * minor changes * fix domain fetching calls * Add Thread Listing with EntityDomain * Fixes for Team Join * Mkae list mutable * Add missing import * Fix Team Test * User Test case fix * Fix User Domain * Minor bug fixes related to sub domains * Fix data retaining in add sub domain modal after closing * fix NavBar unit test * Make Domain Access Work Via Policies * Fix errors introduced after conflict resolutions * update render function in SubDomainsTable.component.tsx to accept an array of owners instead of a single owner * fix java checkstyle * fix py-test * format * Fix the domain e2e owner field type * Fix Failing Tests * fixed pytest list index * update userDomains and teamDomains to domains * Entity Domain to Domain for thread and changeEvent * FIx fields * @Ovveride * FIx * Remove Duplicate Field * Remove Duplicate Field * Fix Failing Test * fix domain related changes * fix subdomains loader * Fix Owners Order * Enforce Domain Permissions * fix domain cleanup * Fix Test * rever owner change --------- Co-authored-by: karanh37 <karanh37@gmail.com> Co-authored-by: Aniket Katkar <aniketkatkar97@gmail.com> Co-authored-by: Pere Miquel Brull <peremiquelbrull@gmail.com> Co-authored-by: sonikashah <sonikashah94@gmail.com> Co-authored-by: Sriharsha Chintalapani <harshach@users.noreply.github.com> Co-authored-by: Onkar Ravgan <onkar.10r@gmail.com> Co-authored-by: Karan Hotchandani <33024356+karanh37@users.noreply.github.com>
2024-08-02 10:16:14 +05:30
const searchRes = page.waitForResponse(
`/api/v1/search/query?q=${visibleName}&index=all&from=0&size=25&*`
[RbacDomain] RBAC with Domain Restrictions (#16586) * Add domain field to entity jsons * add subdomains ui * Add Domain To create Request * Typo fix * commit progress * allow multiple domains * - add userDomains and teamDomains * - Restrict Api Access * allow multiple domain support * - Add Listing Restricition - Add Search Restrictions * - Field Fix * - Inherit Team Domains * remove glossary filter from ui * - Fix Tag and User Filter * - Id -> FQN in create * - Missing domain on indexes * add domain in creation of team, user and glossary * fix merge conflicts * fix feedbacks * fix tests * add domain playwright * minor changes * fix domain fetching calls * Add Thread Listing with EntityDomain * Fixes for Team Join * Mkae list mutable * Add missing import * Fix Team Test * User Test case fix * Fix User Domain * Minor bug fixes related to sub domains * Fix data retaining in add sub domain modal after closing * fix NavBar unit test * Make Domain Access Work Via Policies * Fix errors introduced after conflict resolutions * update render function in SubDomainsTable.component.tsx to accept an array of owners instead of a single owner * fix java checkstyle * fix py-test * format * Fix the domain e2e owner field type * Fix Failing Tests * fixed pytest list index * update userDomains and teamDomains to domains * Entity Domain to Domain for thread and changeEvent * FIx fields * @Ovveride * FIx * Remove Duplicate Field * Remove Duplicate Field * Fix Failing Test * fix domain related changes * fix subdomains loader * Fix Owners Order * Enforce Domain Permissions * fix domain cleanup * Fix Test * rever owner change --------- Co-authored-by: karanh37 <karanh37@gmail.com> Co-authored-by: Aniket Katkar <aniketkatkar97@gmail.com> Co-authored-by: Pere Miquel Brull <peremiquelbrull@gmail.com> Co-authored-by: sonikashah <sonikashah94@gmail.com> Co-authored-by: Sriharsha Chintalapani <harshach@users.noreply.github.com> Co-authored-by: Onkar Ravgan <onkar.10r@gmail.com> Co-authored-by: Karan Hotchandani <33024356+karanh37@users.noreply.github.com>
2024-08-02 10:16:14 +05:30
);
await page
.getByTestId('asset-selection-modal')
.getByTestId('searchbar')
.fill(visibleName);
[RbacDomain] RBAC with Domain Restrictions (#16586) * Add domain field to entity jsons * add subdomains ui * Add Domain To create Request * Typo fix * commit progress * allow multiple domains * - add userDomains and teamDomains * - Restrict Api Access * allow multiple domain support * - Add Listing Restricition - Add Search Restrictions * - Field Fix * - Inherit Team Domains * remove glossary filter from ui * - Fix Tag and User Filter * - Id -> FQN in create * - Missing domain on indexes * add domain in creation of team, user and glossary * fix merge conflicts * fix feedbacks * fix tests * add domain playwright * minor changes * fix domain fetching calls * Add Thread Listing with EntityDomain * Fixes for Team Join * Mkae list mutable * Add missing import * Fix Team Test * User Test case fix * Fix User Domain * Minor bug fixes related to sub domains * Fix data retaining in add sub domain modal after closing * fix NavBar unit test * Make Domain Access Work Via Policies * Fix errors introduced after conflict resolutions * update render function in SubDomainsTable.component.tsx to accept an array of owners instead of a single owner * fix java checkstyle * fix py-test * format * Fix the domain e2e owner field type * Fix Failing Tests * fixed pytest list index * update userDomains and teamDomains to domains * Entity Domain to Domain for thread and changeEvent * FIx fields * @Ovveride * FIx * Remove Duplicate Field * Remove Duplicate Field * Fix Failing Test * fix domain related changes * fix subdomains loader * Fix Owners Order * Enforce Domain Permissions * fix domain cleanup * Fix Test * rever owner change --------- Co-authored-by: karanh37 <karanh37@gmail.com> Co-authored-by: Aniket Katkar <aniketkatkar97@gmail.com> Co-authored-by: Pere Miquel Brull <peremiquelbrull@gmail.com> Co-authored-by: sonikashah <sonikashah94@gmail.com> Co-authored-by: Sriharsha Chintalapani <harshach@users.noreply.github.com> Co-authored-by: Onkar Ravgan <onkar.10r@gmail.com> Co-authored-by: Karan Hotchandani <33024356+karanh37@users.noreply.github.com>
2024-08-02 10:16:14 +05:30
await searchRes;
await page.locator(`[data-testid="table-data-card_${fqn}"] input`).check();
await expect(
page.locator(
`[data-testid="table-data-card_${fqn}"] [data-testid="entity-header-name"]`
)
).toContainText(visibleName);
[RbacDomain] RBAC with Domain Restrictions (#16586) * Add domain field to entity jsons * add subdomains ui * Add Domain To create Request * Typo fix * commit progress * allow multiple domains * - add userDomains and teamDomains * - Restrict Api Access * allow multiple domain support * - Add Listing Restricition - Add Search Restrictions * - Field Fix * - Inherit Team Domains * remove glossary filter from ui * - Fix Tag and User Filter * - Id -> FQN in create * - Missing domain on indexes * add domain in creation of team, user and glossary * fix merge conflicts * fix feedbacks * fix tests * add domain playwright * minor changes * fix domain fetching calls * Add Thread Listing with EntityDomain * Fixes for Team Join * Mkae list mutable * Add missing import * Fix Team Test * User Test case fix * Fix User Domain * Minor bug fixes related to sub domains * Fix data retaining in add sub domain modal after closing * fix NavBar unit test * Make Domain Access Work Via Policies * Fix errors introduced after conflict resolutions * update render function in SubDomainsTable.component.tsx to accept an array of owners instead of a single owner * fix java checkstyle * fix py-test * format * Fix the domain e2e owner field type * Fix Failing Tests * fixed pytest list index * update userDomains and teamDomains to domains * Entity Domain to Domain for thread and changeEvent * FIx fields * @Ovveride * FIx * Remove Duplicate Field * Remove Duplicate Field * Fix Failing Test * fix domain related changes * fix subdomains loader * Fix Owners Order * Enforce Domain Permissions * fix domain cleanup * Fix Test * rever owner change --------- Co-authored-by: karanh37 <karanh37@gmail.com> Co-authored-by: Aniket Katkar <aniketkatkar97@gmail.com> Co-authored-by: Pere Miquel Brull <peremiquelbrull@gmail.com> Co-authored-by: sonikashah <sonikashah94@gmail.com> Co-authored-by: Sriharsha Chintalapani <harshach@users.noreply.github.com> Co-authored-by: Onkar Ravgan <onkar.10r@gmail.com> Co-authored-by: Karan Hotchandani <33024356+karanh37@users.noreply.github.com>
2024-08-02 10:16:14 +05:30
}
const assetsAddRes = page.waitForResponse(`/api/v1/domains/*/assets/add`);
const searchRes = page.waitForResponse((response) => {
const url = new URL(response.url());
const queryParams = new URLSearchParams(url.search);
const queryFilter = queryParams.get('query_filter');
return (
response
.url()
.includes('/api/v1/search/query?q=**&index=all&from=0&size=15') &&
queryFilter !== null &&
queryFilter !== ''
);
});
[RbacDomain] RBAC with Domain Restrictions (#16586) * Add domain field to entity jsons * add subdomains ui * Add Domain To create Request * Typo fix * commit progress * allow multiple domains * - add userDomains and teamDomains * - Restrict Api Access * allow multiple domain support * - Add Listing Restricition - Add Search Restrictions * - Field Fix * - Inherit Team Domains * remove glossary filter from ui * - Fix Tag and User Filter * - Id -> FQN in create * - Missing domain on indexes * add domain in creation of team, user and glossary * fix merge conflicts * fix feedbacks * fix tests * add domain playwright * minor changes * fix domain fetching calls * Add Thread Listing with EntityDomain * Fixes for Team Join * Mkae list mutable * Add missing import * Fix Team Test * User Test case fix * Fix User Domain * Minor bug fixes related to sub domains * Fix data retaining in add sub domain modal after closing * fix NavBar unit test * Make Domain Access Work Via Policies * Fix errors introduced after conflict resolutions * update render function in SubDomainsTable.component.tsx to accept an array of owners instead of a single owner * fix java checkstyle * fix py-test * format * Fix the domain e2e owner field type * Fix Failing Tests * fixed pytest list index * update userDomains and teamDomains to domains * Entity Domain to Domain for thread and changeEvent * FIx fields * @Ovveride * FIx * Remove Duplicate Field * Remove Duplicate Field * Fix Failing Test * fix domain related changes * fix subdomains loader * Fix Owners Order * Enforce Domain Permissions * fix domain cleanup * Fix Test * rever owner change --------- Co-authored-by: karanh37 <karanh37@gmail.com> Co-authored-by: Aniket Katkar <aniketkatkar97@gmail.com> Co-authored-by: Pere Miquel Brull <peremiquelbrull@gmail.com> Co-authored-by: sonikashah <sonikashah94@gmail.com> Co-authored-by: Sriharsha Chintalapani <harshach@users.noreply.github.com> Co-authored-by: Onkar Ravgan <onkar.10r@gmail.com> Co-authored-by: Karan Hotchandani <33024356+karanh37@users.noreply.github.com>
2024-08-02 10:16:14 +05:30
await page.getByTestId('save-btn').click();
await assetsAddRes;
await searchRes;
await page.reload();
await page.waitForLoadState('networkidle');
[RbacDomain] RBAC with Domain Restrictions (#16586) * Add domain field to entity jsons * add subdomains ui * Add Domain To create Request * Typo fix * commit progress * allow multiple domains * - add userDomains and teamDomains * - Restrict Api Access * allow multiple domain support * - Add Listing Restricition - Add Search Restrictions * - Field Fix * - Inherit Team Domains * remove glossary filter from ui * - Fix Tag and User Filter * - Id -> FQN in create * - Missing domain on indexes * add domain in creation of team, user and glossary * fix merge conflicts * fix feedbacks * fix tests * add domain playwright * minor changes * fix domain fetching calls * Add Thread Listing with EntityDomain * Fixes for Team Join * Mkae list mutable * Add missing import * Fix Team Test * User Test case fix * Fix User Domain * Minor bug fixes related to sub domains * Fix data retaining in add sub domain modal after closing * fix NavBar unit test * Make Domain Access Work Via Policies * Fix errors introduced after conflict resolutions * update render function in SubDomainsTable.component.tsx to accept an array of owners instead of a single owner * fix java checkstyle * fix py-test * format * Fix the domain e2e owner field type * Fix Failing Tests * fixed pytest list index * update userDomains and teamDomains to domains * Entity Domain to Domain for thread and changeEvent * FIx fields * @Ovveride * FIx * Remove Duplicate Field * Remove Duplicate Field * Fix Failing Test * fix domain related changes * fix subdomains loader * Fix Owners Order * Enforce Domain Permissions * fix domain cleanup * Fix Test * rever owner change --------- Co-authored-by: karanh37 <karanh37@gmail.com> Co-authored-by: Aniket Katkar <aniketkatkar97@gmail.com> Co-authored-by: Pere Miquel Brull <peremiquelbrull@gmail.com> Co-authored-by: sonikashah <sonikashah94@gmail.com> Co-authored-by: Sriharsha Chintalapani <harshach@users.noreply.github.com> Co-authored-by: Onkar Ravgan <onkar.10r@gmail.com> Co-authored-by: Karan Hotchandani <33024356+karanh37@users.noreply.github.com>
2024-08-02 10:16:14 +05:30
await checkAssetsCount(page, assets.length);
};
export const addServicesToDomain = async (
page: Page,
domain: Domain['data'],
assets: EntityClass[]
) => {
await goToAssetsTab(page, domain);
await page.getByTestId('domain-details-add-button').click();
await page.getByRole('menuitem', { name: 'Assets', exact: true }).click();
for (const asset of assets) {
const name = get(asset, 'name');
const fqn = get(asset, 'fullyQualifiedName');
const searchRes = page.waitForResponse(
`/api/v1/search/query?q=${name}&index=all&from=0&size=25&*`
);
await page
.getByTestId('asset-selection-modal')
.getByTestId('searchbar')
.fill(name);
await searchRes;
await page.locator(`[data-testid="table-data-card_${fqn}"] input`).check();
}
const assetsAddRes = page.waitForResponse(
`/api/v1/domains/${encodeURIComponent(
domain.fullyQualifiedName ?? ''
)}/assets/add`
);
await page.getByTestId('save-btn').click();
await assetsAddRes;
};
[RbacDomain] RBAC with Domain Restrictions (#16586) * Add domain field to entity jsons * add subdomains ui * Add Domain To create Request * Typo fix * commit progress * allow multiple domains * - add userDomains and teamDomains * - Restrict Api Access * allow multiple domain support * - Add Listing Restricition - Add Search Restrictions * - Field Fix * - Inherit Team Domains * remove glossary filter from ui * - Fix Tag and User Filter * - Id -> FQN in create * - Missing domain on indexes * add domain in creation of team, user and glossary * fix merge conflicts * fix feedbacks * fix tests * add domain playwright * minor changes * fix domain fetching calls * Add Thread Listing with EntityDomain * Fixes for Team Join * Mkae list mutable * Add missing import * Fix Team Test * User Test case fix * Fix User Domain * Minor bug fixes related to sub domains * Fix data retaining in add sub domain modal after closing * fix NavBar unit test * Make Domain Access Work Via Policies * Fix errors introduced after conflict resolutions * update render function in SubDomainsTable.component.tsx to accept an array of owners instead of a single owner * fix java checkstyle * fix py-test * format * Fix the domain e2e owner field type * Fix Failing Tests * fixed pytest list index * update userDomains and teamDomains to domains * Entity Domain to Domain for thread and changeEvent * FIx fields * @Ovveride * FIx * Remove Duplicate Field * Remove Duplicate Field * Fix Failing Test * fix domain related changes * fix subdomains loader * Fix Owners Order * Enforce Domain Permissions * fix domain cleanup * Fix Test * rever owner change --------- Co-authored-by: karanh37 <karanh37@gmail.com> Co-authored-by: Aniket Katkar <aniketkatkar97@gmail.com> Co-authored-by: Pere Miquel Brull <peremiquelbrull@gmail.com> Co-authored-by: sonikashah <sonikashah94@gmail.com> Co-authored-by: Sriharsha Chintalapani <harshach@users.noreply.github.com> Co-authored-by: Onkar Ravgan <onkar.10r@gmail.com> Co-authored-by: Karan Hotchandani <33024356+karanh37@users.noreply.github.com>
2024-08-02 10:16:14 +05:30
export const addAssetsToDataProduct = async (
page: Page,
dataProductFqn: string,
[RbacDomain] RBAC with Domain Restrictions (#16586) * Add domain field to entity jsons * add subdomains ui * Add Domain To create Request * Typo fix * commit progress * allow multiple domains * - add userDomains and teamDomains * - Restrict Api Access * allow multiple domain support * - Add Listing Restricition - Add Search Restrictions * - Field Fix * - Inherit Team Domains * remove glossary filter from ui * - Fix Tag and User Filter * - Id -> FQN in create * - Missing domain on indexes * add domain in creation of team, user and glossary * fix merge conflicts * fix feedbacks * fix tests * add domain playwright * minor changes * fix domain fetching calls * Add Thread Listing with EntityDomain * Fixes for Team Join * Mkae list mutable * Add missing import * Fix Team Test * User Test case fix * Fix User Domain * Minor bug fixes related to sub domains * Fix data retaining in add sub domain modal after closing * fix NavBar unit test * Make Domain Access Work Via Policies * Fix errors introduced after conflict resolutions * update render function in SubDomainsTable.component.tsx to accept an array of owners instead of a single owner * fix java checkstyle * fix py-test * format * Fix the domain e2e owner field type * Fix Failing Tests * fixed pytest list index * update userDomains and teamDomains to domains * Entity Domain to Domain for thread and changeEvent * FIx fields * @Ovveride * FIx * Remove Duplicate Field * Remove Duplicate Field * Fix Failing Test * fix domain related changes * fix subdomains loader * Fix Owners Order * Enforce Domain Permissions * fix domain cleanup * Fix Test * rever owner change --------- Co-authored-by: karanh37 <karanh37@gmail.com> Co-authored-by: Aniket Katkar <aniketkatkar97@gmail.com> Co-authored-by: Pere Miquel Brull <peremiquelbrull@gmail.com> Co-authored-by: sonikashah <sonikashah94@gmail.com> Co-authored-by: Sriharsha Chintalapani <harshach@users.noreply.github.com> Co-authored-by: Onkar Ravgan <onkar.10r@gmail.com> Co-authored-by: Karan Hotchandani <33024356+karanh37@users.noreply.github.com>
2024-08-02 10:16:14 +05:30
assets: EntityClass[]
) => {
await page.getByTestId('assets').click();
await checkAssetsCount(page, 0);
await expect(page.getByTestId('no-data-placeholder')).toContainText(
'Adding a new Asset is easy, just give it a spin!'
);
await page.getByTestId('data-product-details-add-button').click();
for (const asset of assets) {
const name = get(asset, 'entityResponseData.name');
const fqn = get(asset, 'entityResponseData.fullyQualifiedName');
const searchRes = page.waitForResponse(
`/api/v1/search/query?q=${name}&index=all&from=0&size=25&*`
);
await page.getByTestId('searchbar').fill(name);
await searchRes;
await page.locator(`[data-testid="table-data-card_${fqn}"] input`).check();
}
const assetsAddRes = page.waitForResponse(
`/api/v1/dataProducts/*/assets/add`
[RbacDomain] RBAC with Domain Restrictions (#16586) * Add domain field to entity jsons * add subdomains ui * Add Domain To create Request * Typo fix * commit progress * allow multiple domains * - add userDomains and teamDomains * - Restrict Api Access * allow multiple domain support * - Add Listing Restricition - Add Search Restrictions * - Field Fix * - Inherit Team Domains * remove glossary filter from ui * - Fix Tag and User Filter * - Id -> FQN in create * - Missing domain on indexes * add domain in creation of team, user and glossary * fix merge conflicts * fix feedbacks * fix tests * add domain playwright * minor changes * fix domain fetching calls * Add Thread Listing with EntityDomain * Fixes for Team Join * Mkae list mutable * Add missing import * Fix Team Test * User Test case fix * Fix User Domain * Minor bug fixes related to sub domains * Fix data retaining in add sub domain modal after closing * fix NavBar unit test * Make Domain Access Work Via Policies * Fix errors introduced after conflict resolutions * update render function in SubDomainsTable.component.tsx to accept an array of owners instead of a single owner * fix java checkstyle * fix py-test * format * Fix the domain e2e owner field type * Fix Failing Tests * fixed pytest list index * update userDomains and teamDomains to domains * Entity Domain to Domain for thread and changeEvent * FIx fields * @Ovveride * FIx * Remove Duplicate Field * Remove Duplicate Field * Fix Failing Test * fix domain related changes * fix subdomains loader * Fix Owners Order * Enforce Domain Permissions * fix domain cleanup * Fix Test * rever owner change --------- Co-authored-by: karanh37 <karanh37@gmail.com> Co-authored-by: Aniket Katkar <aniketkatkar97@gmail.com> Co-authored-by: Pere Miquel Brull <peremiquelbrull@gmail.com> Co-authored-by: sonikashah <sonikashah94@gmail.com> Co-authored-by: Sriharsha Chintalapani <harshach@users.noreply.github.com> Co-authored-by: Onkar Ravgan <onkar.10r@gmail.com> Co-authored-by: Karan Hotchandani <33024356+karanh37@users.noreply.github.com>
2024-08-02 10:16:14 +05:30
);
await page.getByTestId('save-btn').click();
await assetsAddRes;
await checkAssetsCount(page, assets.length);
for (const asset of assets) {
const fqn = get(asset, 'entityResponseData.fullyQualifiedName');
await page
.locator(
`[data-testid="table-data-card_${fqn}"] a[data-testid="entity-link"]`
)
.click();
await page.waitForLoadState('networkidle');
await expect(
page
.getByTestId('KnowledgePanel.DataProducts')
.getByTestId('data-products-list')
.getByTestId(`data-product-${dataProductFqn}`)
).toBeVisible();
await page.goBack();
await page.waitForLoadState('networkidle');
}
[RbacDomain] RBAC with Domain Restrictions (#16586) * Add domain field to entity jsons * add subdomains ui * Add Domain To create Request * Typo fix * commit progress * allow multiple domains * - add userDomains and teamDomains * - Restrict Api Access * allow multiple domain support * - Add Listing Restricition - Add Search Restrictions * - Field Fix * - Inherit Team Domains * remove glossary filter from ui * - Fix Tag and User Filter * - Id -> FQN in create * - Missing domain on indexes * add domain in creation of team, user and glossary * fix merge conflicts * fix feedbacks * fix tests * add domain playwright * minor changes * fix domain fetching calls * Add Thread Listing with EntityDomain * Fixes for Team Join * Mkae list mutable * Add missing import * Fix Team Test * User Test case fix * Fix User Domain * Minor bug fixes related to sub domains * Fix data retaining in add sub domain modal after closing * fix NavBar unit test * Make Domain Access Work Via Policies * Fix errors introduced after conflict resolutions * update render function in SubDomainsTable.component.tsx to accept an array of owners instead of a single owner * fix java checkstyle * fix py-test * format * Fix the domain e2e owner field type * Fix Failing Tests * fixed pytest list index * update userDomains and teamDomains to domains * Entity Domain to Domain for thread and changeEvent * FIx fields * @Ovveride * FIx * Remove Duplicate Field * Remove Duplicate Field * Fix Failing Test * fix domain related changes * fix subdomains loader * Fix Owners Order * Enforce Domain Permissions * fix domain cleanup * Fix Test * rever owner change --------- Co-authored-by: karanh37 <karanh37@gmail.com> Co-authored-by: Aniket Katkar <aniketkatkar97@gmail.com> Co-authored-by: Pere Miquel Brull <peremiquelbrull@gmail.com> Co-authored-by: sonikashah <sonikashah94@gmail.com> Co-authored-by: Sriharsha Chintalapani <harshach@users.noreply.github.com> Co-authored-by: Onkar Ravgan <onkar.10r@gmail.com> Co-authored-by: Karan Hotchandani <33024356+karanh37@users.noreply.github.com>
2024-08-02 10:16:14 +05:30
};
export const removeAssetsFromDataProduct = async (
page: Page,
dataProduct: DataProduct['data'],
assets: EntityClass[]
) => {
await page.getByTestId('assets').click();
for (const asset of assets) {
const fqn = get(asset, 'entityResponseData.fullyQualifiedName');
await page.locator(`[data-testid="table-data-card_${fqn}"] input`).check();
}
const assetsRemoveRes = page.waitForResponse(
`/api/v1/dataProducts/${encodeURIComponent(
dataProduct.fullyQualifiedName ?? ''
)}/assets/remove`
);
await page.getByTestId('delete-all-button').click();
await assetsRemoveRes;
};
export const setupAssetsForDomain = async (page: Page) => {
const { afterAction, apiContext } = await getApiContext(page);
const table = new TableClass();
const topic = new TopicClass();
const dashboard = new DashboardClass();
await Promise.all([
table.create(apiContext),
topic.create(apiContext),
dashboard.create(apiContext),
]);
[RbacDomain] RBAC with Domain Restrictions (#16586) * Add domain field to entity jsons * add subdomains ui * Add Domain To create Request * Typo fix * commit progress * allow multiple domains * - add userDomains and teamDomains * - Restrict Api Access * allow multiple domain support * - Add Listing Restricition - Add Search Restrictions * - Field Fix * - Inherit Team Domains * remove glossary filter from ui * - Fix Tag and User Filter * - Id -> FQN in create * - Missing domain on indexes * add domain in creation of team, user and glossary * fix merge conflicts * fix feedbacks * fix tests * add domain playwright * minor changes * fix domain fetching calls * Add Thread Listing with EntityDomain * Fixes for Team Join * Mkae list mutable * Add missing import * Fix Team Test * User Test case fix * Fix User Domain * Minor bug fixes related to sub domains * Fix data retaining in add sub domain modal after closing * fix NavBar unit test * Make Domain Access Work Via Policies * Fix errors introduced after conflict resolutions * update render function in SubDomainsTable.component.tsx to accept an array of owners instead of a single owner * fix java checkstyle * fix py-test * format * Fix the domain e2e owner field type * Fix Failing Tests * fixed pytest list index * update userDomains and teamDomains to domains * Entity Domain to Domain for thread and changeEvent * FIx fields * @Ovveride * FIx * Remove Duplicate Field * Remove Duplicate Field * Fix Failing Test * fix domain related changes * fix subdomains loader * Fix Owners Order * Enforce Domain Permissions * fix domain cleanup * Fix Test * rever owner change --------- Co-authored-by: karanh37 <karanh37@gmail.com> Co-authored-by: Aniket Katkar <aniketkatkar97@gmail.com> Co-authored-by: Pere Miquel Brull <peremiquelbrull@gmail.com> Co-authored-by: sonikashah <sonikashah94@gmail.com> Co-authored-by: Sriharsha Chintalapani <harshach@users.noreply.github.com> Co-authored-by: Onkar Ravgan <onkar.10r@gmail.com> Co-authored-by: Karan Hotchandani <33024356+karanh37@users.noreply.github.com>
2024-08-02 10:16:14 +05:30
const assetCleanup = async () => {
await Promise.all([
table.delete(apiContext),
topic.delete(apiContext),
dashboard.delete(apiContext),
]);
[RbacDomain] RBAC with Domain Restrictions (#16586) * Add domain field to entity jsons * add subdomains ui * Add Domain To create Request * Typo fix * commit progress * allow multiple domains * - add userDomains and teamDomains * - Restrict Api Access * allow multiple domain support * - Add Listing Restricition - Add Search Restrictions * - Field Fix * - Inherit Team Domains * remove glossary filter from ui * - Fix Tag and User Filter * - Id -> FQN in create * - Missing domain on indexes * add domain in creation of team, user and glossary * fix merge conflicts * fix feedbacks * fix tests * add domain playwright * minor changes * fix domain fetching calls * Add Thread Listing with EntityDomain * Fixes for Team Join * Mkae list mutable * Add missing import * Fix Team Test * User Test case fix * Fix User Domain * Minor bug fixes related to sub domains * Fix data retaining in add sub domain modal after closing * fix NavBar unit test * Make Domain Access Work Via Policies * Fix errors introduced after conflict resolutions * update render function in SubDomainsTable.component.tsx to accept an array of owners instead of a single owner * fix java checkstyle * fix py-test * format * Fix the domain e2e owner field type * Fix Failing Tests * fixed pytest list index * update userDomains and teamDomains to domains * Entity Domain to Domain for thread and changeEvent * FIx fields * @Ovveride * FIx * Remove Duplicate Field * Remove Duplicate Field * Fix Failing Test * fix domain related changes * fix subdomains loader * Fix Owners Order * Enforce Domain Permissions * fix domain cleanup * Fix Test * rever owner change --------- Co-authored-by: karanh37 <karanh37@gmail.com> Co-authored-by: Aniket Katkar <aniketkatkar97@gmail.com> Co-authored-by: Pere Miquel Brull <peremiquelbrull@gmail.com> Co-authored-by: sonikashah <sonikashah94@gmail.com> Co-authored-by: Sriharsha Chintalapani <harshach@users.noreply.github.com> Co-authored-by: Onkar Ravgan <onkar.10r@gmail.com> Co-authored-by: Karan Hotchandani <33024356+karanh37@users.noreply.github.com>
2024-08-02 10:16:14 +05:30
await afterAction();
};
return {
assets: [table, topic, dashboard],
assetCleanup,
};
};
export const createDataProduct = async (
page: Page,
dataProduct: DataProduct['data']
) => {
// Safety check to close potential domain not found alert
// Arrived due to parallel testing
await closeFirstPopupAlert(page);
await page.getByTestId('domain-details-add-button').click();
[RbacDomain] RBAC with Domain Restrictions (#16586) * Add domain field to entity jsons * add subdomains ui * Add Domain To create Request * Typo fix * commit progress * allow multiple domains * - add userDomains and teamDomains * - Restrict Api Access * allow multiple domain support * - Add Listing Restricition - Add Search Restrictions * - Field Fix * - Inherit Team Domains * remove glossary filter from ui * - Fix Tag and User Filter * - Id -> FQN in create * - Missing domain on indexes * add domain in creation of team, user and glossary * fix merge conflicts * fix feedbacks * fix tests * add domain playwright * minor changes * fix domain fetching calls * Add Thread Listing with EntityDomain * Fixes for Team Join * Mkae list mutable * Add missing import * Fix Team Test * User Test case fix * Fix User Domain * Minor bug fixes related to sub domains * Fix data retaining in add sub domain modal after closing * fix NavBar unit test * Make Domain Access Work Via Policies * Fix errors introduced after conflict resolutions * update render function in SubDomainsTable.component.tsx to accept an array of owners instead of a single owner * fix java checkstyle * fix py-test * format * Fix the domain e2e owner field type * Fix Failing Tests * fixed pytest list index * update userDomains and teamDomains to domains * Entity Domain to Domain for thread and changeEvent * FIx fields * @Ovveride * FIx * Remove Duplicate Field * Remove Duplicate Field * Fix Failing Test * fix domain related changes * fix subdomains loader * Fix Owners Order * Enforce Domain Permissions * fix domain cleanup * Fix Test * rever owner change --------- Co-authored-by: karanh37 <karanh37@gmail.com> Co-authored-by: Aniket Katkar <aniketkatkar97@gmail.com> Co-authored-by: Pere Miquel Brull <peremiquelbrull@gmail.com> Co-authored-by: sonikashah <sonikashah94@gmail.com> Co-authored-by: Sriharsha Chintalapani <harshach@users.noreply.github.com> Co-authored-by: Onkar Ravgan <onkar.10r@gmail.com> Co-authored-by: Karan Hotchandani <33024356+karanh37@users.noreply.github.com>
2024-08-02 10:16:14 +05:30
await page.getByRole('menuitem', { name: 'Data Products' }).click();
await expect(page.getByText('Add Data Product')).toBeVisible();
await fillCommonFormItems(page, dataProduct);
const saveRes = page.waitForResponse('/api/v1/dataProducts');
await page.getByTestId('save-data-product').click();
await saveRes;
};
export const verifyDataProductAssetsAfterDelete = async (
page: Page,
{
domain,
dataProduct1,
dataProduct2,
assets,
subDomain,
}: {
domain: Domain;
dataProduct1: DataProduct;
dataProduct2: DataProduct;
assets: EntityClass[];
subDomain?: SubDomain;
}
) => {
const { apiContext } = await getApiContext(page);
const newDataProduct1 = new DataProduct(domain, 'PW_DataProduct_Sales');
await test.step('Add assets to DataProduct Sales', async () => {
await redirectToHomePage(page);
await sidebarClick(page, SidebarItem.DOMAIN);
if (subDomain) {
await selectSubDomain(page, domain.data, subDomain.data);
await selectDataProductFromTab(page, dataProduct1.data);
} else {
await selectDataProduct(page, domain.data, dataProduct1.data);
}
await addAssetsToDataProduct(
page,
dataProduct1.responseData.fullyQualifiedName ?? '',
assets.slice(0, 2)
);
});
await test.step('Add assets to DataProduct Finance', async () => {
await redirectToHomePage(page);
await sidebarClick(page, SidebarItem.DOMAIN);
if (subDomain) {
await selectSubDomain(page, domain.data, subDomain.data);
await selectDataProductFromTab(page, dataProduct2.data);
} else {
await selectDataProduct(page, domain.data, dataProduct2.data);
}
await addAssetsToDataProduct(
page,
dataProduct2.responseData.fullyQualifiedName ?? '',
[assets[2]]
);
});
await test.step(
'Remove Data Product Sales and Create the same again',
async () => {
// Remove sales data product
await dataProduct1.delete(apiContext);
// Create sales data product again
await redirectToHomePage(page);
await sidebarClick(page, SidebarItem.DOMAIN);
if (subDomain) {
await selectSubDomain(page, domain.data, subDomain.data);
} else {
await selectDomain(page, domain.data);
}
await createDataProduct(page, newDataProduct1.data);
}
);
await test.step(
'Verify assets are not present in the newly created data product',
async () => {
await redirectToHomePage(page);
await sidebarClick(page, SidebarItem.DOMAIN);
if (subDomain) {
await selectSubDomain(page, domain.data, subDomain.data);
await selectDataProductFromTab(page, newDataProduct1.data);
} else {
await selectDataProduct(page, domain.data, newDataProduct1.data);
}
await checkAssetsCount(page, 0);
}
);
};
export const addTagsAndGlossaryToDomain = async (
page: Page,
{
tagFqn,
glossaryTermFqn,
isDomain = true,
}: {
tagFqn: string;
glossaryTermFqn: string;
isDomain?: boolean;
}
) => {
const addTagOrTerm = async (
containerType: 'tags' | 'glossary',
value: string
) => {
const container = `[data-testid="${containerType}-container"]`;
// Click add button
await page.locator(`${container} [data-testid="add-tag"]`).click();
// Fill and select tag/term
const input = page.locator(`${container} #tagsForm_tags`);
await input.click();
await input.fill(value);
const tag = page.getByTestId(`tag-${value}`);
if (containerType === 'glossary') {
// To avoid clicking on white space between checkbox and text
await tag.locator('.ant-select-tree-checkbox').click();
} else {
await tag.click();
}
// Save and wait for response
const updateResponse = page.waitForResponse(
(response) =>
response
.url()
.includes(`/api/v1/${isDomain ? 'domains' : 'dataProducts'}/`) &&
response.request().method() === 'PATCH'
);
await page.getByTestId('saveAssociatedTag').click();
await updateResponse;
};
// Add tag
await addTagOrTerm('tags', tagFqn);
// Add glossary term
await addTagOrTerm('glossary', glossaryTermFqn);
};
/**
* Verifies if the active domain is set to All Domains (DEFAULT_DOMAIN_VALUE)
*/
export const verifyActiveDomainIsDefault = async (page: Page) => {
await expect(page.getByTestId('domain-dropdown')).toContainText(
'All Domains'
);
};
/**
* Sets up a complete environment for domain ownership testing
* Creates user, policy, role, domain, data product and assigns ownership
* Returns all created objects and a cleanup function
*/
export const setupDomainOwnershipTest = async (apiContext: any) => {
// Create all necessary resources
const dataConsumerUser = new UserClass();
const id = uuid();
const domainForTest = new Domain({
name: `PW_Domain_Owner_Rule_Testing-${id}`,
displayName: `PW_Domain_Owner_Rule_Testing-${id}`,
description: 'playwright domain description',
domainType: 'Aggregate',
fullyQualifiedName: `PW_Domain_Owner_Rule_Testing-${id}`,
});
const dataProductForTest = new DataProduct(
domainForTest,
`PW_DataProduct_Owner_Rule-${id}`
);
await dataConsumerUser.create(apiContext);
await domainForTest.create(apiContext);
// Setup permissions
const dataConsumerPolicy = new PolicyClass();
const dataConsumerRole = new RolesClass();
// Create domain access policy
const domainRule = [
{
name: 'DomainRule',
description: '',
resources: ['dataProduct', 'domain'],
operations: ['All'],
effect: 'allow',
condition: 'isOwner()',
},
];
await dataConsumerPolicy.create(apiContext, domainRule);
await dataConsumerRole.create(apiContext, [
dataConsumerPolicy.responseData.name,
]);
await dataProductForTest.create(apiContext);
// Create team for the user
const dataConsumerTeam = new TeamClass({
name: `PW_data_consumer_team-${id}`,
displayName: `PW Data Consumer Team ${id}`,
description: 'playwright data consumer team description',
teamType: 'Group',
users: [dataConsumerUser.responseData.id ?? ''],
defaultRoles: [dataConsumerRole.responseData.id ?? ''],
});
await dataConsumerTeam.create(apiContext);
// Set domain ownership
await domainForTest.patch({
apiContext,
patchData: [
{
op: 'add',
path: '/owners/0',
value: {
id: dataConsumerUser.responseData.id,
type: 'user',
},
},
],
});
// Return cleanup function and all created resources
const cleanup = async (apiContext1: APIRequestContext) => {
await dataProductForTest.delete(apiContext1);
await domainForTest.delete(apiContext1);
await dataConsumerUser.delete(apiContext1);
await dataConsumerTeam.delete(apiContext1);
await dataConsumerPolicy.delete(apiContext1);
await dataConsumerRole.delete(apiContext1);
};
return {
dataConsumerUser,
domainForTest,
dataProductForTest,
dataConsumerTeam,
dataConsumerPolicy,
dataConsumerRole,
cleanup,
};
};