mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-10-04 13:26:30 +00:00
fix playwrights
This commit is contained in:
parent
192ccb6cf1
commit
35092f5d03
@ -57,7 +57,6 @@ import {
|
||||
selectDataProduct,
|
||||
selectDataProductFromTab,
|
||||
selectDomain,
|
||||
selectSubDomain,
|
||||
setupAssetsForDomain,
|
||||
setupDomainHasDomainTest,
|
||||
setupDomainOwnershipTest,
|
||||
@ -217,11 +216,7 @@ test.describe('Domains', () => {
|
||||
});
|
||||
|
||||
await test.step('Create DataProducts', async () => {
|
||||
await selectDomain(page, domain.data);
|
||||
await createDataProduct(page, dataProduct1.data);
|
||||
await redirectToHomePage(page);
|
||||
await sidebarClick(page, SidebarItem.DOMAIN);
|
||||
await selectDomain(page, domain.data);
|
||||
await createDataProduct(page, dataProduct2.data);
|
||||
});
|
||||
|
||||
@ -337,6 +332,8 @@ test.describe('Domains', () => {
|
||||
);
|
||||
|
||||
await test.step(`Set ${titleText} Custom Property`, async () => {
|
||||
await sidebarClick(page, SidebarItem.DATA_PRODUCT);
|
||||
await selectDataProduct(page, dataProduct1.data);
|
||||
for (const type of properties) {
|
||||
await dataProduct1.updateCustomProperty(
|
||||
page,
|
||||
@ -441,17 +438,25 @@ test.describe('Domains', () => {
|
||||
try {
|
||||
await domain.create(apiContext);
|
||||
await sidebarClick(page, SidebarItem.DOMAIN);
|
||||
await page.reload();
|
||||
await selectDomain(page, domain.data);
|
||||
|
||||
const subDomainApiRes = page.waitForResponse(
|
||||
'/api/v1/search/query?q=&index=domain_search_index&from=0&size=9&deleted=false*'
|
||||
);
|
||||
// Create sub domain
|
||||
await createSubDomain(page, subDomain.data);
|
||||
await redirectToHomePage(page);
|
||||
await sidebarClick(page, SidebarItem.DOMAIN);
|
||||
await page.waitForLoadState('networkidle');
|
||||
await subDomainApiRes;
|
||||
|
||||
await page.waitForSelector('[data-testid="loader"]', {
|
||||
state: 'detached',
|
||||
});
|
||||
await selectSubDomain(page, domain.data, subDomain.data);
|
||||
|
||||
const domainApiRes = page.waitForResponse('/api/v1/domains/name/*');
|
||||
|
||||
await page.getByRole('row', { name: subDomain.data.displayName }).click();
|
||||
|
||||
await domainApiRes;
|
||||
|
||||
await verifyDomain(page, subDomain.data, domain.data, false);
|
||||
// Follow domain
|
||||
await followEntity(page, EntityTypeEndpoint.Domain);
|
||||
@ -487,17 +492,32 @@ test.describe('Domains', () => {
|
||||
).not.toContainText(subDomain.data.displayName);
|
||||
|
||||
await sidebarClick(page, SidebarItem.DOMAIN);
|
||||
await page.waitForLoadState('networkidle');
|
||||
await page.waitForSelector('[data-testid="loader"]', {
|
||||
state: 'detached',
|
||||
});
|
||||
await selectSubDomain(page, domain.data, subDomain.data);
|
||||
await verifyDomain(page, subDomain.data, domain.data, false);
|
||||
|
||||
await selectDomain(page, domain.data);
|
||||
|
||||
// const selectSubDomainRes = page.waitForResponse(
|
||||
// '/api/v1/search/query?q=&index=domain_search_index*'
|
||||
// );
|
||||
// await page.getByTestId('subdomains').getByText('Sub Domains').click();
|
||||
// await selectSubDomainRes;
|
||||
// await verifyDomain(page, subDomain.data, domain.data, false);
|
||||
|
||||
const subDomainApiRes1 = page.waitForResponse(
|
||||
'/api/v1/search/query?q=&index=domain_search_index&from=0&size=9&deleted=false*'
|
||||
);
|
||||
|
||||
// Create new sub domain under the existing sub domain
|
||||
await createSubDomain(page, nestedSubDomain.data);
|
||||
await page.getByTestId('subdomains').getByText('Sub Domains').click();
|
||||
await page.getByTestId(nestedSubDomain.data.name).click();
|
||||
|
||||
await subDomainApiRes1;
|
||||
|
||||
await page.waitForSelector('[data-testid="loader"]', {
|
||||
state: 'detached',
|
||||
});
|
||||
|
||||
const domainApiRes1 = page.waitForResponse('/api/v1/domains/name/*');
|
||||
await page.getByRole('row', { name: subDomain.data.displayName }).click();
|
||||
await domainApiRes1;
|
||||
await verifyDomain(page, nestedSubDomain.data, domain.data, false);
|
||||
} finally {
|
||||
await nestedSubDomain.delete(apiContext);
|
||||
@ -706,13 +726,10 @@ test.describe('Domains', () => {
|
||||
const dataProduct = new DataProduct([domain1]);
|
||||
try {
|
||||
await domain1.create(apiContext);
|
||||
await page.reload();
|
||||
await redirectToHomePage(page);
|
||||
await sidebarClick(page, SidebarItem.DOMAIN);
|
||||
await selectDomain(page, domain1.data);
|
||||
await createDataProduct(page, dataProduct.data);
|
||||
|
||||
await redirectToHomePage(page);
|
||||
await sidebarClick(page, SidebarItem.DATA_PRODUCT);
|
||||
await selectDataProduct(page, dataProduct.data);
|
||||
|
||||
@ -958,13 +975,11 @@ test.describe('Domains Rbac', () => {
|
||||
// Add assets to domain 1
|
||||
await redirectToHomePage(page);
|
||||
await sidebarClick(page, SidebarItem.DOMAIN);
|
||||
await selectDomain(page, domain1.data);
|
||||
await addAssetsToDomain(page, domain1, domainAssset1);
|
||||
|
||||
// Add assets to domain 2
|
||||
await redirectToHomePage(page);
|
||||
await sidebarClick(page, SidebarItem.DOMAIN);
|
||||
await selectDomain(page, domain2.data);
|
||||
await addAssetsToDomain(page, domain2, domainAssset2);
|
||||
});
|
||||
|
||||
@ -1071,23 +1086,7 @@ test.describe('Data Consumer Domain Ownership', () => {
|
||||
'Check domain management permissions for data consumer owner',
|
||||
async () => {
|
||||
await sidebarClick(dataConsumerPage, SidebarItem.DOMAIN);
|
||||
await dataConsumerPage.waitForLoadState('networkidle');
|
||||
await dataConsumerPage.waitForSelector('[data-testid="loader"]', {
|
||||
state: 'detached',
|
||||
});
|
||||
|
||||
const permissionRes = dataConsumerPage.waitForResponse(
|
||||
'/api/v1/permissions/domain/*'
|
||||
);
|
||||
await dataConsumerPage
|
||||
.getByRole('menuitem', {
|
||||
name: testResources.domainForTest.data.displayName,
|
||||
})
|
||||
.locator('span')
|
||||
.click();
|
||||
|
||||
await permissionRes;
|
||||
|
||||
await selectDomain(dataConsumerPage, testResources.domainForTest.data);
|
||||
await dataConsumerPage.getByTestId('domain-details-add-button').click();
|
||||
|
||||
// check Data Products menu item is visible
|
||||
|
@ -86,7 +86,7 @@ test.describe('SubDomain Pagination', () => {
|
||||
'Navigate to subdomains tab and verify initial data load',
|
||||
async () => {
|
||||
const subDomainRes = page.waitForResponse(
|
||||
'/api/v1/search/query?q=*&from=0&size=50&index=domain_search_index&deleted=false&track_total_hits=true'
|
||||
'/api/v1/search/query?q=&index=domain_search_index&from=0&size=9*'
|
||||
);
|
||||
await page.getByTestId('subdomains').click();
|
||||
await subDomainRes;
|
||||
@ -97,26 +97,22 @@ test.describe('SubDomain Pagination', () => {
|
||||
await expect(page.locator('table')).toBeVisible();
|
||||
|
||||
await expect(page.locator('[data-testid="pagination"]')).toBeVisible();
|
||||
|
||||
// Verify current page shows page 1
|
||||
const tableRows = page.locator('table tbody tr');
|
||||
|
||||
await expect(tableRows).toHaveCount(9);
|
||||
}
|
||||
);
|
||||
|
||||
await test.step('Test pagination navigation', async () => {
|
||||
// Verify current page shows page 1
|
||||
const tableRows = page.locator('table tbody tr');
|
||||
|
||||
await expect(tableRows).toHaveCount(50);
|
||||
|
||||
const nextPageResponse = page.waitForResponse('/api/v1/search/query?*');
|
||||
await page.locator('[data-testid="next"]').click();
|
||||
await nextPageResponse;
|
||||
|
||||
await expect(tableRows).toHaveCount(10);
|
||||
|
||||
const prevPageResponse = page.waitForResponse('/api/v1/search/query?*');
|
||||
await page.locator('[data-testid="previous"]').click();
|
||||
await prevPageResponse;
|
||||
|
||||
await expect(tableRows).toHaveCount(50);
|
||||
});
|
||||
|
||||
await test.step(
|
||||
|
@ -213,7 +213,7 @@ export const selectDataProduct = async (
|
||||
.getByRole('textbox', { name: 'Search' });
|
||||
|
||||
const dpRes = page.waitForResponse(
|
||||
'/api/v1/search/query?q=&index=data_product_search_index*'
|
||||
'/api/v1/search/query?q=*&index=data_product_search_index*'
|
||||
);
|
||||
|
||||
await searchBox.fill(dataProduct.name);
|
||||
@ -376,7 +376,7 @@ export const createSubDomain = async (
|
||||
|
||||
await fillDomainForm(page, subDomain, false);
|
||||
const saveRes = page.waitForResponse('/api/v1/domains');
|
||||
await page.getByTestId('save-sub-domain').click();
|
||||
await page.getByTestId('save-btn').click();
|
||||
await saveRes;
|
||||
};
|
||||
|
||||
|
@ -42,6 +42,7 @@ export const usePaginationControls = (config: PaginationControlsConfig) => {
|
||||
const paginationControls = useMemo(
|
||||
() => (
|
||||
<Box
|
||||
data-testid="pagination"
|
||||
sx={{
|
||||
display: 'flex',
|
||||
justifyContent: 'space-between',
|
||||
@ -53,6 +54,7 @@ export const usePaginationControls = (config: PaginationControlsConfig) => {
|
||||
}}>
|
||||
<Button
|
||||
color="secondary"
|
||||
data-testid="previous"
|
||||
disabled={config.currentPage === 1}
|
||||
size="small"
|
||||
startIcon={
|
||||
@ -77,6 +79,7 @@ export const usePaginationControls = (config: PaginationControlsConfig) => {
|
||||
|
||||
<Button
|
||||
color="secondary"
|
||||
data-testid="next"
|
||||
disabled={config.currentPage === config.totalPages}
|
||||
endIcon={
|
||||
<ArrowRight
|
||||
|
Loading…
x
Reference in New Issue
Block a user