Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
When I run behat testscenario:
@api
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"
I am getting following error.
No ability to create nodes in Drupal\Driver\DrushDriver. Put `@api` into your feature and add an API driver (ex: `api_driver: drupal`) in behat.yml. (Drupal\Driver\Exception\UnsupportedDriverActionException)
Comments
Comment #2
johnreytanquinco CreditAttribution: johnreytanquinco commentedCan you post your
behat.yml
content?Comment #3
shwetaneelsharma CreditAttribution: shwetaneelsharma at Axelerant commentedDrupal extension in Behat has 3 drivers - Blackbox, Drupal API, and Drush. You can see a quick comparison listed on this page. So, Drush driver doesn't have the ability to create nodes, so you change your behat.yml to point to the drupal_api driver like this https://behat-drupal-extension.readthedocs.io/en/3.1/drupalapi.html
Also, make a note of this point - With the drupal_api driver, you can only execute scripts on your local instance and not on a remote server. To conclude, if you are executing scripts on a local instance, go ahead with the drupal_api driver or else switch to drush driver and use steps supported by it.