Using behat/mink, I'm testing the "remember me" functionality. Functionally, when the user visits the main page, javascript/ajax code verifies if the user is "remembered". If yes, then the javascripts redirects to another page. My LoginPage
is defined with $path = '/login.html'
- after the redirect, I will end up on /main.html
.
In my context, I use $loginPage->open()
- however this throws exception Expected to be on "https://example.com/login.html" but found "https://example.com/main.html" instead
. Naturally, this aborts the execution and results in the test failing - yet this is exactly the behaviour I want.
How can I tell behat/mink to not verify URL or ignore URL mismatch?