Skip to content

Commit 6dc6dca

Browse files
Rohit0301anuj-kumary
authored andcommitted
Fixed entity spec flakiness
1 parent 74dd325 commit 6dc6dca

1 file changed

Lines changed: 13 additions & 27 deletions

File tree

  • openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages

openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/Entity.spec.ts

Lines changed: 13 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
*/
1313
import {
1414
APIRequestContext,
15-
test as base,
1615
expect,
1716
Page,
17+
test as base,
1818
} from '@playwright/test';
1919
import { isUndefined } from 'lodash';
2020
import { Column, Table } from '../../../src/generated/entity/data/table';
@@ -191,7 +191,7 @@ Object.entries(entities).forEach(([key, EntityClass]) => {
191191
page,
192192
EntityDataClass.domain1.responseData,
193193
entity.entityResponseData?.['fullyQualifiedName'] ??
194-
entity.entityResponseData?.['name']
194+
entity.entityResponseData?.['name']
195195
);
196196

197197
await visitServiceDetailsPage(
@@ -402,10 +402,9 @@ Object.entries(entities).forEach(([key, EntityClass]) => {
402402
// Glossary Selector
403403
await page
404404
.locator(
405-
`[${rowSelector}="${
406-
isMlModel
407-
? entity.childrenSelectorId2
408-
: entity.childrenSelectorId ?? ''
405+
`[${rowSelector}="${isMlModel
406+
? entity.childrenSelectorId2
407+
: entity.childrenSelectorId ?? ''
409408
}"]`
410409
)
411410
.getByTestId('glossary-container')
@@ -524,16 +523,7 @@ Object.entries(entities).forEach(([key, EntityClass]) => {
524523
.locator('[data-testid="selectable-list"]')
525524
.waitFor({ state: 'visible' });
526525

527-
const searchTagCleanup = page.waitForResponse(
528-
'/api/v1/search/query?q=*index=tag_search_index*'
529-
);
530-
await page
531-
.locator('[data-testid="tag-select-search-bar"]')
532-
.fill('PersonalData.SpecialCategory');
533-
await searchTagCleanup;
534-
await waitForAllLoadersToDisappear(page);
535-
536-
await page.getByTitle('SpecialCategory', { exact: true }).click();
526+
await page.getByTestId('clear-all-button').click();
537527
const removeResponse = page.waitForResponse(
538528
(response) =>
539529
response.url().includes('/api/v1/columns/name/') ||
@@ -909,9 +899,8 @@ Object.entries(entities).forEach(([key, EntityClass]) => {
909899
).toBeVisible();
910900

911901
// Verify non-nested columns don't have expand icons
912-
const simpleColumnFQN = `${tableFQN}.${
913-
(entity as TableClass).columnsName[0]
914-
}`;
902+
const simpleColumnFQN = `${tableFQN}.${(entity as TableClass).columnsName[0]
903+
}`;
915904

916905
await expect(
917906
page
@@ -922,9 +911,8 @@ Object.entries(entities).forEach(([key, EntityClass]) => {
922911

923912
await test.step('Open column detail panel for nested column', async () => {
924913
// Click on the parent nested column name to open detail panel
925-
const nestedParentFQN = `${
926-
entity.entityResponseData?.['fullyQualifiedName']
927-
}.${(entity as TableClass).columnsName[2]}`;
914+
const nestedParentFQN = `${entity.entityResponseData?.['fullyQualifiedName']
915+
}.${(entity as TableClass).columnsName[2]}`;
928916

929917
await openColumnDetailPanel({
930918
page,
@@ -1195,8 +1183,7 @@ Object.entries(entities).forEach(([key, EntityClass]) => {
11951183

11961184
if (!nestedParent) {
11971185
throw new Error(
1198-
`Nested parent column not found: ${
1199-
(entity as TableClass).columnsName[2]
1186+
`Nested parent column not found: ${(entity as TableClass).columnsName[2]
12001187
}`
12011188
);
12021189
}
@@ -1268,9 +1255,8 @@ Object.entries(entities).forEach(([key, EntityClass]) => {
12681255

12691256
await test.step('Verify mixed siblings have consistent indentation', async () => {
12701257
// columnsName[2] has mixed children: columnsName[3] (STRUCT) and columnsName[4] (ARRAY with nested children)
1271-
const nestedParentFQN = `${
1272-
entity.entityResponseData?.['fullyQualifiedName']
1273-
}.${(entity as TableClass).columnsName[2]}`;
1258+
const nestedParentFQN = `${entity.entityResponseData?.['fullyQualifiedName']
1259+
}.${(entity as TableClass).columnsName[2]}`;
12741260

12751261
const nestedColumnRow = page.locator(
12761262
`[data-row-key="${nestedParentFQN}"]`

0 commit comments

Comments
 (0)