Cookies
DrevOps\BehatSteps\Steps\Web\CookieTrait - Source, Example, Helpers
Verify and inspect browser cookies.
- Assert cookie existence and values with exact or partial matching.
- Read cookies through whichever browser driver provides the cookie capability.
Steps
@Then the cookie :name should exist
Assert that a cookie exists
Then the cookie "session_id" should exist
@Then the cookie :name with the value :value should exist
Assert that a cookie exists with a specific value
Then the cookie "language" with the value "en" should exist
@Then the cookie :name with a value containing :partial_value should exist
Assert that a cookie exists with a value containing a partial value
Then the cookie "preferences" with a value containing "darkmode" should exist
@Then a cookie with a name containing :partial_name should exist
Assert that a cookie with a partial name exists
Then a cookie with a name containing "session" should exist
@Then a cookie with a name containing :partial_name and the value :value should exist
Assert that a cookie with a partial name and value exists
Then a cookie with a name containing "user" and the value "admin" should exist
@Then a cookie with a name containing :partial_name and a value containing :partial_value should exist
Assert that a cookie with a partial name and partial value exists
Then a cookie with a name containing "user" and a value containing "admin" should exist
@Then the cookie :name should not exist
Assert that a cookie does not exist
Then the cookie "old_session" should not exist
@Then the cookie :name with the value :value should not exist
Assert that a cookie with a specific value does not exist
Then the cookie "language" with the value "fr" should not exist
@Then the cookie :name with a value containing :partial_value should not exist
Assert that a cookie with a value containing a partial value does not exist
Then the cookie "preferences" with a value containing "lightmode" should not exist
@Then a cookie with a name containing :partial_name should not exist
Assert that a cookie with a partial name does not exist
Then a cookie with a name containing "old" should not exist
@Then a cookie with a name containing :partial_name and the value :value should not exist
Assert that a cookie with a partial name and value does not exist
Then a cookie with a name containing "user" and the value "guest" should not exist
@Then a cookie with a name containing :partial_name and a value containing :partial_value should not exist
Assert that a cookie with a partial name and partial value does not exist
Then a cookie with a name containing "user" and a value containing "guest" should not exist