I have the following set up. I vagrant machine with d8 site setup. The files are common. I have replicated the DB in my laptop outside the host so I can run the behat tests faster. The DB is a dump of the one in the vagrant host.
Behat for host:
default:
suites:
default:
contexts:
- FeatureContext:
- "/vagrant/images/behat"
- 813
- 1855
- Drupal\DrupalExtension\Context\DrupalContext
- Drupal\DrupalExtension\Context\MinkContext
- Drupal\DrupalExtension\Context\MessageContext
- Drupal\DrupalExtension\Context\DrushContext
extensions:
Behat\MinkExtension:
selenium2: ~
base_url: http://mysite.dev # Replace with your site's URL
Drupal\DrupalExtension:
blackbox: ~
api_driver: 'drupal'
drush:
alias: 'local'
drupal:
drupal_root: '/vagrant/drupal'
Behat for local:
default:
suites:
default:
contexts:
- FeatureContext:
- "/vagrant/images/behat"
- 813
- 1855
- Drupal\DrupalExtension\Context\DrupalContext
- Drupal\DrupalExtension\Context\MinkContext
- Drupal\DrupalExtension\Context\MessageContext
- Drupal\DrupalExtension\Context\DrushContext
extensions:
Behat\MinkExtension:
selenium2:
browser: chrome
base_url: http://mysite.dev # Replace with your site's URL
Drupal\DrupalExtension:
blackbox: ~
api_driver: 'drupal'
drush:
alias: 'local'
drupal:
drupal_root: '/home/user/Projects/myproject/vagrant/drupal'
When I run the following scenario on the vagrant I can log in while in my local machine it fails to log in.
@node
Scenario: Create a node
Given I am logged in as a user with the "administrator" role
When I am viewing an "article" content with the title "My article"
Then I should see the heading "My article"
How can I resolve this?