sensiolabs / BehatPageObjectExtension

MIT License
116 stars 48 forks source link

verifyUrl() can report expected and found URL as the same #100

Closed phil-davis closed 7 years ago

phil-davis commented 7 years ago

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.

jakzal commented 7 years ago

Fix merged.