verifyUrl() checks the current URL against the expected URL. If they are different, it throws UnexpectedPageException and generates the text of the exception message by calling the methods again to get the current and expected URL. By the time of the 2nd call the browser can be on the expected page, resulting in a confusing message like:
exception 'SensioLabs\Behat\PageObjectExtension\PageObject\Exception\UnexpectedPageException' with message 'Expected to be on "http://owncloud:8889/index.php/settings/users" but found "http://owncloud:8889/index.php/settings/users" instead' in /home/travis/build/[secure]/core/lib/composer/sensiolabs/behat-page-object-extension/src/SensioLabs/Behat/PageObjectExtension/PageObject/Page.php:217
It would be nice to know what were the original values of current and expected URL that were (hopefully) different and caused the test to fail.
verifyUrl()
checks the current URL against the expected URL. If they are different, it throwsUnexpectedPageException
and generates the text of the exception message by calling the methods again to get the current and expected URL. By the time of the 2nd call the browser can be on the expected page, resulting in a confusing message like:It would be nice to know what were the original values of current and expected URL that were (hopefully) different and caused the test to fail.