I'm having issue running my Behat test scripts on our Drupal site when HTTPS is turned on. I'm using Drush driver to dynamically create and log in user for a particular role. This works fine if our site is on HTTP. But when I change the base_url in behat.yml file to HTTPS://oursite.com, I will get username field not found. It seems that $element = $this->getSession()->getPage(); in DrupalContext.php returns obfuscated page elements when trying to get the page contents in HTTPS. Which I think is the reason why I'm getting the username not found error.

So, has anyone been able to run Behat with Drush against a HTTPS Drupal site? Thanks.

Comments

jerry_pham created an issue. See original summary.

jerry_pham’s picture

Title: Behat/Drush testing on HTTPS Drupal site » Behat/Drush/Phantomjs testing on HTTPS Drupal site
Issue tags: -behat drupal https +behat drupal https phantomjs

Thanks to Chris Hoffman at Acquia for finding the solution for this issue I was having ( https://gist.github.com/callado4/5068836#gistcomment-1695996 )

Basically, I needed to add "--ignore-ssl-errors=true" on the command line when starting up phantomjs. Without this argument, you would get ElementNotFoundException errors for all your scenarios.

phantomjs --webdriver=8643 --ignore-ssl-errors=true

johnennew’s picture

HI - this module is no longer supported - I'd highly recommend switching the behat drupal extension for behat testing with Drupal. The details are here:

https://www.drupal.org/project/drupalextension

http://behat-drupal-extension.readthedocs.org/en/3.0/