vendredi 2 octobre 2015

Can't set cookie in the request

I'm using rest-assured library for the API tests and it seems like a new cookie can't be set. I can however modify the cookie which is set by the server.

given()
  .cookie("cookie1", "true")
  .get(url)
  .then()
  .assertThat().cookie("cookie", "yes");
// Fails with "Cookie "cookie1" was not
// defined in the response. Cookies are: cookie2=true, cookie3=true


given()
  .cookie("cookie2", "false")
  .get(url)
  .then()
  .assertThat().cookie("cookie2", "false");
// PASS

Aucun commentaire:

Enregistrer un commentaire