Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -210,10 +210,13 @@ test.describe(
{ state: 'detached' }
);

const teamsSearchBar = page.getByTestId('owner-select-teams-search-bar');
await teamsSearchBar.waitFor({ state: 'visible' });

const searchUser = page.waitForResponse(
`/api/v1/search/query?q=*${encodeURIComponent(teamName)}*`
);
await page.getByTestId(`owner-select-teams-search-bar`).fill(teamName);
await teamsSearchBar.fill(teamName);
await searchUser;

const ownerItem = page.getByRole('listitem', {
Expand Down Expand Up @@ -266,8 +269,18 @@ test.describe(
}

// Add Multiple GlossaryTerm to Table
await assignGlossaryTerm(page, glossaryTerm.responseData);
await assignGlossaryTerm(page, glossaryTerm2.responseData, 'Edit');
await assignGlossaryTerm(
page,
glossaryTerm.responseData,
'Add',
entity.endpoint
);
await assignGlossaryTerm(
page,
glossaryTerm2.responseData,
'Edit',
entity.endpoint
);
});
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,18 @@ test.describe(

if (entityName === 'Table') {
// Only glossaryTerm2.responseData data will be available due to single select type is enabled
await assignGlossaryTerm(page, glossaryTerm.responseData);
await assignGlossaryTerm(page, glossaryTerm2.responseData, 'Edit');
await assignGlossaryTerm(
page,
glossaryTerm.responseData,
'Add',
entity.endpoint
);
await assignGlossaryTerm(
page,
glossaryTerm2.responseData,
'Edit',
entity.endpoint
);

await expect(
page
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1093,7 +1093,12 @@ test.describe('Data Contracts', () => {
'KnowledgePanel.Tags',
testTag.responseData.fullyQualifiedName
);
await assignGlossaryTerm(page, testGlossaryTerm.responseData);
await assignGlossaryTerm(
page,
testGlossaryTerm.responseData,
'Add',
EntityTypeEndpoint.Table
);

await navigateToContractTab(page);

Expand All @@ -1103,7 +1108,7 @@ test.describe('Data Contracts', () => {

await page.reload();


await page.waitForSelector('[data-testid="loader"]', {
state: 'detached',
});
Expand Down Expand Up @@ -1266,7 +1271,12 @@ test.describe('Data Contracts', () => {
'KnowledgePanel.Tags',
testTag.responseData.fullyQualifiedName
);
await assignGlossaryTerm(page, testGlossaryTerm.responseData);
await assignGlossaryTerm(
page,
testGlossaryTerm.responseData,
'Add',
EntityTypeEndpoint.Table
);

await navigateToContractTab(page);

Expand All @@ -1276,7 +1286,7 @@ test.describe('Data Contracts', () => {

await page.reload();


await page.waitForSelector('[data-testid="loader"]', {
state: 'detached',
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3224,11 +3224,16 @@ test.describe('Domain Tree View Functionality', () => {
});

// Add only glossary term to domain (no tags)
await assignGlossaryTerm(page, {
displayName: testGlossaryTerm.data.displayName,
name: testGlossaryTerm.data.name,
fullyQualifiedName: testGlossaryTerm.responseData.fullyQualifiedName,
});
await assignGlossaryTerm(
page,
{
displayName: testGlossaryTerm.data.displayName,
name: testGlossaryTerm.data.name,
fullyQualifiedName: testGlossaryTerm.responseData.fullyQualifiedName,
},
'Add',
EntityTypeEndpoint.Domain
);

await visitGlossaryPage(page, testGlossary.data.displayName);
await selectActiveGlossaryTerm(page, testGlossaryTerm.data.displayName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1185,7 +1185,12 @@ test.describe('Glossary tests', () => {
await glossary1.create(apiContext);
await glossaryTerm1.create(apiContext);
await table.visitEntityPage(page);
await assignGlossaryTerm(page, glossaryTerm1.responseData);
await assignGlossaryTerm(
page,
glossaryTerm1.responseData,
'Add',
EntityTypeEndpoint.Table
);
await sidebarClick(page, SidebarItem.GLOSSARY);
await selectActiveGlossary(page, glossary1.data.displayName);
await goToAssetsTab(page, glossaryTerm1.data.displayName, 1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ export class EntityClass {
glossaryTerm2: GlossaryTerm['responseData'],
entity?: EntityClass
) {
await assignGlossaryTerm(page, glossaryTerm1);
await assignGlossaryTerm(page, glossaryTerm1, 'Add', this.endpoint);
if (entity) {
await checkExploreSearchFilter(
page,
Expand All @@ -426,7 +426,7 @@ export class EntityClass {
entity
);
}
await assignGlossaryTerm(page, glossaryTerm2, 'Edit');
await assignGlossaryTerm(page, glossaryTerm2, 'Edit', this.endpoint);
await removeGlossaryTerm(page, [glossaryTerm1, glossaryTerm2]);

await page
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,10 @@ export class UserClass {
}

getUserDisplayName() {
return this.responseData.displayName;
return (
this.responseData.displayName ??
this.responseData.name
);
}

async login(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ export const addMultiOwner = async (data: {
clearAll = true,
} = data;
const isMultipleOwners = Array.isArray(ownerNames);
const owners = isMultipleOwners ? ownerNames : [ownerNames];
const owners = (isMultipleOwners ? ownerNames : [ownerNames])

await page.click(`[data-testid="${activatorBtnDataTestId}"]`);

Expand Down Expand Up @@ -950,7 +950,8 @@ type GlossaryTermOption = {
export const assignGlossaryTerm = async (
page: Page,
glossaryTerm: GlossaryTermOption,
action: 'Add' | 'Edit' = 'Add'
action: 'Add' | 'Edit' = 'Add',
entityEndpoint?: string
) => {
await page
.getByTestId('KnowledgePanel.GlossaryTerms')
Expand Down Expand Up @@ -978,11 +979,19 @@ export const assignGlossaryTerm = async (
page.getByTestId('custom-drop-down-menu').getByTestId('saveAssociatedTag')
).toBeEnabled();

const patchRequest = entityEndpoint
? page.waitForResponse(`/api/v1/${entityEndpoint}/*`)
: undefined;

await page
.getByTestId('custom-drop-down-menu')
.getByTestId('saveAssociatedTag')
.click();

if (patchRequest) {
await patchRequest;
}

await expect(
page.getByTestId('custom-drop-down-menu').getByTestId('saveAssociatedTag')
).not.toBeVisible();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,21 +50,16 @@ export const createGlossaryTermRowDetails = () => {
};

export const fillTextInputDetails = async (page: Page, text: string) => {
await page.keyboard.press('Enter', { delay: 100 });

const isVisible = await page
.locator('.ant-layout-content')
.getByRole('textbox')
.isVisible();

if (!isVisible) {
await page.keyboard.press('Enter', { delay: 100 });
}
const activeCell = page.locator(RDG_ACTIVE_CELL_SELECTOR);
await activeCell.click();
await activeCell.press('Enter', { delay: 100 });
Comment on lines +53 to +55
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dhruvjsx, this function is only to fill in the input. The clicking logic beats the purpose of tests where it is used. Please look into where we are using this function. We are navigating and selecting through the fields using arrow keys, clicking on the cells will beat the purpose of doing that.


const textboxLocator = page
.locator('.ant-layout-content')
.getByRole('textbox');

await expect(textboxLocator).toBeVisible();

await textboxLocator.fill(text);
await textboxLocator.press('Enter', { delay: 100 });
};
Expand Down