Advertisement
Guest User

Consent.Assertions.fs

a guest
Jun 29th, 2019
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
F# 3.43 KB | None | 0 0
  1. module Consent.Assertions
  2.  
  3. open canopy.classic
  4. open canopy.runner.classic
  5. open Consent.Index
  6.  
  7. let smoke () =
  8.     context "smoke Consent Assertions"
  9.     once (fun _ ->
  10.         Logout.Flows.logoutOfApplication ()
  11.         Login.Flows.loginToApplication EnvProps.username EnvProps.password
  12.         Grants.Index.revokeAccessToSpecificClient EnvProps.clientId
  13.         Consent.Index.navigateToConsentPage EnvProps.clientId EnvProps.redirectUri
  14.     )
  15.  
  16.     "should be on the Consent page" &&& fun _ ->
  17.         pageTitle == EnvProps.clientId + " is requesting your permission"
  18.  
  19. let full () =
  20.     context "full Consent Assertions"
  21.     once (fun _ ->
  22.         Logout.Flows.logoutOfApplication ()
  23.         Login.Flows.loginToApplication EnvProps.username EnvProps.password
  24.         Grants.Index.revokeAccessToSpecificClient EnvProps.clientId
  25.         Consent.Index.navigateToConsentPage EnvProps.clientId EnvProps.redirectUri
  26.     )
  27.  
  28.     "page title should contain information about client" &&& fun _ ->
  29.         pageTitle == EnvProps.clientId + " is requesting your permission"
  30.  
  31.     "should contain a description" &&& fun _ ->
  32.         pageDescription == "Uncheck the permissions you do not wish to grant."
  33.  
  34.     "should contain a way to accept permission request" &&& fun _ ->
  35.         yesAllowAccess == "Yes, Allow"
  36.  
  37.     "should contain a way to not allow permission request" &&& fun _ ->
  38.         noToAccess == "No, Do Not Allow"
  39.  
  40.     "should contain details about personal information" &&& fun _ ->
  41.         personalInfoHeading == "Personal Information"
  42.  
  43.     "should contain user identifier section" &&& fun _ ->
  44.         userIdentitiferLabel == "Your user identifier"
  45.  
  46.     "should require user identifier section" &&& fun _ ->
  47.         userIdentitiferRequiredLabel == "(required)"
  48.  
  49.     "should default checkbox for user identifier checkbox to selected" &&& fun _ ->
  50.         selected userIdentitiferCheckbox
  51.  
  52.     "should contain checkbox user profile checkbox" &&& fun _ ->
  53.         userProfileLabel == "User profile"
  54.  
  55.     "should default checkbox for user profile checkbox to selected" &&& fun _ ->
  56.         selected userProfileCheckbox
  57.  
  58.     "should contain user profile permission description" &&& fun _ ->
  59.         userProfilePermissionDetails == "Your user profile information (first name, last name, etc.)"
  60.  
  61.     "should contain details about Applciation requested Access" &&& fun _ ->
  62.         applicationAccessHeading == "Application Access"
  63.  
  64.     "should contain access scope of API" &&& fun _ ->
  65.         apiApplciationAccessLabel == "My API #1"
  66.  
  67.     "should default checkbox access scope of API to selected" &&& fun _ ->
  68.         selected apiApplciationAccess
  69.  
  70.     "should contain access scope of Role" &&& fun _ ->
  71.         rolesApplicationAccessLabel == "Role"
  72.  
  73.     "should default checkbox access scope of API to selected" &&& fun _ ->
  74.         selected rolesApplicationAccess
  75.  
  76.     "should contain checkbox for Remember My Decision" &&& fun _ ->
  77.         rememberDecisionLabel == "Remember My Decision"
  78.  
  79.     "should default checkbox Remember My Decision to selected" &&& fun _ ->
  80.         selected rememberDecisionCheckbox
  81.  
  82.     "should contain a link to the clients url" &&! fun _ ->
  83.         clientUrl == EnvProps.clientId
  84.  
  85.     "should contain a link to the clients url" &&! fun _ ->
  86.         // Note that the href for this client will be ssl
  87.         clientUrlByHref EnvProps.baseUri == EnvProps.clientId
  88.  
  89.  
  90. let all () =
  91.   smoke()
  92.   full()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement