Skip to content
Merged
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 @@ -303,7 +303,6 @@ ALL_ENTITIES.forEach(({ key, makeInstance }) => {
const { apiContext, afterAction } = await createNewPage(browser);

if (makeInstance !== null) {
Comment thread
aniketkatkar97 marked this conversation as resolved.
await mainEntity.cleanupCustomProperty(apiContext);
await mainEntity.delete(apiContext);
if (key === 'entity_dataProduct') {
for (const domain of (mainEntity as DataProduct).getDomains()) {
Expand Down Expand Up @@ -495,9 +494,9 @@ ALL_ENTITIES.forEach(({ key, makeInstance }) => {
await editButton.click();

await page.locator("pre[role='presentation']").last().click();
await page.keyboard.type(
"SELECT id, name, email\nFROM users\nWHERE active = true\nAND department = 'engineering'\nORDER BY created_at DESC\nLIMIT 100"
);
const value =
"SELECT id, name, email\nFROM users\nWHERE active = true\nAND department = 'engineering'\nORDER BY created_at DESC\nLIMIT 100";
Comment thread
aniketkatkar97 marked this conversation as resolved.
await page.keyboard.type(value + '\n' + value);

const patchResponse = page.waitForResponse(
`/api/v1/${entity.entityApiType}/*`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
import { Domain } from '../domain/Domain';
import { GlossaryTerm } from '../glossary/GlossaryTerm';
import { TagClass } from '../tag/TagClass';
import { EntityTypeEndpoint, ENTITY_PATH } from './Entity.interface';
import { EntityTypeEndpoint } from './Entity.interface';
Comment thread
aniketkatkar97 marked this conversation as resolved.

export class EntityClass {
type = '';
Expand Down Expand Up @@ -93,7 +93,7 @@
return {};
}

public set(_data: any) {

Check warning on line 96 in openmetadata-ui/src/main/resources/ui/playwright/support/entity/EntityClass.ts

View workflow job for this annotation

GitHub Actions / lint-playwright

Unexpected any. Specify a different type
// handle in parent component
}

Expand All @@ -114,30 +114,6 @@
}
}

async cleanupCustomProperty(apiContext: APIRequestContext) {
// Delete custom property only for supported entities
if (CustomPropertySupportedEntityList.includes(this.endpoint)) {
await this.cleanupUser?.(apiContext);
const entitySchemaResponse = await apiContext.get(
`/api/v1/metadata/types/name/${
ENTITY_PATH[this.endpoint as keyof typeof ENTITY_PATH]
}`
);
const entitySchema = await entitySchemaResponse.json();
await apiContext.patch(`/api/v1/metadata/types/${entitySchema.id}`, {
data: [
{
op: 'remove',
path: '/customProperties',
},
],
headers: {
'Content-Type': 'application/json-patch+json',
},
});
}
}

async domain(
page: Page,
domain1: Domain['responseData'],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,27 +208,6 @@ export class EntityDataClass {
}
}

static async cleanupCustomPropertyData(
apiContext: APIRequestContext,
entityType: string
) {
const entitySchemaResponse = await apiContext.get(
`/api/v1/metadata/types/name/${entityType}`
);
const entitySchema = await entitySchemaResponse.json();
await apiContext.patch(`/api/v1/metadata/types/${entitySchema.id}`, {
data: [
{
op: 'remove',
path: '/customProperties',
},
],
headers: {
'Content-Type': 'application/json-patch+json',
},
});
}

static async preRequisitesForTests(apiContext: APIRequestContext) {
// Add pre-requisites for tests
const promises = [
Expand Down Expand Up @@ -375,12 +354,6 @@ export class EntityDataClass {
this.worksheet2.delete(apiContext),
];

for (const entityType of Object.values(CUSTOM_PROPERTIES_ENTITIES).map(
(entity) => entity.name
)) {
await this.cleanupCustomPropertyData(apiContext, entityType);
}

return await Promise.allSettled(promises);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1145,7 +1145,7 @@ export const verifyTableColumnCustomPropertyPersistence = async ({
.includes(
`/api/v1/tables/name/${encodeURIComponent(tableFqn)}/columns`
) &&
response.url().includes('profile') &&
response.url().includes('fields') &&
response.request().method() === 'GET',
// TODO: Reduce timeout once the latency issue is fixed
{ timeout: 150_000 }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,15 +71,7 @@ export const validateLeftSidebarWithHiddenItems = async (
.locator(`[data-testid^="app-bar-item-"]`)
.first();

try {
// Wait for at least one child to be visible (with timeout)
await anyChildInDropdown.waitFor({ state: 'visible', timeout: 3000 });
} catch {
// If no children are visible, the dropdown might not have expanded
// Wait a bit more and continue
// eslint-disable-next-line playwright/no-wait-for-timeout -- dropdown expansion fallback delay
await page.waitForTimeout(500);
}
await expect(anyChildInDropdown).toBeVisible(); // Ensure at least one child is visible before proceeding

const childElement = page
.locator(`[data-testid="app-bar-item-${items[1]}"]`)
Expand All @@ -103,15 +95,15 @@ export const validateLeftSidebarWithHiddenItems = async (
}

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

await page.mouse.move(1280, 0); // Move mouse to top right corner

continue;
}
const isNested = Object.keys(SIDEBAR_LIST_ITEMS).includes(item);

if (hiddenItems.includes(item)) {
await expect(
page.getByTestId('left-sidebar').getByTestId(`app-bar-item-${item}`)
page.getByTestId(`app-bar-item-${item}`)
).not.toBeVisible();
} else if (isNested) {
await expect(page.getByTestId(`app-bar-item-${item}`)).toBeVisible();
Comment thread
aniketkatkar97 marked this conversation as resolved.
} else {
await expect(
page.getByTestId('left-sidebar').getByTestId(`app-bar-item-${item}`)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1647,45 +1647,19 @@ export const selectDomainFromNavbar = async (
const domainDropdown = page.getByTestId('domain-dropdown');
const domainTree = page.getByTestId('domain-selectable-tree');
const searchTerm = domain.displayName ?? domain.name;
const domainOption = page.getByTestId(`tag-${domain.fullyQualifiedName}`);

const openDropdown = async () => {
await domainDropdown.click();
await domainTree.waitFor({ state: 'visible' });
};

await openDropdown();

const searchBar = domainTree.locator('input[placeholder]').first();

await expect
.poll(
async () => {
if (!(await domainTree.isVisible().catch(() => false))) {
await openDropdown();
}

const isSearchBarVisible = await searchBar
.isVisible()
.catch(() => false);
await domainDropdown.click();
await page
.getByTestId('domain-selectable-tree')
.waitFor({ state: 'visible' });

if (isSearchBarVisible) {
await searchBar.focus();
await searchBar.press('Control+a');
await searchBar.pressSequentially(searchTerm);
}
await domainTree.getByTestId('searchbar').waitFor({ state: 'visible' });

return await domainOption.isVisible().catch(() => false);
},
{
timeout: 60000,
intervals: [1000, 2000, 5000],
message: `Timed out waiting for domain ${searchTerm} to appear in navbar selector`,
}
)
.toBe(true);
await domainTree.getByTestId('searchbar').click();
await page.keyboard.press('Control+a');
await domainTree.getByTestId('searchbar').pressSequentially(searchTerm);

await domainOption.click();
await page.getByTestId(`tag-${domain.fullyQualifiedName}`).click();
Comment thread
aniketkatkar97 marked this conversation as resolved.
await waitForAllLoadersToDisappear(page);
};

Expand Down
Loading