Cannot test for cookies

I need to test that a cookie is set once a user signs up by filling a sign up form.

I was using HTTP tests since the Browser tests cannot assert cookies.

This is my code below:-

test('sets cookie on registration', async ({ client }) => {
  const response = await client
    .session('quciksession', 1)
      username: 'username,
      email: '',
      password: 'password

  response.assertPlainCookie('test', 'test')

This always returns InvalidSessionException: E_INVALID_SESSION: Invalid session.

I disable CSRF for testing too.

Any ideas how to test for this case?

1 Like