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.

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

Drupal 8.4.0-alpha1 will be released the week of July 31, 2017, which means new developments and disruptive changes should now be targeted against the 8.5.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.5.x-dev » 8.6.x-dev

Drupal 8.5.0-alpha1 will be released the week of January 17, 2018, which means new developments and disruptive changes should now be targeted against the 8.6.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.6.x-dev » 8.7.x-dev

Drupal 8.6.0-alpha1 will be released the week of July 16, 2018, which means new developments and disruptive changes should now be targeted against the 8.7.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.7.x-dev » 8.8.x-dev

Drupal 8.7.0-alpha1 will be released the week of March 11, 2019, which means new developments and disruptive changes should now be targeted against the 8.8.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.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

nod_’s picture

Status: Active » Closed (won't fix)
Issue tags: -JavaScript +JavaScript

So for "automated front-end testing" we now have nightwatch https://www.drupal.org/docs/testing/javascript-testing-using-nightwatch

closing because of this, in case the parent issue goes somewhere we might want to reopen but it's not something in the works at the moment.