@@ -23,7 +23,7 @@ type doneHttpMsg struct {
2323}
2424
2525type startHttpMsg struct {
26- path string
26+ url string
2727 method string
2828}
2929
@@ -78,7 +78,7 @@ func (m httpRootModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
7878 return m , tea .Quit
7979
8080 case startHttpMsg :
81- m .reqs = append (m .reqs , httpReqModel {request : fmt .Sprintf ("%s %s" , msg .method , msg .path ), tests : []testModel {}})
81+ m .reqs = append (m .reqs , httpReqModel {request : fmt .Sprintf ("%s %s" , msg .method , msg .url ), tests : []testModel {}})
8282 return m , nil
8383
8484 case resolveHttpMsg :
@@ -210,7 +210,14 @@ func httpRenderer(
210210 defer wg .Done ()
211211
212212 for i , req := range data .HttpTests .Requests {
213- ch <- startHttpMsg {path : req .Request .Path , method : req .Request .Method }
213+ url := req .Request .Path
214+ if req .Request .FullURL != "" {
215+ url = req .Request .FullURL
216+ }
217+ ch <- startHttpMsg {
218+ url : checks .InterpolateVariables (url , results [i ].Variables ),
219+ method : req .Request .Method ,
220+ }
214221 for _ , test := range req .Tests {
215222 ch <- startTestMsg {text : prettyPrintHTTPTest (test , results [i ].Variables )}
216223 }
@@ -250,13 +257,17 @@ func prettyPrintHTTPTest(test api.HTTPTest, variables map[string]string) string
250257 return fmt .Sprintf ("Expecting status code: %d" , * test .StatusCode )
251258 }
252259 if test .BodyContains != nil {
253- return fmt .Sprintf ("Expecting JSON body to contain: %s" , * test .BodyContains )
260+ interpolated := checks .InterpolateVariables (* test .BodyContains , variables )
261+ return fmt .Sprintf ("Expecting JSON body to contain: %s" , interpolated )
254262 }
255263 if test .BodyContainsNone != nil {
256- return fmt .Sprintf ("Expecting JSON body to not contain: %s" , * test .BodyContainsNone )
264+ interpolated := checks .InterpolateVariables (* test .BodyContainsNone , variables )
265+ return fmt .Sprintf ("Expecting JSON body to not contain: %s" , interpolated )
257266 }
258267 if test .HeadersContain != nil {
259- return fmt .Sprintf ("Expecting header to contain: '%s: %v'" , test .HeadersContain .Key , test .HeadersContain .Value )
268+ interpolatedKey := checks .InterpolateVariables (test .HeadersContain .Key , variables )
269+ interpolatedValue := checks .InterpolateVariables (test .HeadersContain .Value , variables )
270+ return fmt .Sprintf ("Expecting header to contain: '%s: %v'" , interpolatedKey , interpolatedValue )
260271 }
261272 if test .JSONValue != nil {
262273 var val any
@@ -274,6 +285,8 @@ func prettyPrintHTTPTest(test api.HTTPTest, variables map[string]string) string
274285 op = "to be greater than"
275286 } else if test .JSONValue .Operator == api .OpContains {
276287 op = "contains"
288+ } else if test .JSONValue .Operator == api .OpNotContains {
289+ op = "to not contain"
277290 }
278291 expecting := fmt .Sprintf ("Expecting JSON at %v %s %v" , test .JSONValue .Path , op , val )
279292 return checks .InterpolateVariables (expecting , variables )
0 commit comments