The initiative to integration Behat into Drupal 8 core (for automated front-end testing) requires the addition of a new libraries to the core composer.json file.

Specifically:

  "require-dev": {
    "drupal/drupal-extension": "v1.0.2"
  },

must be added. This will in turn bring in the required Mink and Behat dependencies. This is a pre-requisite for the core Behat module, which is being worked on in #2232271: [Meta] Use Behat for validation testing.

Comments

grasmash’s picture

Status: Active » Needs work

Temporarily marking as "Needs Work" pending the following commit:
https://github.com/Berdir/drupalextension/commit/bb7e705c31064d616421949...

This is necessary to cope with recent changes to D8 Core session handling.

benjy’s picture

Others have noted frameworks we should consider instead of Behat. Personally, I think we're going towards Behat for the wrong reason so I want to express my doubts here for discussion.

  1. Behat is a BDD framework, BDD isn't how I would describe development in the Drupal community.
  2. Introducing a new concept in Gherkin is a big undertaking as a community. It's a whole new kettle of fish, it's simple to do basic stuff but it takes a certain level of experience and foresight to get the right amount of code vs Gherkin.
  3. People want Behat because they want to test JS. There are other alternatives that would allow us to use PHP, which, as well as been more familiar to most, would have much better IDE integration and would be easier for newcomers to understand.
xjm’s picture

Status: Needs work » Active

Marking active since there is no patch attached to this issue yet.

larowlan’s picture

Adding #2232861: Create BrowserTestBase for web-testing on top of Mink which is another alternative approach towards supporting JavaScript testing.

tunic’s picture

@benjy (#2)

  1. Only Simpletest is a official Drupal testing tool, so it's logical that no BDD is done: there's no tool available to do it. Introducing a new testing tool is something good as we allow more testing on Drupal. The community will carry with that, they are going to accept all the major changes from D7 to D9, why not using behat too?
  2. It's true that developing your own steps can be hard. But in addtion og behat native steps and Drupal generic steps added (see Drupal Extension for example) modules can (and should) add their own steps related to their functionlaities. This will much less necessary to write your own steps, and even when needed you'll have lot of examples from core and main contrib modules.
  3. It's certanly true that Behat is not exclusively for testing JS but Drupal contributors know that (as you can see in the comment #61 from [[2232271]]). I see no problem here.

Anyway I think that a new issue should be opened to discuss Behat and other alternatives as the named Codeception so other issues don't get this parallel discusion.

moshe weitzman’s picture

Berdir's patch to drupalextension was merged a while ago. Seems like we can proceed here and let committers make final decision here.

m1r1k’s picture

My latest patch #2232271: [Meta] Use Behat for validation testing contains integration with v3.0.x

nod_’s picture

Version: 8.0.x-dev » 8.1.x-dev
Component: javascript » base system

Definitely a base system thing.

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.0-beta1 was released on March 2, 2016, which means new developments and disruptive changes should now be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.0-beta1 was released on August 3, 2016, which means new developments and disruptive changes should now be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.0-alpha1 will be released the week of January 30, 2017, which means new developments and disruptive changes should now be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.