@@ -33,7 +33,6 @@ import { TeamClass } from '../../support/team/TeamClass';
3333import { UserClass } from '../../support/user/UserClass' ;
3434import { createAdminApiContext , performAdminLogin } from '../../utils/admin' ;
3535import {
36- getApiContext ,
3736 redirectToHomePage ,
3837 toastNotification ,
3938 uuid ,
@@ -86,6 +85,7 @@ let user2: UserClass;
8685let user3 : UserClass ;
8786let tableEntity : TableClass ;
8887let tableEntity2 : TableClass ;
88+ let dataStewardPermissionTableUrl : string ;
8989let policy : PolicyClass ;
9090let role : RolesClass ;
9191let persona1 : PersonaClass ;
@@ -163,7 +163,16 @@ test.beforeAll('Setup pre-requests', async ({ browser }) => {
163163 await user3 . create ( apiContext ) ;
164164 await user3 . setAdminRole ( apiContext ) ;
165165 await tableEntity . create ( apiContext ) ;
166- await tableEntity2 . create ( apiContext ) ;
166+ const { entity : dataStewardPermissionTable } = await tableEntity2 . create (
167+ apiContext
168+ ) ;
169+ await tableEntity2 . setOwner ( apiContext , {
170+ id : user3 . responseData . id ,
171+ type : 'user' ,
172+ } ) ;
173+ dataStewardPermissionTableUrl = `/table/${ encodeURIComponent (
174+ dataStewardPermissionTable . fullyQualifiedName
175+ ) } `;
167176 await policy . create ( apiContext , DATA_STEWARD_RULES ) ;
168177 await role . create ( apiContext , [ policy . responseData . name ] ) ;
169178 await persona1 . create ( apiContext , [ adminUser . responseData . id ] ) ;
@@ -475,35 +484,13 @@ test.describe('User with Data Steward Roles', () => {
475484 await settingPageOperationPermissionCheck ( dataStewardPage ) ;
476485 } ) ;
477486
478- test ( 'Check permissions for Data Steward' , async ( {
479- adminPage,
480- dataStewardPage,
481- } ) => {
487+ test ( 'Check permissions for Data Steward' , async ( { dataStewardPage } ) => {
482488 test . slow ( ) ;
483- await redirectToHomePage ( adminPage ) ;
484489
485490 await checkStewardServicesPermissions ( dataStewardPage ) ;
486491
487- const { apiContext, afterAction } = await getApiContext ( adminPage ) ;
488- try {
489- const tableResponse = await apiContext . get (
490- `/api/v1/tables/${ tableEntity2 . entityResponseData . id } `
491- ) ;
492- expect ( tableResponse . ok ( ) ) . toBeTruthy ( ) ;
493- const table = await tableResponse . json ( ) ;
494-
495- await tableEntity2 . setOwner ( apiContext , {
496- id : user3 . responseData . id ,
497- type : 'user' ,
498- } ) ;
499-
500- await dataStewardPage . goto (
501- `/table/${ encodeURIComponent ( table . fullyQualifiedName ) } `
502- ) ;
503- await waitForAllLoadersToDisappear ( dataStewardPage ) ;
504- } finally {
505- await afterAction ( ) ;
506- }
492+ await dataStewardPage . goto ( dataStewardPermissionTableUrl ) ;
493+ await waitForAllLoadersToDisappear ( dataStewardPage ) ;
507494
508495 await checkStewardPermissions ( dataStewardPage ) ;
509496 } ) ;
0 commit comments