@@ -10,16 +10,7 @@ const filePath = 'test-data/studyRegistrationTest/studyRegistrationData.json';
10
10
I . cache = { } ;
11
11
const cedarUUID = 'c5891154-750a-4ed7-83b7-7cac3ddddae6' ;
12
12
13
- AfterSuite ( async ( { users, fence, requestor } ) => {
14
- // // deleting the dummy metadata wih DID
15
- // console.log('Deleting the Study ...');
16
- // try {
17
- // await mds.do.deleteMetadataRecord(users.user2.accessTokenHeader, I.cache.applicationID);
18
- // } catch (err) {
19
- // console.error(err);
20
- // }
21
-
22
-
13
+ AfterSuite ( async ( { users, fence, requestor, mds } ) => {
23
14
// revoking the request access
24
15
const requestData = await requestor . do . getRequestData ( users . user2 . accessTokenHeader ) ;
25
16
requestData . revoke = true ;
@@ -35,14 +26,25 @@ AfterSuite (async ({ users, fence, requestor }) => {
35
26
await requestor . do . signedRequest ( revokeReqID ) ;
36
27
37
28
userInfo = await fence . do . getUserInfo ( users . user2 . accessToken ) ;
38
- console . log ( `### UserInfo from fence endpoint: ${ userInfo } ` ) ;
39
29
expect ( userInfo . data . authz ) . to . not . have . property ( `${ I . cache . policy_id } ` ) ;
40
30
41
31
// deleting the request from requestor db
42
32
const deleteRequest = await requestor . do . deleteRequest ( I . cache . requestID ) ;
43
33
if ( deleteRequest . status === 200 ) {
44
34
console . log ( `Request ${ I . cache . requestID } is deleted successfully` ) ;
45
35
}
36
+ // delete the above created revoke request
37
+ await requestor . do . deleteRequest ( revokeReqID ) ;
38
+
39
+ // deleting the dummy metadata wih DID
40
+ console . log ( 'Deleting the Study ...' ) ;
41
+ try {
42
+ await mds . do . deleteMetadataRecord ( users . user2 . accessTokenHeader , I . cache . applicationID ) ;
43
+ } catch ( err ) {
44
+ console . error ( err ) ;
45
+ }
46
+
47
+ // TODO - clean up the CEDAR instance
46
48
} )
47
49
48
50
Scenario ( 'Register a new study registration' , async ( { I, mds, users, home, discovery, studyRegistration, requestor } ) => {
@@ -88,7 +90,7 @@ Scenario('Register a new study registration', async ({ I, mds, users, home, disc
88
90
studyRegistration . do . searchStudy ( I . cache . applicationID ) ;
89
91
I . click ( studyRegistration . props . requestAccessButton ) ;
90
92
await studyRegistration . do . fillRequestAccessForm ( users . user2 . username , projectTitle ) ;
91
- I . click ( studyRegistration . props . goToDiscoverPageButton ) ;
93
+ // I.click(studyRegistration.props.goToDiscoverPageButton);
92
94
// get request ID by sending request to requestor end point
93
95
I . cache . requestID = await studyRegistration . do . getRequestId ( users . user2 . accessTokenHeader ) ;
94
96
I . cache . policyID = await requestor . do . getPolicyID ( users . user2 . accessTokenHeader ) ;
0 commit comments