Behat not working with ip address

Behat not working with ip address

by Rajesh Taneja -
Number of replies: 0

Recently behat has been failing with following error:

Notice: Undefined index: host in /var/lib/jenkins/git_repositories/MOODLE_25_STABLE/vendor/symfony/browser-kit/Symfony/Component/BrowserKit/CookieJar.php line 217

This is happening because of recent fix which got integrated to symfony - browserkit https://github.com/symfony/symfony/commit/65b98102d16d99db96bf509b270b2a304f38adbb

Reason:

If URL is ip address then above change converts http://127.0.0.1/foo => 27.0.0.1/foo

Workaround:

Use localhost or domain name for behat site.

  1. Set $CFG->behat_wwwroot = 'http://localhost';
  2. mdk config set behat.host localhost (for mdk users)

Issues to look for:

symfony: https://github.com/symfony/symfony/issues/10641

Moodle: MDL-44975

Average of ratings: Useful (1)