From 4c8385487d6cb98ba331d1763cc9204c37be15af Mon Sep 17 00:00:00 2001 From: Shailesh Parmar Date: Wed, 11 Sep 2024 15:51:06 +0530 Subject: [PATCH] added default role as data consumer --- .../e2e/Pages/EntityDataConsumer.spec.ts | 21 ------------------- .../ui/playwright/support/user/UserClass.ts | 8 ++++++- 2 files changed, 7 insertions(+), 22 deletions(-) diff --git a/openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/EntityDataConsumer.spec.ts b/openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/EntityDataConsumer.spec.ts index cd16a765f006..f04ce40727dd 100644 --- a/openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/EntityDataConsumer.spec.ts +++ b/openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/EntityDataConsumer.spec.ts @@ -63,27 +63,6 @@ entities.forEach((EntityClass) => { await user.create(apiContext); - const dataConsumerRoleResponse = await apiContext.get( - '/api/v1/roles/name/DataConsumer' - ); - - const dataConsumerRole = await dataConsumerRoleResponse.json(); - - await user.patch({ - apiContext, - patchData: [ - { - op: 'add', - path: '/roles/0', - value: { - id: dataConsumerRole.id, - type: 'role', - name: dataConsumerRole.name, - }, - }, - ], - }); - await EntityDataClass.preRequisitesForTests(apiContext); await entity.create(apiContext); await afterAction(); diff --git a/openmetadata-ui/src/main/resources/ui/playwright/support/user/UserClass.ts b/openmetadata-ui/src/main/resources/ui/playwright/support/user/UserClass.ts index 6174d901dbc9..11f8b4e5a9aa 100644 --- a/openmetadata-ui/src/main/resources/ui/playwright/support/user/UserClass.ts +++ b/openmetadata-ui/src/main/resources/ui/playwright/support/user/UserClass.ts @@ -48,8 +48,14 @@ export class UserClass { } async create(apiContext: APIRequestContext) { + const dataConsumerRoleResponse = await apiContext.get( + '/api/v1/roles/name/DataConsumer' + ); + + const dataConsumerRole = await dataConsumerRoleResponse.json(); + const response = await apiContext.post('/api/v1/users/signup', { - data: this.data, + data: { ...this.data, roles: [dataConsumerRole.id] }, }); this.responseData = await response.json();