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