Advertisement
Guest User

Consent.Actions.fs

a guest
Jun 29th, 2019
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
F# 1.59 KB | None | 0 0
  1. module Consent.Actions
  2.  
  3. open canopy.classic
  4. open canopy.runner.classic
  5. open Consent.Index
  6.  
  7. let smoke () =
  8.     context "smoke Consent actions"
  9.     once (fun _ ->
  10.         Logout.Flows.logoutOfApplication ()
  11.         Login.Flows.loginToApplication EnvProps.username EnvProps.password
  12.         Grants.Index.revokeAccessToSpecificClient EnvProps.clientId
  13.     )
  14.     before(fun _ ->
  15.         let theurl = Consent.Index.createConsentUrl EnvProps.clientId EnvProps.redirectUri;
  16.         System.Console.WriteLine(theurl);
  17.         url (Consent.Index.createConsentUrl EnvProps.clientId EnvProps.redirectUri)
  18.     )
  19.  
  20.     "should be on the Consent page" &&& fun _ ->
  21.         pageTitle == EnvProps.clientId + " is requesting your permission"
  22.  
  23. let full () =
  24.     context "full Consent actions"
  25.     once (fun _ ->
  26.         Logout.Flows.logoutOfApplication ()
  27.         Login.Flows.loginToApplication EnvProps.username EnvProps.password
  28.         Grants.Index.revokeAccessToSpecificClient EnvProps.clientId
  29.     )
  30.     before(fun _ ->
  31.         System.Console.WriteLine(Consent.Index.createConsentUrl EnvProps.clientId EnvProps.redirectUri);
  32.         url (Consent.Index.createConsentUrl EnvProps.clientId EnvProps.redirectUri)
  33.         pageTitle == EnvProps.clientId + " is requesting your permission"
  34.     )
  35.  
  36.     "should be on the Consent page" &&& fun _ ->
  37.         pageTitle == EnvProps.clientId + " is requesting your permission"
  38.  
  39.     "should be able to accept " &&& fun _ ->
  40.         pageTitle == EnvProps.clientId + " is requesting your permission"
  41.         click yesAllowAccess
  42.  
  43. let all () =
  44.   smoke()
  45.   full()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement