You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If the page to be visited is unreachable, the valid/2 function does not raise an error, leading to some potentially misleading error messages down the code path.
Test Code & HTML
The following test case and error message were discovered because I had failed to follow instructions and set Phoenix's server: true in my config/test.exs file. PEBKAC. :)
Using the following test:
test "view homepage", %{session: session} do
cookies =
session
|> visit("/")
|> set_cookie("foo", "bar")
|> visit("/")
|> Browser.cookies()
|> hd()
assert cookies["name"] == "foo"
assert cookies["value"] == "bar"
end
We get the following error message:
** (Wallaby.CookieError) The cookie you are trying to set has no domain.
You're most likely seeing this error because you're trying to set a cookie before
you have visited a page. You can fix this issue by calling `visit/1`
before you call `set_cookie/3`.
It would be useful if the visit/2 call would generate an error indicating that the browser was unable to reach the desired page.
The text was updated successfully, but these errors were encountered:
Issue
If the page to be visited is unreachable, the
valid/2
function does not raise an error, leading to some potentially misleading error messages down the code path.Test Code & HTML
The following test case and error message were discovered because I had failed to follow instructions and set Phoenix's
server: true
in myconfig/test.exs
file. PEBKAC. :)Using the following test:
We get the following error message:
It would be useful if the
visit/2
call would generate an error indicating that the browser was unable to reach the desired page.The text was updated successfully, but these errors were encountered: