Skip to content

Commit 6384588

Browse files
committed
Flaky(UI): Bulkedit spec (#25896)
* fixed bulkedit flaky test * config changes to get traces * removed playwright config file * added comment * added api call for testsuite pipeline * replaced right arrow click with function * removed function for filltestcasedtail * removed timeout * added max retries * moved constant to seperate file
1 parent be55720 commit 6384588

3 files changed

Lines changed: 75 additions & 45 deletions

File tree

openmetadata-ui/src/main/resources/ui/playwright/constant/bulkImportExport.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,4 @@ export const BULK_IMPORT_EXPORT_SQL_QUERY = `CREATE OR REPLACE PROCEDURE insert_
3030
END;$$;`;
3131

3232
export const RDG_ACTIVE_CELL_SELECTOR = '.rdg-cell[aria-selected="true"]';
33+
export const MAX_COLUMN_NAVIGATION_RETRIES = 10;

openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/TestSuiteMultiPipeline.spec.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,11 @@ test(
7373

7474
await expect(page.getByTestId('deploy-button')).toBeVisible();
7575

76+
const deployResponse = page.waitForResponse(
77+
'/api/v1/services/ingestionPipelines/deploy/*'
78+
);
7679
await page.getByTestId('deploy-button').click();
80+
await deployResponse;
7781

7882
await page.waitForSelector('[data-testid="body-text"]', {
7983
state: 'detached',
@@ -111,7 +115,12 @@ test(
111115
.getByTestId('week-segment-day-option-container')
112116
.getByText('W')
113117
.click();
118+
const updateDeployResponse = page.waitForResponse(
119+
'/api/v1/services/ingestionPipelines/deploy/*'
120+
);
114121
await page.getByTestId('deploy-button').click();
122+
await updateDeployResponse;
123+
115124
await page.waitForSelector('[data-testid="body-text"]', {
116125
state: 'detached',
117126
});
@@ -221,7 +230,12 @@ test(
221230
page.getByTestId(`checkbox-${testCaseNames[0]}`)
222231
).not.toBeChecked();
223232

233+
const editDeployResponse = page.waitForResponse(
234+
'/api/v1/services/ingestionPipelines/deploy/*'
235+
);
224236
await page.getByTestId('deploy-button').click();
237+
await editDeployResponse;
238+
225239
await page.waitForSelector('[data-testid="body-text"]', {
226240
state: 'detached',
227241
});

openmetadata-ui/src/main/resources/ui/playwright/utils/importUtils.ts

Lines changed: 60 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import * as os from 'os';
1616
import * as path from 'path';
1717
import {
1818
BULK_IMPORT_EXPORT_SQL_QUERY,
19+
MAX_COLUMN_NAVIGATION_RETRIES,
1920
RDG_ACTIVE_CELL_SELECTOR,
2021
} from '../constant/bulkImportExport';
2122
import { CUSTOM_PROPERTIES_ENTITIES } from '../constant/customProperty';
@@ -64,15 +65,6 @@ export const createGlossaryTermRowDetails = () => {
6465
export const fillTextInputDetails = async (page: Page, text: string) => {
6566
await page.keyboard.press('Enter', { delay: 100 });
6667

67-
const isVisible = await page
68-
.locator('.ant-layout-content')
69-
.getByRole('textbox')
70-
.isVisible();
71-
72-
if (!isVisible) {
73-
await page.keyboard.press('Enter', { delay: 100 });
74-
}
75-
7668
const textboxLocator = page
7769
.locator('.ant-layout-content')
7870
.getByRole('textbox');
@@ -462,7 +454,7 @@ export const fillGlossaryRowDetails = async (
462454
propertyListName?: Record<string, string>,
463455
isBulkEdit?: boolean
464456
) => {
465-
await page.keyboard.press('ArrowRight', { delay: 100 });
457+
await moveToNextColumnWithVerification(page);
466458

467459
if (isBulkEdit) {
468460
await expect(
@@ -768,38 +760,44 @@ export const fillRowDetails = async (
768760
}
769761
}
770762

771-
await page.keyboard.press('ArrowRight');
763+
await moveToNextColumnWithVerification(page);
764+
await page.locator(RDG_ACTIVE_CELL_SELECTOR).click();
772765

773766
await fillTextInputDetails(page, row.displayName);
774767

775-
// Navigate to next cell and make cell editable
776-
await page.keyboard.press('ArrowRight', { delay: 100 });
768+
await moveToNextColumnWithVerification(page);
769+
await page.locator(RDG_ACTIVE_CELL_SELECTOR).click();
777770

778771
await fillDescriptionDetails(page, row.description);
779772

780-
await page.keyboard.press('ArrowRight', { delay: 100 });
773+
await moveToNextColumnWithVerification(page);
774+
await page.locator(RDG_ACTIVE_CELL_SELECTOR).click();
781775

782776
await fillOwnerDetails(page, row.owners);
783777

784778
if (row.teamOwners && row.teamOwners.length > 0) {
785779
await fillTeamOwnerDetails(page, row.teamOwners);
786780
}
787781

788-
await page.keyboard.press('ArrowRight', { delay: 100 });
782+
await moveToNextColumnWithVerification(page);
783+
await page.locator(RDG_ACTIVE_CELL_SELECTOR).click();
789784

790785
await fillTagDetails(page, row.tag);
791786

792-
await page.keyboard.press('ArrowRight', { delay: 100 });
787+
await moveToNextColumnWithVerification(page);
788+
await page.locator(RDG_ACTIVE_CELL_SELECTOR).click();
793789

794790
await fillGlossaryTermDetails(page, row.glossary);
795791

796-
await page.keyboard.press('ArrowRight', { delay: 100 });
792+
await moveToNextColumnWithVerification(page);
793+
await page.locator(RDG_ACTIVE_CELL_SELECTOR).click();
797794
await page.keyboard.press('Enter', { delay: 100 });
798795

799796
await page.click(`[data-testid="radio-btn-${row.tier}"]`);
800797
await page.click(`[data-testid="update-tier-card"]`);
801798

802-
await page.keyboard.press('ArrowRight', { delay: 100 });
799+
await moveToNextColumnWithVerification(page);
800+
await page.locator(RDG_ACTIVE_CELL_SELECTOR).click();
803801

804802
const certificationResponse = page.waitForResponse(
805803
'/api/v1/tags?parent=Certification*'
@@ -812,25 +810,22 @@ export const fillRowDetails = async (
812810
await certRadioBtn.click();
813811
await page.getByTestId('update-certification').click();
814812

815-
await page.keyboard.press('ArrowRight');
813+
await moveToNextColumnWithVerification(page);
816814

817815
if (row.retentionPeriod) {
818816
await fillTextInputDetails(page, row.retentionPeriod);
819817

820-
await page
821-
.locator(RDG_ACTIVE_CELL_SELECTOR)
822-
.press('ArrowRight', { delay: 100 });
818+
await moveToNextColumnWithVerification(page);
823819
}
824820
if (row.sourceUrl) {
825821
await fillTextInputDetails(page, row.sourceUrl);
826-
await page
827-
.locator(RDG_ACTIVE_CELL_SELECTOR)
828-
.press('ArrowRight', { delay: 100 });
822+
823+
await moveToNextColumnWithVerification(page);
829824
}
830825

831826
await fillDomainDetails(page, row.domains);
832827

833-
await page.keyboard.press('ArrowRight', { delay: 100 });
828+
await moveToNextColumnWithVerification(page);
834829

835830
if (customPropertyRecord) {
836831
await fillCustomPropertyDetails(page, customPropertyRecord);
@@ -856,35 +851,43 @@ export const fillColumnDetails = async (
856851
) => {
857852
await fillTextInputDetails(page, row.name);
858853

859-
await page.keyboard.press('ArrowRight', { delay: 100 });
854+
await moveToNextColumnWithVerification(page);
855+
await page.locator(RDG_ACTIVE_CELL_SELECTOR).click();
860856

861857
await fillTextInputDetails(page, row.displayName);
862858

863-
await page.keyboard.press('ArrowRight', { delay: 100 });
859+
await moveToNextColumnWithVerification(page);
860+
await page.locator(RDG_ACTIVE_CELL_SELECTOR).click();
864861

865862
await fillDescriptionDetails(page, row.description);
866863

867-
await page.keyboard.press('ArrowRight', { delay: 100 });
864+
await moveToNextColumnWithVerification(page);
865+
await page.locator(RDG_ACTIVE_CELL_SELECTOR).click();
868866

869867
await fillTextInputDetails(page, row.dataTypeDisplay);
870868

871-
await page.keyboard.press('ArrowRight', { delay: 100 });
869+
await moveToNextColumnWithVerification(page);
870+
await page.locator(RDG_ACTIVE_CELL_SELECTOR).click();
872871

873872
await fillTextInputDetails(page, row.dataType);
874873

875-
await page.keyboard.press('ArrowRight', { delay: 100 });
874+
await moveToNextColumnWithVerification(page);
875+
await page.locator(RDG_ACTIVE_CELL_SELECTOR).click();
876876

877877
await fillTextInputDetails(page, row.arrayDataType);
878878

879-
await page.keyboard.press('ArrowRight', { delay: 100 });
879+
await moveToNextColumnWithVerification(page);
880+
await page.locator(RDG_ACTIVE_CELL_SELECTOR).click();
880881

881882
await fillTextInputDetails(page, row.dataLength);
882883

883-
await page.keyboard.press('ArrowRight', { delay: 100 });
884+
await moveToNextColumnWithVerification(page);
885+
await page.locator(RDG_ACTIVE_CELL_SELECTOR).click();
884886

885887
await fillTagDetails(page, row.tag);
886888

887-
await page.keyboard.press('ArrowRight', { delay: 100 });
889+
await moveToNextColumnWithVerification(page);
890+
await page.locator(RDG_ACTIVE_CELL_SELECTOR).click();
888891

889892
await fillGlossaryTermDetails(page, row.glossary);
890893
};
@@ -994,11 +997,13 @@ export const fillRecursiveEntityTypeFQNDetails = async (
994997
entityType: string,
995998
page: Page
996999
) => {
997-
await page.keyboard.press('ArrowRight', { delay: 100 });
1000+
await moveToNextColumnWithVerification(page);
1001+
await page.locator(RDG_ACTIVE_CELL_SELECTOR).click();
9981002

9991003
await fillEntityTypeDetails(page, entityType);
10001004

1001-
await page.keyboard.press('ArrowRight', { delay: 100 });
1005+
await moveToNextColumnWithVerification(page);
1006+
await page.locator(RDG_ACTIVE_CELL_SELECTOR).click();
10021007

10031008
await fillTextInputDetails(page, fullyQualifiedName);
10041009
};
@@ -1035,42 +1040,50 @@ export const fillRecursiveColumnDetails = async (
10351040
await fillTextInputDetails(page, row.name);
10361041
}
10371042

1038-
await page.keyboard.press('ArrowRight');
1043+
await moveToNextColumnWithVerification(page);
1044+
await page.locator(RDG_ACTIVE_CELL_SELECTOR).click();
10391045

10401046
await fillTextInputDetails(page, row.displayName);
10411047

1042-
await page.keyboard.press('ArrowRight', { delay: 100 });
1048+
await moveToNextColumnWithVerification(page);
1049+
await page.locator(RDG_ACTIVE_CELL_SELECTOR).click();
10431050

10441051
await fillDescriptionDetails(page, row.description);
10451052

10461053
await pressKeyXTimes(page, 2, 'ArrowRight');
10471054

10481055
await fillTagDetails(page, row.tag);
10491056

1050-
await page.keyboard.press('ArrowRight', { delay: 100 });
1057+
await moveToNextColumnWithVerification(page);
1058+
await page.locator(RDG_ACTIVE_CELL_SELECTOR).click();
10511059
await fillGlossaryTermDetails(page, row.glossary);
10521060

10531061
await pressKeyXTimes(page, 7, 'ArrowRight');
10541062

10551063
await fillEntityTypeDetails(page, row.entityType);
10561064

1057-
await page.keyboard.press('ArrowRight', { delay: 100 });
1065+
await moveToNextColumnWithVerification(page);
1066+
await page.locator(RDG_ACTIVE_CELL_SELECTOR).click();
10581067

10591068
await fillTextInputDetails(page, row.fullyQualifiedName);
10601069

1061-
await page.keyboard.press('ArrowRight', { delay: 100 });
1070+
await moveToNextColumnWithVerification(page);
1071+
await page.locator(RDG_ACTIVE_CELL_SELECTOR).click();
10621072

10631073
await fillTextInputDetails(page, row.dataTypeDisplay);
10641074

1065-
await page.keyboard.press('ArrowRight', { delay: 100 });
1075+
await moveToNextColumnWithVerification(page);
1076+
await page.locator(RDG_ACTIVE_CELL_SELECTOR).click();
10661077

10671078
await fillTextInputDetails(page, row.dataType);
10681079

1069-
await page.keyboard.press('ArrowRight', { delay: 100 });
1080+
await moveToNextColumnWithVerification(page);
1081+
await page.locator(RDG_ACTIVE_CELL_SELECTOR).click();
10701082

10711083
await fillTextInputDetails(page, row.arrayDataType);
10721084

1073-
await page.keyboard.press('ArrowRight', { delay: 100 });
1085+
await moveToNextColumnWithVerification(page);
1086+
await page.locator(RDG_ACTIVE_CELL_SELECTOR).click();
10741087

10751088
await fillTextInputDetails(page, row.dataLength);
10761089
};
@@ -1115,10 +1128,12 @@ const moveToNextColumnWithVerification = async (page: Page): Promise<void> => {
11151128
await page.keyboard.press('ArrowRight', { delay: 100 });
11161129

11171130
let newColIndex = await activeCell.getAttribute('aria-colindex');
1131+
let retries = 0;
11181132

1119-
while (currentColIndex === newColIndex) {
1133+
while (currentColIndex === newColIndex && retries < MAX_COLUMN_NAVIGATION_RETRIES) {
11201134
await page.keyboard.press('ArrowRight', { delay: 100 });
11211135
newColIndex = await activeCell.getAttribute('aria-colindex');
1136+
retries++;
11221137
}
11231138
};
11241139

0 commit comments

Comments
 (0)