Session steps
- setting a value in
session
save("favorite-superhero" -> "Batman")
- saving the entire response body to
session
save_body("response-snapshot")
- saving a value extracted from the response body to
session
save_body_path("city" -> "batman-city")
- asserting value in
session
session_value("favorite-superhero").is("Batman")
- asserting JSON value in
session
session_value("my-json-response").asJson.path("a.b.c").ignoring("d").is("...")
- asserting existence of value in
session
session_value("favorite-superhero").isPresent
session_value("favorite-superhero").isAbsent
- transforming a value in
session
transform_session("my-key")(_.toUpperCase)
- removing a key from
session
remove("temporary-key")
- rolling back a value in
session to its previous value
rollback("favorite-superhero")
- comparing two session values
session_values("key1", "key2").areEquals
session_values("key1", "key2").areNotEquals
session_values("key1", "key2").asJson.areEquals
- comparing current value with previous value of the same key
session_value("counter").hasEqualCurrentAndPreviousValues
session_value("counter").hasDifferentCurrentAndPreviousValues
- asserting on the full history of values for a key
session_history("status").containsExactly("pending", "active", "completed")
- additional assertions on session values
session_value("name").isNot("Joker")
session_value("name").containsString("Bat")
session_value("name").matchesRegex("B.*n".r)