@@ -10,14 +10,17 @@ import (
1010func TestHTTPVariableSections (t * testing.T ) {
1111 result := api.HTTPRequestResult {
1212 Variables : map [string ]string {
13- "authToken" : "token-123" ,
14- "shortCode" : "abc123" ,
15- "sessionID" : "session-123" ,
13+ "authToken" : "token-123" ,
14+ "resetToken" : "reset-123" ,
15+ "shortCode" : "abc123" ,
16+ "sessionID" : "session-123" ,
1617 },
1718 Request : api.CLIStepHTTPRequest {
1819 ResponseVariables : []api.HTTPRequestResponseVariable {
1920 {Name : "shortCode" , Path : ".short_code" },
21+ {Name : "resetToken" , BodyRegex : `/password-reset/([a-z0-9]+)` },
2022 {Name : "missingCode" , Path : ".missing_code" },
23+ {Name : "missingResetToken" , BodyRegex : `/missing/([a-z0-9]+)` },
2124 },
2225 ResponseHeaderVariables : []api.HTTPRequestResponseHeaderVariable {
2326 {Name : "sessionID" , Header : "Set-Cookie" , Regex : "session_id=([^;]+)" },
@@ -42,10 +45,12 @@ func TestHTTPVariableSections(t *testing.T) {
4245
4346 wantContains := []string {
4447 "Variables Saved:" ,
48+ "resetToken: reset-123 (Response Body pattern)" ,
4549 "sessionID: session-123 (Response Header Set-Cookie matching session_id=([^;]+))" ,
4650 "shortCode: abc123 (JSON Body .short_code)" ,
4751 "Variables Missing:" ,
4852 "missingCode: [not found] (JSON Body .missing_code)" ,
53+ "missingResetToken: [not found] (Response Body pattern)" ,
4954 "missingSessionID: [not found] (Response Header Set-Cookie matching missing=([^;]+))" ,
5055 "Variables Available:" ,
5156 "authToken: token-123 (Request Header \" Authorization\" )" ,
0 commit comments