Skip to content
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ test.describe('Entity Version pages', () => {
const domain = EntityDataClass.domain1.responseData;

for (const entity of entities) {
if (await entity.exists(apiContext)) {
await entity.delete(apiContext);
}
await entity.create(apiContext);
const dataTypeDisplayPath = getEntityDataTypeDisplayPatch(entity);
await entity.patch({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,15 @@ export class ApiEndpointClass extends EntityClass {
});
}

async exists(apiContext: APIRequestContext): Promise<boolean> {
const name = this.serviceResponseData?.fullyQualifiedName ?? '';
const res = await apiContext.get(
`/api/v1/services/apiServices/name/${encodeURIComponent(name)}`
);

return res.ok();
}

async delete(apiContext: APIRequestContext) {
const serviceResponse = await apiContext.delete(
`/api/v1/services/apiServices/name/${encodeURIComponent(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,15 @@ export class ContainerClass extends EntityClass {
});
}

async exists(apiContext: APIRequestContext): Promise<boolean> {
const name = this.serviceResponseData?.fullyQualifiedName ?? '';
const res = await apiContext.get(
`/api/v1/services/storageServices/name/${encodeURIComponent(name)}`
);

return res.ok();
}

async delete(apiContext: APIRequestContext) {
const serviceResponse = await apiContext.delete(
`/api/v1/services/storageServices/name/${encodeURIComponent(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,15 @@ export class DashboardClass extends EntityClass {
});
}

async exists(apiContext: APIRequestContext): Promise<boolean> {
const name = this.serviceResponseData?.fullyQualifiedName ?? '';
const res = await apiContext.get(
`/api/v1/services/dashboardServices/name/${encodeURIComponent(name)}`
);

return res.ok();
}

async delete(apiContext: APIRequestContext) {
const chartResponse = await apiContext.delete(
`/api/v1/charts/name/${encodeURIComponent(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,15 @@ export class DashboardDataModelClass extends EntityClass {
});
}

async exists(apiContext: APIRequestContext): Promise<boolean> {
const name = this.serviceResponseData?.fullyQualifiedName ?? '';
const res = await apiContext.get(
`/api/v1/services/dashboardServices/name/${encodeURIComponent(name)}`
);

return res.ok();
}

async delete(apiContext: APIRequestContext) {
const serviceResponse = await apiContext.delete(
`/api/v1/services/dashboardServices/name/${encodeURIComponent(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,15 @@ export class DirectoryClass extends EntityClass {
});
}

async exists(apiContext: APIRequestContext): Promise<boolean> {
const name = this.serviceResponseData?.fullyQualifiedName ?? '';
const res = await apiContext.get(
`/api/v1/services/driveServices/name/${encodeURIComponent(name)}`
);

return res.ok();
}

async delete(apiContext: APIRequestContext) {
const serviceResponse = await apiContext.delete(
`/api/v1/services/driveServices/name/${encodeURIComponent(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,15 @@
return this.type;
}

async exists(_apiContext: APIRequestContext): Promise<boolean> {
return false;
}

public get() {
return {};
}

public set(_data: any) {

Check warning on line 101 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 Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,15 @@ export class FileClass extends EntityClass {
});
}

async exists(apiContext: APIRequestContext): Promise<boolean> {
const name = this.serviceResponseData?.fullyQualifiedName ?? '';
const res = await apiContext.get(
`/api/v1/services/driveServices/name/${encodeURIComponent(name)}`
);

return res.ok();
}

async delete(apiContext: APIRequestContext) {
const serviceResponse = await apiContext.delete(
`/api/v1/services/driveServices/name/${encodeURIComponent(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,15 @@ export class MlModelClass extends EntityClass {
});
}

async exists(apiContext: APIRequestContext): Promise<boolean> {
const name = this.serviceResponseData?.fullyQualifiedName ?? '';
const res = await apiContext.get(
`/api/v1/services/mlmodelServices/name/${encodeURIComponent(name)}`
);

return res.ok();
}

async delete(apiContext: APIRequestContext) {
const serviceResponse = await apiContext.delete(
`/api/v1/services/mlmodelServices/name/${encodeURIComponent(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,15 @@ export class PipelineClass extends EntityClass {
});
}

async exists(apiContext: APIRequestContext): Promise<boolean> {
const name = this.serviceResponseData?.fullyQualifiedName ?? '';
const res = await apiContext.get(
`/api/v1/services/pipelineServices/name/${encodeURIComponent(name)}`
);

return res.ok();
}

async delete(apiContext: APIRequestContext) {
const serviceResponse = await apiContext.delete(
`/api/v1/services/pipelineServices/name/${encodeURIComponent(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,15 @@ export class SearchIndexClass extends EntityClass {
});
}

async exists(apiContext: APIRequestContext): Promise<boolean> {
const name = this.serviceResponseData?.fullyQualifiedName ?? '';
const res = await apiContext.get(
`/api/v1/services/searchServices/name/${encodeURIComponent(name)}`
);

return res.ok();
}

async delete(apiContext: APIRequestContext) {
const serviceResponse = await apiContext.delete(
`/api/v1/services/searchServices/name/${encodeURIComponent(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,15 @@ export class SpreadsheetClass extends EntityClass {
});
}

async exists(apiContext: APIRequestContext): Promise<boolean> {
const name = this.serviceResponseData?.fullyQualifiedName ?? '';
const res = await apiContext.get(
`/api/v1/services/driveServices/name/${encodeURIComponent(name)}`
);

return res.ok();
}

async delete(apiContext: APIRequestContext) {
const serviceResponse = await apiContext.delete(
`/api/v1/services/driveServices/name/${encodeURIComponent(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,15 @@ export class StoredProcedureClass extends EntityClass {
});
}

async exists(apiContext: APIRequestContext): Promise<boolean> {
const name = this.serviceResponseData?.fullyQualifiedName ?? '';
const res = await apiContext.get(
`/api/v1/services/databaseServices/name/${encodeURIComponent(name)}`
);

return res.ok();
}

async delete(apiContext: APIRequestContext) {
const serviceResponse = await apiContext.delete(
`/api/v1/services/databaseServices/name/${encodeURIComponent(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -535,6 +535,15 @@ export class TableClass extends EntityClass {
);
}

async exists(apiContext: APIRequestContext): Promise<boolean> {
const name = this.serviceResponseData?.fullyQualifiedName ?? '';
const res = await apiContext.get(
`/api/v1/services/databaseServices/name/${encodeURIComponent(name)}`
);

return res.ok();
}

async delete(apiContext: APIRequestContext, hardDelete = true) {
const serviceResponse = await apiContext.delete(
`/api/v1/services/databaseServices/name/${encodeURIComponent(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,15 @@ export class TopicClass extends EntityClass {
});
}

async exists(apiContext: APIRequestContext): Promise<boolean> {
const name = this.serviceResponseData?.fullyQualifiedName ?? '';
const res = await apiContext.get(
`/api/v1/services/messagingServices/name/${encodeURIComponent(name)}`
);

return res.ok();
}

async delete(apiContext: APIRequestContext) {
const serviceResponse = await apiContext.delete(
`/api/v1/services/messagingServices/name/${encodeURIComponent(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,15 @@ export class WorksheetClass extends EntityClass {
});
}

async exists(apiContext: APIRequestContext): Promise<boolean> {
const name = this.serviceResponseData?.fullyQualifiedName ?? '';
const res = await apiContext.get(
`/api/v1/services/driveServices/name/${encodeURIComponent(name)}`
);

return res.ok();
}

async delete(apiContext: APIRequestContext) {
const serviceResponse = await apiContext.delete(
`/api/v1/services/driveServices/name/${encodeURIComponent(
Expand Down
Loading