Function When_I_clear_cookie

  • When I clear cookie:

    When I clear cookie {string}
    

    Clear a specific browser cookie.

    Parameters

    • name: string
    • Optionaloptions: DataTable

    Returns void

    Clear the authId cookie:

    When I clear cookie "authId"
    

    With options:

    When I clear cookie "authId"
    | domain | example.com |
    | log | true |
    | timeout | 3000 |

    Cypress automatically clears all cookies before each test to prevent state from being shared across tests when test isolation is enabled. You shouldn't need to use this command unless you're using it to clear a specific cookie inside a single test or test isolation is disabled.