@@ -6,16 +6,15 @@ import exec from 'k6/execution';
66import http from 'k6/http' ;
77
88const portals = {
9- 'admin' : { envs : [ 'local' ] ,
9+ 'admin' : { envs : [ 'local' , 'dev' , 'test' , 'sandbox' ] ,
1010 signInPath : 'admin/internal/sign_in' ,
1111 protectedPath : 'admin/organizations' ,
1212 signInText : 'Log in' } ,
13- 'web' : { envs : [ 'local' ] ,
13+ 'web' : { envs : [ 'local' , 'dev' , 'test' , 'sandbox' ] ,
1414 signInPath : 'users/sign_in' ,
1515 protectedPath : 'organizations/foo/edit' ,
1616 signInText : 'Log in' } ,
17- // TODO: Add PACE cert when running in GHA (DPC-5222) and add 'dev' and 'test' back
18- 'portal' : { envs : [ 'local' , ] ,
17+ 'portal' : { envs : [ 'local' , 'dev' , 'test' ] ,
1918 signInPath : 'users/sign_in' ,
2019 protectedPath : 'organizations' ,
2120 signInText : 'Sign in' } ,
@@ -36,6 +35,7 @@ export async function checkPortalsWorkflow(data) {
3635 signInResponse ,
3736 {
3837 'sign in should return 200' : res => res . status == '200' ,
38+ 'sign in should have DPC' : res => res . body . includes ( "Data at the Point of Care" ) ,
3939 'sign in should have sign in text' : res => res . body . includes ( config [ 'signInText' ] )
4040 }
4141 ) ;
@@ -44,6 +44,21 @@ export async function checkPortalsWorkflow(data) {
4444 console . error ( signInResponse . body ) ;
4545 return ;
4646 }
47+
48+ const protectedPathResponse = http . get ( `${ host } /${ config [ 'protectedPath' ] } ` , { redirects : 0 } ) ;
49+ const checkProtectedPath = check (
50+ protectedPathResponse ,
51+ {
52+ 'protected path should return 302' : res => res . status == '302' ,
53+ 'protected path has location header' : res => res . headers [ 'Location' ] ,
54+ 'protected path location header should be sign in url' : res => res . headers [ 'Location' ] == signInUrl
55+ }
56+ ) ;
57+
58+ if ( ! checkProtectedPath ) {
59+ console . error ( protectedPathResponse . status ) ;
60+ console . error ( protectedPathResponse . headers ) ;
61+ }
4762}
4863
4964function urlRoot ( service ) {
0 commit comments