mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-10-20 13:23:52 +00:00
Chore(UI): Fix flaky playwright tests (#23156)
* Fix playwright tests - AdvancedSearch.spec.ts - Autopilot.spec.ts - DescriptionSuggestion.spec.ts - ObservabilityAlert.spec.ts - EntityVersionPages.spec.ts * Fix the flakiness while logging in * Update config to run only required tests * Revert description suggestion spec changes * Revert playwright config changes * Update playwright config * improve observability alert page navigation * Fix Description suggestion * Standardize left nav bar to close for all tests * Fix failing playwright tests
This commit is contained in:
parent
83ba3633ae
commit
4cd9f13d97
@ -98,20 +98,23 @@ test.describe('Advanced Search Custom Property', () => {
|
|||||||
await selectOption(
|
await selectOption(
|
||||||
page,
|
page,
|
||||||
ruleLocator.locator('.rule--field .ant-select'),
|
ruleLocator.locator('.rule--field .ant-select'),
|
||||||
'Custom Properties'
|
'Custom Properties',
|
||||||
|
true
|
||||||
);
|
);
|
||||||
|
|
||||||
await selectOption(
|
await selectOption(
|
||||||
page,
|
page,
|
||||||
ruleLocator.locator('.rule--field .ant-select'),
|
ruleLocator.locator('.rule--field .ant-select'),
|
||||||
'Table'
|
'Table',
|
||||||
|
true
|
||||||
);
|
);
|
||||||
|
|
||||||
// Perform click on custom property type to filter
|
// Perform click on custom property type to filter
|
||||||
await selectOption(
|
await selectOption(
|
||||||
page,
|
page,
|
||||||
ruleLocator.locator('.rule--field .ant-select'),
|
ruleLocator.locator('.rule--field .ant-select'),
|
||||||
durationPropertyName
|
durationPropertyName,
|
||||||
|
true
|
||||||
);
|
);
|
||||||
|
|
||||||
// Perform click on operator
|
// Perform click on operator
|
||||||
|
@ -27,7 +27,6 @@ import {
|
|||||||
verifyAllConditions,
|
verifyAllConditions,
|
||||||
} from '../../utils/advancedSearch';
|
} from '../../utils/advancedSearch';
|
||||||
import { createNewPage, redirectToHomePage } from '../../utils/common';
|
import { createNewPage, redirectToHomePage } from '../../utils/common';
|
||||||
import { assignTier } from '../../utils/entity';
|
|
||||||
import { sidebarClick } from '../../utils/sidebar';
|
import { sidebarClick } from '../../utils/sidebar';
|
||||||
|
|
||||||
const creationConfig: EntityDataClassCreationConfig = {
|
const creationConfig: EntityDataClassCreationConfig = {
|
||||||
@ -74,7 +73,6 @@ test.describe('Advanced Search', { tag: '@advanced-search' }, () => {
|
|||||||
await table.create(apiContext);
|
await table.create(apiContext);
|
||||||
|
|
||||||
// Add Owner & Tag to the table
|
// Add Owner & Tag to the table
|
||||||
await EntityDataClass.table1.visitEntityPage(page);
|
|
||||||
await EntityDataClass.table1.patch({
|
await EntityDataClass.table1.patch({
|
||||||
apiContext,
|
apiContext,
|
||||||
patchData: [
|
patchData: [
|
||||||
@ -106,7 +104,6 @@ test.describe('Advanced Search', { tag: '@advanced-search' }, () => {
|
|||||||
],
|
],
|
||||||
});
|
});
|
||||||
|
|
||||||
await EntityDataClass.table2.visitEntityPage(page);
|
|
||||||
await EntityDataClass.table2.patch({
|
await EntityDataClass.table2.patch({
|
||||||
apiContext,
|
apiContext,
|
||||||
patchData: [
|
patchData: [
|
||||||
@ -139,20 +136,38 @@ test.describe('Advanced Search', { tag: '@advanced-search' }, () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Add Tier To the topic 1
|
// Add Tier To the topic 1
|
||||||
await EntityDataClass.topic1.visitEntityPage(page);
|
await EntityDataClass.topic1.patch({
|
||||||
await assignTier(
|
apiContext,
|
||||||
page,
|
patchData: [
|
||||||
COMMON_TIER_TAG[0].name,
|
{
|
||||||
EntityDataClass.topic1.endpoint
|
op: 'add',
|
||||||
);
|
path: '/tags/0',
|
||||||
|
value: {
|
||||||
|
name: COMMON_TIER_TAG[0].name,
|
||||||
|
tagFQN: COMMON_TIER_TAG[0].fullyQualifiedName,
|
||||||
|
labelType: 'Manual',
|
||||||
|
state: 'Confirmed',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
});
|
||||||
|
|
||||||
// Add Tier To the topic 2
|
// Add Tier To the topic 2
|
||||||
await EntityDataClass.topic2.visitEntityPage(page);
|
await EntityDataClass.topic2.patch({
|
||||||
await assignTier(
|
apiContext,
|
||||||
page,
|
patchData: [
|
||||||
COMMON_TIER_TAG[1].name,
|
{
|
||||||
EntityDataClass.topic2.endpoint
|
op: 'add',
|
||||||
);
|
path: '/tags/0',
|
||||||
|
value: {
|
||||||
|
name: COMMON_TIER_TAG[1].name,
|
||||||
|
tagFQN: COMMON_TIER_TAG[1].fullyQualifiedName,
|
||||||
|
labelType: 'Manual',
|
||||||
|
state: 'Confirmed',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
});
|
||||||
|
|
||||||
// Update Search Criteria here
|
// Update Search Criteria here
|
||||||
searchCriteria = {
|
searchCriteria = {
|
||||||
|
@ -58,7 +58,6 @@ test.describe('Curated Assets', () => {
|
|||||||
test.slow(true);
|
test.slow(true);
|
||||||
|
|
||||||
await redirectToHomePage(page);
|
await redirectToHomePage(page);
|
||||||
await page.getByTestId('sidebar-toggle').click();
|
|
||||||
await setUserDefaultPersona(page, persona.responseData.displayName);
|
await setUserDefaultPersona(page, persona.responseData.displayName);
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -91,7 +90,8 @@ test.describe('Curated Assets', () => {
|
|||||||
await selectOption(
|
await selectOption(
|
||||||
page,
|
page,
|
||||||
ruleLocator.locator('.rule--field .ant-select'),
|
ruleLocator.locator('.rule--field .ant-select'),
|
||||||
'Owners'
|
'Owners',
|
||||||
|
true
|
||||||
);
|
);
|
||||||
|
|
||||||
await selectOption(
|
await selectOption(
|
||||||
@ -103,7 +103,8 @@ test.describe('Curated Assets', () => {
|
|||||||
await selectOption(
|
await selectOption(
|
||||||
page,
|
page,
|
||||||
ruleLocator.locator('.rule--value .ant-select'),
|
ruleLocator.locator('.rule--value .ant-select'),
|
||||||
'admin'
|
'admin',
|
||||||
|
true
|
||||||
);
|
);
|
||||||
|
|
||||||
await page.getByRole('button', { name: 'Add Condition' }).click();
|
await page.getByRole('button', { name: 'Add Condition' }).click();
|
||||||
@ -112,7 +113,8 @@ test.describe('Curated Assets', () => {
|
|||||||
await selectOption(
|
await selectOption(
|
||||||
page,
|
page,
|
||||||
ruleLocator2.locator('.rule--field .ant-select'),
|
ruleLocator2.locator('.rule--field .ant-select'),
|
||||||
'Display Name'
|
'Display Name',
|
||||||
|
true
|
||||||
);
|
);
|
||||||
|
|
||||||
await selectOption(
|
await selectOption(
|
||||||
@ -124,7 +126,8 @@ test.describe('Curated Assets', () => {
|
|||||||
await selectOption(
|
await selectOption(
|
||||||
page,
|
page,
|
||||||
ruleLocator2.locator('.rule--value .ant-select'),
|
ruleLocator2.locator('.rule--value .ant-select'),
|
||||||
'arcs'
|
'arcs',
|
||||||
|
true
|
||||||
);
|
);
|
||||||
|
|
||||||
await expect(page.locator('[data-testid="saveButton"]')).toBeEnabled();
|
await expect(page.locator('[data-testid="saveButton"]')).toBeEnabled();
|
||||||
|
@ -25,7 +25,7 @@ const user2 = new UserClass();
|
|||||||
const user3 = new UserClass();
|
const user3 = new UserClass();
|
||||||
let entityLinkList: string[];
|
let entityLinkList: string[];
|
||||||
|
|
||||||
test.describe('Description Suggestions Table Entity', () => {
|
test.describe.serial('Description Suggestions Table Entity', () => {
|
||||||
test.slow(true);
|
test.slow(true);
|
||||||
|
|
||||||
test.beforeAll('Setup pre-requests', async ({ browser }) => {
|
test.beforeAll('Setup pre-requests', async ({ browser }) => {
|
||||||
@ -49,16 +49,6 @@ test.describe('Description Suggestions Table Entity', () => {
|
|||||||
await afterAction();
|
await afterAction();
|
||||||
});
|
});
|
||||||
|
|
||||||
test.afterAll('Cleanup', async ({ browser }) => {
|
|
||||||
const { afterAction, apiContext } = await performAdminLogin(browser);
|
|
||||||
await table.delete(apiContext);
|
|
||||||
await table2.delete(apiContext);
|
|
||||||
await user1.delete(apiContext);
|
|
||||||
await user2.delete(apiContext);
|
|
||||||
await user3.delete(apiContext);
|
|
||||||
await afterAction();
|
|
||||||
});
|
|
||||||
|
|
||||||
test('View, Close, Reject and Accept the Suggestions', async ({
|
test('View, Close, Reject and Accept the Suggestions', async ({
|
||||||
browser,
|
browser,
|
||||||
}) => {
|
}) => {
|
||||||
@ -233,6 +223,12 @@ test.describe('Description Suggestions Table Entity', () => {
|
|||||||
|
|
||||||
test('Reject All Suggestions', async ({ browser }) => {
|
test('Reject All Suggestions', async ({ browser }) => {
|
||||||
const { page, afterAction } = await performAdminLogin(browser);
|
const { page, afterAction } = await performAdminLogin(browser);
|
||||||
|
const { afterAction: afterAction2, apiContext: apiContext2 } =
|
||||||
|
await performUserLogin(browser, user1);
|
||||||
|
|
||||||
|
for (const entityLink of entityLinkList) {
|
||||||
|
await createTableDescriptionSuggestions(apiContext2, entityLink);
|
||||||
|
}
|
||||||
|
|
||||||
await redirectToHomePage(page);
|
await redirectToHomePage(page);
|
||||||
await table.visitEntityPage(page);
|
await table.visitEntityPage(page);
|
||||||
@ -244,13 +240,13 @@ test.describe('Description Suggestions Table Entity', () => {
|
|||||||
// Click the first avatar
|
// Click the first avatar
|
||||||
await allAvatarSuggestion.nth(0).click();
|
await allAvatarSuggestion.nth(0).click();
|
||||||
|
|
||||||
const acceptResponse = page.waitForResponse(
|
const rejectResponse = page.waitForResponse(
|
||||||
'/api/v1/suggestions/reject-all?userId=*&entityFQN=*&suggestionType=SuggestDescription'
|
'/api/v1/suggestions/reject-all?userId=*&entityFQN=*&suggestionType=SuggestDescription'
|
||||||
);
|
);
|
||||||
|
|
||||||
await page.click(`[data-testid="reject-all-suggestions"]`);
|
await page.click(`[data-testid="reject-all-suggestions"]`);
|
||||||
|
|
||||||
await acceptResponse;
|
await rejectResponse;
|
||||||
|
|
||||||
// check the last column description
|
// check the last column description
|
||||||
await expect(
|
await expect(
|
||||||
@ -265,6 +261,7 @@ test.describe('Description Suggestions Table Entity', () => {
|
|||||||
await expect(page.getByTestId('close-suggestion')).not.toBeVisible();
|
await expect(page.getByTestId('close-suggestion')).not.toBeVisible();
|
||||||
|
|
||||||
await afterAction();
|
await afterAction();
|
||||||
|
await afterAction2();
|
||||||
});
|
});
|
||||||
|
|
||||||
test('Fetch on avatar click and then all Pending Suggestions button click', async ({
|
test('Fetch on avatar click and then all Pending Suggestions button click', async ({
|
||||||
@ -311,7 +308,7 @@ test.describe('Description Suggestions Table Entity', () => {
|
|||||||
.getByTestId('profile-avatar');
|
.getByTestId('profile-avatar');
|
||||||
|
|
||||||
// Click the first avatar
|
// Click the first avatar
|
||||||
await expect(allAvatarSuggestion).toHaveCount(4);
|
await expect(allAvatarSuggestion).toHaveCount(3);
|
||||||
|
|
||||||
await afterAction();
|
await afterAction();
|
||||||
await afterAction2();
|
await afterAction2();
|
||||||
@ -375,7 +372,7 @@ test.describe('Description Suggestions Table Entity', () => {
|
|||||||
page.getByTestId('more-suggestion-button')
|
page.getByTestId('more-suggestion-button')
|
||||||
).not.toBeVisible();
|
).not.toBeVisible();
|
||||||
|
|
||||||
await expect(allAvatarSuggestion).toHaveCount(1);
|
await expect(allAvatarSuggestion).toHaveCount(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -78,7 +78,11 @@ test.describe('Navigation Blocker Tests', () => {
|
|||||||
).toBeEnabled();
|
).toBeEnabled();
|
||||||
|
|
||||||
// Try to navigate to another page by clicking a sidebar link
|
// Try to navigate to another page by clicking a sidebar link
|
||||||
await adminPage.locator('[data-testid="app-bar-item-settings"]').click();
|
await adminPage
|
||||||
|
.locator(
|
||||||
|
'[data-menu-id*="settings"] [data-testid="app-bar-item-settings"]'
|
||||||
|
)
|
||||||
|
.click();
|
||||||
|
|
||||||
// Navigation blocker modal should appear
|
// Navigation blocker modal should appear
|
||||||
await expect(adminPage.locator('.ant-modal')).toBeVisible();
|
await expect(adminPage.locator('.ant-modal')).toBeVisible();
|
||||||
@ -114,7 +118,11 @@ test.describe('Navigation Blocker Tests', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Try to navigate away
|
// Try to navigate away
|
||||||
await adminPage.locator('[data-testid="app-bar-item-settings"]').click();
|
await adminPage
|
||||||
|
.locator(
|
||||||
|
'[data-menu-id*="settings"] [data-testid="app-bar-item-settings"]'
|
||||||
|
)
|
||||||
|
.click();
|
||||||
|
|
||||||
// Modal should appear
|
// Modal should appear
|
||||||
await expect(adminPage.locator('.ant-modal')).toBeVisible();
|
await expect(adminPage.locator('.ant-modal')).toBeVisible();
|
||||||
@ -153,7 +161,11 @@ test.describe('Navigation Blocker Tests', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Try to navigate to settings page
|
// Try to navigate to settings page
|
||||||
await adminPage.locator('[data-testid="app-bar-item-settings"]').click();
|
await adminPage
|
||||||
|
.locator(
|
||||||
|
'[data-menu-id*="settings"] [data-testid="app-bar-item-settings"]'
|
||||||
|
)
|
||||||
|
.click();
|
||||||
|
|
||||||
// Modal should appear
|
// Modal should appear
|
||||||
await expect(adminPage.locator('.ant-modal')).toBeVisible();
|
await expect(adminPage.locator('.ant-modal')).toBeVisible();
|
||||||
@ -204,7 +216,11 @@ test.describe('Navigation Blocker Tests', () => {
|
|||||||
).toBeDisabled();
|
).toBeDisabled();
|
||||||
|
|
||||||
// Try to navigate away after saving
|
// Try to navigate away after saving
|
||||||
await adminPage.locator('[data-testid="app-bar-item-settings"]').click();
|
await adminPage
|
||||||
|
.locator(
|
||||||
|
'[data-menu-id*="settings"] [data-testid="app-bar-item-settings"]'
|
||||||
|
)
|
||||||
|
.click();
|
||||||
|
|
||||||
// Navigation should happen immediately without modal
|
// Navigation should happen immediately without modal
|
||||||
await adminPage.waitForLoadState('networkidle');
|
await adminPage.waitForLoadState('networkidle');
|
||||||
|
@ -129,13 +129,15 @@ test('CustomProperty Dashboard Filter', async ({ page }) => {
|
|||||||
await selectOption(
|
await selectOption(
|
||||||
page,
|
page,
|
||||||
ruleLocator.locator('.rule--field .ant-select'),
|
ruleLocator.locator('.rule--field .ant-select'),
|
||||||
'Custom Properties'
|
'Custom Properties',
|
||||||
|
true
|
||||||
);
|
);
|
||||||
|
|
||||||
await selectOption(
|
await selectOption(
|
||||||
page,
|
page,
|
||||||
ruleLocator.locator('.rule--field .ant-select'),
|
ruleLocator.locator('.rule--field .ant-select'),
|
||||||
'Dashboard'
|
'Dashboard',
|
||||||
|
true
|
||||||
);
|
);
|
||||||
|
|
||||||
// Select Custom Property Field when we want filter
|
// Select Custom Property Field when we want filter
|
||||||
|
@ -57,7 +57,6 @@ base.afterAll('Cleanup', async ({ browser }) => {
|
|||||||
test.describe('Customize Landing Page Flow', () => {
|
test.describe('Customize Landing Page Flow', () => {
|
||||||
test('Check all default widget present', async ({ adminPage }) => {
|
test('Check all default widget present', async ({ adminPage }) => {
|
||||||
await redirectToHomePage(adminPage);
|
await redirectToHomePage(adminPage);
|
||||||
await adminPage.getByTestId('welcome-screen-close-btn').click();
|
|
||||||
await checkAllDefaultWidgets(adminPage);
|
await checkAllDefaultWidgets(adminPage);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -40,7 +40,7 @@ const test = base.extend<{ page: Page }>({
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
base.beforeAll('Setup pre-requests', async ({ browser, page }) => {
|
base.beforeAll('Setup pre-requests', async ({ browser }) => {
|
||||||
const { afterAction, apiContext } = await performAdminLogin(browser);
|
const { afterAction, apiContext } = await performAdminLogin(browser);
|
||||||
await adminUser.create(apiContext);
|
await adminUser.create(apiContext);
|
||||||
await adminUser.setAdminRole(apiContext);
|
await adminUser.setAdminRole(apiContext);
|
||||||
@ -60,16 +60,16 @@ test.describe('Widgets', () => {
|
|||||||
test.slow(true);
|
test.slow(true);
|
||||||
|
|
||||||
await redirectToHomePage(page);
|
await redirectToHomePage(page);
|
||||||
await page.getByTestId('sidebar-toggle').click();
|
|
||||||
await setUserDefaultPersona(page, persona.responseData.displayName);
|
await setUserDefaultPersona(page, persona.responseData.displayName);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test.beforeEach(async ({ page }) => {
|
||||||
|
await redirectToHomePage(page);
|
||||||
|
});
|
||||||
|
|
||||||
test('Activity Feed', async ({ page }) => {
|
test('Activity Feed', async ({ page }) => {
|
||||||
test.slow(true);
|
test.slow(true);
|
||||||
|
|
||||||
await redirectToHomePage(page);
|
|
||||||
await page.getByTestId('welcome-screen-close-btn').click();
|
|
||||||
|
|
||||||
await expect(page.getByTestId('KnowledgePanel.ActivityFeed')).toBeVisible();
|
await expect(page.getByTestId('KnowledgePanel.ActivityFeed')).toBeVisible();
|
||||||
|
|
||||||
await verifyActivityFeedFilters(page, 'KnowledgePanel.ActivityFeed');
|
await verifyActivityFeedFilters(page, 'KnowledgePanel.ActivityFeed');
|
||||||
@ -90,9 +90,6 @@ test.describe('Widgets', () => {
|
|||||||
test('Data Assets', async ({ page }) => {
|
test('Data Assets', async ({ page }) => {
|
||||||
test.slow(true);
|
test.slow(true);
|
||||||
|
|
||||||
await redirectToHomePage(page);
|
|
||||||
await page.getByTestId('welcome-screen-close-btn').click();
|
|
||||||
|
|
||||||
await expect(page.getByTestId('KnowledgePanel.DataAssets')).toBeVisible();
|
await expect(page.getByTestId('KnowledgePanel.DataAssets')).toBeVisible();
|
||||||
|
|
||||||
await removeAndVerifyWidget(
|
await removeAndVerifyWidget(
|
||||||
@ -111,9 +108,6 @@ test.describe('Widgets', () => {
|
|||||||
test('My Data', async ({ page }) => {
|
test('My Data', async ({ page }) => {
|
||||||
test.slow(true);
|
test.slow(true);
|
||||||
|
|
||||||
await redirectToHomePage(page);
|
|
||||||
await page.getByTestId('welcome-screen-close-btn').click();
|
|
||||||
|
|
||||||
await expect(page.getByTestId('KnowledgePanel.MyData')).toBeVisible();
|
await expect(page.getByTestId('KnowledgePanel.MyData')).toBeVisible();
|
||||||
|
|
||||||
await verifyDataFilters(page, 'KnowledgePanel.MyData');
|
await verifyDataFilters(page, 'KnowledgePanel.MyData');
|
||||||
@ -134,9 +128,6 @@ test.describe('Widgets', () => {
|
|||||||
test('KPI', async ({ page }) => {
|
test('KPI', async ({ page }) => {
|
||||||
test.slow(true);
|
test.slow(true);
|
||||||
|
|
||||||
await redirectToHomePage(page);
|
|
||||||
await page.getByTestId('welcome-screen-close-btn').click();
|
|
||||||
|
|
||||||
await expect(page.getByTestId('KnowledgePanel.KPI')).toBeVisible();
|
await expect(page.getByTestId('KnowledgePanel.KPI')).toBeVisible();
|
||||||
|
|
||||||
await removeAndVerifyWidget(
|
await removeAndVerifyWidget(
|
||||||
@ -155,9 +146,6 @@ test.describe('Widgets', () => {
|
|||||||
test('Total Data Assets', async ({ page }) => {
|
test('Total Data Assets', async ({ page }) => {
|
||||||
test.slow(true);
|
test.slow(true);
|
||||||
|
|
||||||
await redirectToHomePage(page);
|
|
||||||
await page.getByTestId('welcome-screen-close-btn').click();
|
|
||||||
|
|
||||||
await expect(page.getByTestId('KnowledgePanel.TotalAssets')).toBeVisible();
|
await expect(page.getByTestId('KnowledgePanel.TotalAssets')).toBeVisible();
|
||||||
|
|
||||||
await verifyTotalDataAssetsFilters(page, 'KnowledgePanel.TotalAssets');
|
await verifyTotalDataAssetsFilters(page, 'KnowledgePanel.TotalAssets');
|
||||||
@ -178,9 +166,6 @@ test.describe('Widgets', () => {
|
|||||||
test('Following Assets', async ({ page }) => {
|
test('Following Assets', async ({ page }) => {
|
||||||
test.slow(true);
|
test.slow(true);
|
||||||
|
|
||||||
await redirectToHomePage(page);
|
|
||||||
await page.getByTestId('welcome-screen-close-btn').click();
|
|
||||||
|
|
||||||
await expect(page.getByTestId('KnowledgePanel.Following')).toBeVisible();
|
await expect(page.getByTestId('KnowledgePanel.Following')).toBeVisible();
|
||||||
|
|
||||||
await verifyDataFilters(page, 'KnowledgePanel.Following');
|
await verifyDataFilters(page, 'KnowledgePanel.Following');
|
||||||
@ -201,9 +186,6 @@ test.describe('Widgets', () => {
|
|||||||
test('Domains', async ({ page }) => {
|
test('Domains', async ({ page }) => {
|
||||||
test.slow(true);
|
test.slow(true);
|
||||||
|
|
||||||
await redirectToHomePage(page);
|
|
||||||
await page.getByTestId('welcome-screen-close-btn').click();
|
|
||||||
|
|
||||||
await expect(page.getByTestId('KnowledgePanel.Domains')).not.toBeVisible();
|
await expect(page.getByTestId('KnowledgePanel.Domains')).not.toBeVisible();
|
||||||
|
|
||||||
await addAndVerifyWidget(
|
await addAndVerifyWidget(
|
||||||
@ -224,9 +206,6 @@ test.describe('Widgets', () => {
|
|||||||
test('My Tasks', async ({ page }) => {
|
test('My Tasks', async ({ page }) => {
|
||||||
test.slow(true);
|
test.slow(true);
|
||||||
|
|
||||||
await redirectToHomePage(page);
|
|
||||||
await page.getByTestId('welcome-screen-close-btn').click();
|
|
||||||
|
|
||||||
await expect(page.getByTestId('KnowledgePanel.MyTask')).not.toBeVisible();
|
await expect(page.getByTestId('KnowledgePanel.MyTask')).not.toBeVisible();
|
||||||
|
|
||||||
await addAndVerifyWidget(
|
await addAndVerifyWidget(
|
||||||
|
@ -13,7 +13,6 @@
|
|||||||
import { expect, Page, test } from '@playwright/test';
|
import { expect, Page, test } from '@playwright/test';
|
||||||
import { UserClass } from '../../support/user/UserClass';
|
import { UserClass } from '../../support/user/UserClass';
|
||||||
import { performAdminLogin } from '../../utils/admin';
|
import { performAdminLogin } from '../../utils/admin';
|
||||||
import { redirectToHomePage } from '../../utils/common';
|
|
||||||
import { waitForAllLoadersToDisappear } from '../../utils/entity';
|
import { waitForAllLoadersToDisappear } from '../../utils/entity';
|
||||||
|
|
||||||
const user = new UserClass();
|
const user = new UserClass();
|
||||||
@ -157,7 +156,6 @@ test.describe('Tour should work properly', () => {
|
|||||||
|
|
||||||
test.beforeEach('Visit entity details page', async ({ page }) => {
|
test.beforeEach('Visit entity details page', async ({ page }) => {
|
||||||
await user.login(page);
|
await user.login(page);
|
||||||
await redirectToHomePage(page);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
test('Tour should work from help section', async ({ page }) => {
|
test('Tour should work from help section', async ({ page }) => {
|
||||||
|
@ -183,7 +183,8 @@ test.describe('Data Contracts', () => {
|
|||||||
await selectOption(
|
await selectOption(
|
||||||
page,
|
page,
|
||||||
ruleLocator.locator('.group--field .ant-select'),
|
ruleLocator.locator('.group--field .ant-select'),
|
||||||
DATA_CONTRACT_SEMANTICS1.rules[0].field
|
DATA_CONTRACT_SEMANTICS1.rules[0].field,
|
||||||
|
true
|
||||||
);
|
);
|
||||||
await selectOption(
|
await selectOption(
|
||||||
page,
|
page,
|
||||||
@ -193,7 +194,8 @@ test.describe('Data Contracts', () => {
|
|||||||
await selectOption(
|
await selectOption(
|
||||||
page,
|
page,
|
||||||
ruleLocator.locator('.rule--value .ant-select'),
|
ruleLocator.locator('.rule--value .ant-select'),
|
||||||
'admin'
|
'admin',
|
||||||
|
true
|
||||||
);
|
);
|
||||||
await page.getByRole('button', { name: 'Add New Rule' }).click();
|
await page.getByRole('button', { name: 'Add New Rule' }).click();
|
||||||
|
|
||||||
@ -203,7 +205,8 @@ test.describe('Data Contracts', () => {
|
|||||||
await selectOption(
|
await selectOption(
|
||||||
page,
|
page,
|
||||||
ruleLocator2.locator('.rule--field .ant-select'),
|
ruleLocator2.locator('.rule--field .ant-select'),
|
||||||
DATA_CONTRACT_SEMANTICS1.rules[1].field
|
DATA_CONTRACT_SEMANTICS1.rules[1].field,
|
||||||
|
true
|
||||||
);
|
);
|
||||||
await selectOption(
|
await selectOption(
|
||||||
page,
|
page,
|
||||||
@ -241,7 +244,8 @@ test.describe('Data Contracts', () => {
|
|||||||
await selectOption(
|
await selectOption(
|
||||||
page,
|
page,
|
||||||
ruleLocator3.locator('.group--field .ant-select'),
|
ruleLocator3.locator('.group--field .ant-select'),
|
||||||
DATA_CONTRACT_SEMANTICS2.rules[0].field
|
DATA_CONTRACT_SEMANTICS2.rules[0].field,
|
||||||
|
true
|
||||||
);
|
);
|
||||||
await selectOption(
|
await selectOption(
|
||||||
page,
|
page,
|
||||||
@ -596,7 +600,8 @@ test.describe('Data Contracts', () => {
|
|||||||
await selectOption(
|
await selectOption(
|
||||||
page,
|
page,
|
||||||
ruleLocator.locator('.group--field .ant-select'),
|
ruleLocator.locator('.group--field .ant-select'),
|
||||||
DATA_CONTRACT_SEMANTICS1.rules[0].field
|
DATA_CONTRACT_SEMANTICS1.rules[0].field,
|
||||||
|
true
|
||||||
);
|
);
|
||||||
await selectOption(
|
await selectOption(
|
||||||
page,
|
page,
|
||||||
@ -606,7 +611,8 @@ test.describe('Data Contracts', () => {
|
|||||||
await selectOption(
|
await selectOption(
|
||||||
page,
|
page,
|
||||||
ruleLocator.locator('.rule--value .ant-select'),
|
ruleLocator.locator('.rule--value .ant-select'),
|
||||||
'admin'
|
'admin',
|
||||||
|
true
|
||||||
);
|
);
|
||||||
await page.getByTestId('save-semantic-button').click();
|
await page.getByTestId('save-semantic-button').click();
|
||||||
|
|
||||||
|
@ -11,6 +11,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
import { expect, Page, test as base } from '@playwright/test';
|
import { expect, Page, test as base } from '@playwright/test';
|
||||||
|
import { COMMON_TIER_TAG } from '../../constant/common';
|
||||||
import { BIG_ENTITY_DELETE_TIMEOUT } from '../../constant/delete';
|
import { BIG_ENTITY_DELETE_TIMEOUT } from '../../constant/delete';
|
||||||
import { EntityDataClass } from '../../support/entity/EntityDataClass';
|
import { EntityDataClass } from '../../support/entity/EntityDataClass';
|
||||||
import { EntityDataClassCreationConfig } from '../../support/entity/EntityDataClass.interface';
|
import { EntityDataClassCreationConfig } from '../../support/entity/EntityDataClass.interface';
|
||||||
@ -19,14 +20,12 @@ import { UserClass } from '../../support/user/UserClass';
|
|||||||
import { performAdminLogin } from '../../utils/admin';
|
import { performAdminLogin } from '../../utils/admin';
|
||||||
import {
|
import {
|
||||||
descriptionBoxReadOnly,
|
descriptionBoxReadOnly,
|
||||||
|
getApiContext,
|
||||||
redirectToHomePage,
|
redirectToHomePage,
|
||||||
|
reloadAndWaitForNetworkIdle,
|
||||||
toastNotification,
|
toastNotification,
|
||||||
} from '../../utils/common';
|
} from '../../utils/common';
|
||||||
import {
|
import { getEntityDataTypeDisplayPatch } from '../../utils/entity';
|
||||||
addMultiOwner,
|
|
||||||
assignTier,
|
|
||||||
getEntityDataTypeDisplayPatch,
|
|
||||||
} from '../../utils/entity';
|
|
||||||
|
|
||||||
const entityCreationConfig: EntityDataClassCreationConfig = {
|
const entityCreationConfig: EntityDataClassCreationConfig = {
|
||||||
apiEndpoint: true,
|
apiEndpoint: true,
|
||||||
@ -158,6 +157,7 @@ test.describe('Entity Version pages', () => {
|
|||||||
test(`${entity.getType()}`, async ({ page }) => {
|
test(`${entity.getType()}`, async ({ page }) => {
|
||||||
test.slow();
|
test.slow();
|
||||||
|
|
||||||
|
const { apiContext } = await getApiContext(page);
|
||||||
await entity.visitEntityPage(page);
|
await entity.visitEntityPage(page);
|
||||||
const versionDetailResponse = page.waitForResponse(`**/versions/0.2`);
|
const versionDetailResponse = page.waitForResponse(`**/versions/0.2`);
|
||||||
await page.locator('[data-testid="version-button"]').click();
|
await page.locator('[data-testid="version-button"]').click();
|
||||||
@ -194,17 +194,24 @@ test.describe('Entity Version pages', () => {
|
|||||||
|
|
||||||
await test.step('should show owner changes', async () => {
|
await test.step('should show owner changes', async () => {
|
||||||
await page.locator('[data-testid="version-button"]').click();
|
await page.locator('[data-testid="version-button"]').click();
|
||||||
const OWNER1 = EntityDataClass.user1.getUserName();
|
const OWNER1 = EntityDataClass.user1.responseData;
|
||||||
|
|
||||||
await addMultiOwner({
|
await entity.patch({
|
||||||
page,
|
apiContext,
|
||||||
ownerNames: [OWNER1],
|
patchData: [
|
||||||
activatorBtnDataTestId: 'edit-owner',
|
{
|
||||||
resultTestId: 'data-assets-header',
|
op: 'add',
|
||||||
endpoint: entity.endpoint,
|
path: '/owners/0',
|
||||||
type: 'Users',
|
value: {
|
||||||
|
id: OWNER1.id,
|
||||||
|
type: 'user',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
});
|
});
|
||||||
|
|
||||||
|
await reloadAndWaitForNetworkIdle(page);
|
||||||
|
|
||||||
const versionDetailResponse = page.waitForResponse(`**/versions/0.3`);
|
const versionDetailResponse = page.waitForResponse(`**/versions/0.3`);
|
||||||
await page.locator('[data-testid="version-button"]').click();
|
await page.locator('[data-testid="version-button"]').click();
|
||||||
await versionDetailResponse;
|
await versionDetailResponse;
|
||||||
@ -255,7 +262,23 @@ test.describe('Entity Version pages', () => {
|
|||||||
await test.step('should show tier changes', async () => {
|
await test.step('should show tier changes', async () => {
|
||||||
await page.locator('[data-testid="version-button"]').click();
|
await page.locator('[data-testid="version-button"]').click();
|
||||||
|
|
||||||
await assignTier(page, 'Tier1', entity.endpoint);
|
await entity.patch({
|
||||||
|
apiContext,
|
||||||
|
patchData: [
|
||||||
|
{
|
||||||
|
op: 'add',
|
||||||
|
path: '/tags/0',
|
||||||
|
value: {
|
||||||
|
name: COMMON_TIER_TAG[0].name,
|
||||||
|
tagFQN: COMMON_TIER_TAG[0].fullyQualifiedName,
|
||||||
|
labelType: 'Manual',
|
||||||
|
state: 'Confirmed',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
});
|
||||||
|
|
||||||
|
await reloadAndWaitForNetworkIdle(page);
|
||||||
|
|
||||||
const versionDetailResponse = page.waitForResponse(`**/versions/0.3`);
|
const versionDetailResponse = page.waitForResponse(`**/versions/0.3`);
|
||||||
await page.locator('[data-testid="version-button"]').click();
|
await page.locator('[data-testid="version-button"]').click();
|
||||||
|
@ -101,9 +101,6 @@ setup('authenticate all users', async ({ browser }) => {
|
|||||||
const newAdminPage = await browser.newPage();
|
const newAdminPage = await browser.newPage();
|
||||||
await admin.login(newAdminPage);
|
await admin.login(newAdminPage);
|
||||||
|
|
||||||
// Close the leftside bar to run tests smoothly
|
|
||||||
await newAdminPage.getByTestId('sidebar-toggle').click();
|
|
||||||
|
|
||||||
await newAdminPage.waitForURL('**/my-data');
|
await newAdminPage.waitForURL('**/my-data');
|
||||||
|
|
||||||
const { apiContext, afterAction } = await getApiContext(adminPage);
|
const { apiContext, afterAction } = await getApiContext(adminPage);
|
||||||
|
@ -126,20 +126,15 @@ class ServiceBaseClass {
|
|||||||
await page.click('[data-testid="next-button"]');
|
await page.click('[data-testid="next-button"]');
|
||||||
|
|
||||||
await page.waitForSelector('#name_help');
|
await page.waitForSelector('#name_help');
|
||||||
const nameHelp = await page.$eval('#name_help', (el) => el.textContent);
|
|
||||||
|
|
||||||
expect(nameHelp).toContain('Name is required');
|
await expect(page.locator('#name_help')).toHaveText('Name is required');
|
||||||
|
|
||||||
// invalid name validation should work
|
// invalid name validation should work
|
||||||
await page
|
await page
|
||||||
.locator('[data-testid="service-name"]')
|
.locator('[data-testid="service-name"]')
|
||||||
.fill(INVALID_NAMES.WITH_SPECIAL_CHARS);
|
.fill(INVALID_NAMES.WITH_SPECIAL_CHARS);
|
||||||
const nameHelpError = await page.$eval(
|
|
||||||
'#name_help',
|
|
||||||
(el) => el.textContent
|
|
||||||
);
|
|
||||||
|
|
||||||
expect(nameHelpError).toContain(NAME_VALIDATION_ERROR);
|
await expect(page.locator('#name_help')).toHaveText(NAME_VALIDATION_ERROR);
|
||||||
|
|
||||||
await page.fill('[data-testid="service-name"]', serviceName);
|
await page.fill('[data-testid="service-name"]', serviceName);
|
||||||
|
|
||||||
|
@ -203,6 +203,8 @@ export class UserClass {
|
|||||||
password = this.data.password
|
password = this.data.password
|
||||||
) {
|
) {
|
||||||
await page.goto('/');
|
await page.goto('/');
|
||||||
|
await page.waitForURL('**/signin');
|
||||||
|
await page.waitForLoadState('networkidle');
|
||||||
await page.fill('input[id="email"]', userName);
|
await page.fill('input[id="email"]', userName);
|
||||||
await page.locator('#email').press('Tab');
|
await page.locator('#email').press('Tab');
|
||||||
await page.fill('input[id="password"]', password);
|
await page.fill('input[id="password"]', password);
|
||||||
@ -220,6 +222,17 @@ export class UserClass {
|
|||||||
if (modal) {
|
if (modal) {
|
||||||
await page.getByRole('dialog').getByRole('img').first().click();
|
await page.getByRole('dialog').getByRole('img').first().click();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Collapse the left side bar after logging in if it's open
|
||||||
|
const leftNavBar = page.locator('[data-testid="left-sidebar"]');
|
||||||
|
|
||||||
|
const hasOpenClass = await leftNavBar.evaluate((el) =>
|
||||||
|
el.classList.contains('sidebar-open')
|
||||||
|
);
|
||||||
|
|
||||||
|
if (hasOpenClass) {
|
||||||
|
await page.getByTestId('sidebar-toggle').click();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async logout(page: Page) {
|
async logout(page: Page) {
|
||||||
|
@ -197,13 +197,29 @@ export const showAdvancedSearchDialog = async (page: Page) => {
|
|||||||
export const selectOption = async (
|
export const selectOption = async (
|
||||||
page: Page,
|
page: Page,
|
||||||
dropdownLocator: Locator,
|
dropdownLocator: Locator,
|
||||||
optionTitle: string
|
optionTitle: string,
|
||||||
|
isSearchable = false
|
||||||
) => {
|
) => {
|
||||||
await dropdownLocator.click();
|
if (isSearchable) {
|
||||||
await page.keyboard.type(optionTitle);
|
// Force click on the selector to ensure it opens even if there's an existing selection
|
||||||
|
await dropdownLocator
|
||||||
|
.locator('.ant-select-selector')
|
||||||
|
.click({ force: true });
|
||||||
|
|
||||||
|
// Clear any existing input and type the new value
|
||||||
|
const combobox = dropdownLocator.getByRole('combobox');
|
||||||
|
await combobox.clear();
|
||||||
|
await combobox.fill(optionTitle);
|
||||||
|
} else {
|
||||||
|
await dropdownLocator.click();
|
||||||
|
}
|
||||||
|
|
||||||
|
await expect(dropdownLocator).toHaveClass(/(^|\s)ant-select-focused(\s|$)/);
|
||||||
|
|
||||||
await page.waitForSelector(`.ant-select-dropdown:visible`, {
|
await page.waitForSelector(`.ant-select-dropdown:visible`, {
|
||||||
state: 'visible',
|
state: 'visible',
|
||||||
});
|
});
|
||||||
|
|
||||||
await page.click(`.ant-select-dropdown:visible [title="${optionTitle}"]`);
|
await page.click(`.ant-select-dropdown:visible [title="${optionTitle}"]`);
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -227,7 +243,8 @@ export const fillRule = async (
|
|||||||
await selectOption(
|
await selectOption(
|
||||||
page,
|
page,
|
||||||
ruleLocator.locator('.rule--field .ant-select'),
|
ruleLocator.locator('.rule--field .ant-select'),
|
||||||
field.id
|
field.id,
|
||||||
|
true
|
||||||
);
|
);
|
||||||
|
|
||||||
// Perform click on operator
|
// Perform click on operator
|
||||||
@ -595,7 +612,8 @@ export const runRuleGroupTestsWithNonExistingValue = async (page: Page) => {
|
|||||||
await selectOption(
|
await selectOption(
|
||||||
page,
|
page,
|
||||||
ruleLocator.locator('.rule--field .ant-select'),
|
ruleLocator.locator('.rule--field .ant-select'),
|
||||||
'Database'
|
'Database',
|
||||||
|
true
|
||||||
);
|
);
|
||||||
await selectOption(
|
await selectOption(
|
||||||
page,
|
page,
|
||||||
|
@ -835,19 +835,22 @@ export const verifyCustomPropertyInAdvancedSearch = async (
|
|||||||
await selectOption(
|
await selectOption(
|
||||||
page,
|
page,
|
||||||
ruleLocator.locator('.rule--field .ant-select'),
|
ruleLocator.locator('.rule--field .ant-select'),
|
||||||
'Custom Properties'
|
'Custom Properties',
|
||||||
|
true
|
||||||
);
|
);
|
||||||
|
|
||||||
await selectOption(
|
await selectOption(
|
||||||
page,
|
page,
|
||||||
ruleLocator.locator('.rule--field .ant-select'),
|
ruleLocator.locator('.rule--field .ant-select'),
|
||||||
entityType
|
entityType,
|
||||||
|
true
|
||||||
);
|
);
|
||||||
|
|
||||||
await selectOption(
|
await selectOption(
|
||||||
page,
|
page,
|
||||||
ruleLocator.locator('.rule--field .ant-select'),
|
ruleLocator.locator('.rule--field .ant-select'),
|
||||||
propertyName
|
propertyName,
|
||||||
|
true
|
||||||
);
|
);
|
||||||
|
|
||||||
await page.getByTestId('cancel-btn').click();
|
await page.getByTestId('cancel-btn').click();
|
||||||
|
@ -45,12 +45,21 @@ export const visitObservabilityAlertPage = async (page: Page) => {
|
|||||||
await page.waitForSelector('[data-testid="loader"]', {
|
await page.waitForSelector('[data-testid="loader"]', {
|
||||||
state: 'detached',
|
state: 'detached',
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Set up the response promise before navigation
|
||||||
const getAlerts = page.waitForResponse(
|
const getAlerts = page.waitForResponse(
|
||||||
'/api/v1/events/subscriptions?*alertType=Observability*'
|
'/api/v1/events/subscriptions?*alertType=Observability*'
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// Set up navigation promise before clicking
|
||||||
|
const navigationPromise = page.waitForURL('**/observability/alerts', {
|
||||||
|
waitUntil: 'networkidle',
|
||||||
|
});
|
||||||
|
|
||||||
await sidebarClick(page, SidebarItem.OBSERVABILITY_ALERT);
|
await sidebarClick(page, SidebarItem.OBSERVABILITY_ALERT);
|
||||||
await page.waitForURL('**/observability/alerts');
|
|
||||||
await getAlerts;
|
// Wait for both navigation and API response
|
||||||
|
await Promise.all([navigationPromise, getAlerts]);
|
||||||
};
|
};
|
||||||
|
|
||||||
export const addExternalDestination = async ({
|
export const addExternalDestination = async ({
|
||||||
|
@ -29,9 +29,13 @@ export const clickOnLogo = async (page: Page) => {
|
|||||||
export const sidebarClick = async (page: Page, id: string) => {
|
export const sidebarClick = async (page: Page, id: string) => {
|
||||||
const items = SIDEBAR_LIST_ITEMS[id as keyof typeof SIDEBAR_LIST_ITEMS];
|
const items = SIDEBAR_LIST_ITEMS[id as keyof typeof SIDEBAR_LIST_ITEMS];
|
||||||
if (items) {
|
if (items) {
|
||||||
await page.hover('[data-testid="left-sidebar"]');
|
await page.hover(
|
||||||
await page.waitForTimeout(300);
|
`[data-testid="left-sidebar"] [data-menu-id*="${items[0]}"]`
|
||||||
await page.click(`[data-testid="${items[0]}"]`);
|
);
|
||||||
|
await page.waitForSelector(`[data-testid="app-bar-item-${items[1]}"]`, {
|
||||||
|
state: 'visible',
|
||||||
|
});
|
||||||
|
|
||||||
await page.click(`[data-testid="app-bar-item-${items[1]}"]`);
|
await page.click(`[data-testid="app-bar-item-${items[1]}"]`);
|
||||||
} else {
|
} else {
|
||||||
await page.click(`[data-testid="app-bar-item-${id}"]`);
|
await page.click(`[data-testid="app-bar-item-${id}"]`);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user