Problem/Motivation

See the parent issue #2232861: Create BrowserTestBase for web-testing on top of Mink for complete details.

Behat's Mink extension, and Mink's driver for Goutte, should be added to Drupal core so that the patch in #2232861: Create BrowserTestBase for web-testing on top of Mink easier to review.

Proposed Resolution

Add the behat/mink and behat/mink-goutte-driver packages to core's composer.json. This change has already been approved by Dries and being tackled in this issue as per #2232861-204: Create BrowserTestBase for web-testing on top of Mink.

Remaining tasks

Review and commit the patch.

User interface changes

None.

API changes

None. Only adding new components.

Commit message

git commit -m 'Issue #2433009 by hussainweb, grom358, daffie, larowlan, alexpott, pcambra, benjy, jibran, phenaproxima, moshe weitzman, nick_schuch, neclimdul: Add Mink, with Goutte driver, to core'

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

phenaproxima’s picture

Component: other » simpletest.module

Changing category.

hussainweb’s picture

Issue summary: View changes
Status: Active » Needs review
FileSize
21.7 KB
1.84 MB

Initial patch, and tweaking the IS a bit.

hussainweb’s picture

Issue summary: View changes
webchick’s picture

Can someone please help craft an accurate commit message and add it to the top of the issue summary? There were lots more people involved over at #2232861: Create BrowserTestBase for web-testing on top of Mink and want to make sure they get credit, too. :)

hussainweb’s picture

Issue summary: View changes

I have added all the names from that issue to a commit message in IS. Here it is again:

git commit -m 'Issue #2433009 by hussainweb, grom358, daffie, larowlan, alexpott, pcambra, benjy, jibran, phenaproxima, moshe weitzman, nick_schuch: Add Mink, with Goutte driver, to core'

The very first patch in that issue has changes to composer.json, which is what this is. That is why, I am keeping all the names.

neclimdul’s picture

Status: Needs review » Reviewed & tested by the community

Applied composer changes and ran composer and for all intents and purposes came up with the same patch. Since this is already approved and we've got the commit message I'll bump it RTBC.

daffie’s picture

daffie’s picture

+1 for RTBC.

daffie’s picture

Priority: Normal » Major

The parent issue is major so should this one.

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

The patch in #5 changed the following file perms to 644 - whilst that is the correct permissions we should not changing them - we should be filing upstream issues.

git pre-commit check failed: file core/vendor/behat/mink-browserkit-driver/README.md should be 644 not 755
git pre-commit check failed: file core/vendor/behat/mink-goutte-driver/README.md should be 644 not 755
git pre-commit check failed: file core/vendor/symfony/dom-crawler/Symfony/Component/DomCrawler/Crawler.php should be 644 not 755
git pre-commit check failed: file core/vendor/symfony/dom-crawler/Symfony/Component/DomCrawler/Tests/CrawlerTest.php should be 644 not 755

This issue is a major task that will eventually improve testing significantly and the disruption it introduces is zero. Per https://www.drupal.org/core/beta-changes, this is a good change to complete during the Drupal 8 beta phase. Committed 2b96082 and pushed to 8.0.x. Thanks!

  • alexpott committed 2b96082 on 8.0.x
    Issue #2433009 by hussainweb, grom358, daffie, larowlan, alexpott,...
larowlan’s picture

Status: Fixed » Needs work

Sorry to be a pain, but I think this needs to be rolled back.
We ended up adding guzzle 3 back into core.
goutte should have been 2.0 (I ported it to guzzle 5 as part of #2232861: Create BrowserTestBase for web-testing on top of Mink)

larowlan’s picture

To make this work correctly, we have to nominate goutte 2.0 in our composer.json so composer doesn't get a choice between 1.x and 2.x (mink-goutte-driver has require: fabot/goutte: ~1.0.4|~2.0).

So what happened was composer said - ok 1.0.4 is ok, which relies on guzzle 3.

If we nominate ~2.0 in our code, we'll get the right one.

  • alexpott committed de0c4fb on 8.0.x
    Revert "Issue #2433009 by hussainweb, grom358, daffie, larowlan,...
neclimdul’s picture

spent 2 min testing this and ~2.0 doesn't work. there isn't a release in packagist that has the 5 support.

neclimdul’s picture

Sorry looked into this more that my last comment wasn't really clear enough. It doesn't work but the reason is a little more involved. Larowlan upgraded Goute to support 4.* and those changes are in the 2.0 releases of Goute but core has 5.* and the commit that raises the dependencies in their composer.json is not in any releases.

https://github.com/FriendsOfPHP/Goutte/commit/33b16e073667a3408b6a1e8c46...

We could probably use dev-master which is probably what the other patch was doing which isn't really the greatest or we can bugask very nicely for Fabien to make a release.

neclimdul’s picture

In the interest of unblocking things, dev-master might look like this.

daffie’s picture

The goutte browser driver to be used on top of the functional testsuite mink is not chosen because it is the browser driver that we want to use. The goutte browser driver has been chosen because it does not support javascript. And that is because the testbot does not support javascript. Of course we want functional testing with javascript enabled and that means that the testbot needs to support it. #2232861: Create BrowserTestBase for web-testing on top of Mink lays the foundation so that work on the testbot for supporting javascript can begin.

As long as functional testsuite mink does not support javascript it will not be used be drupal core. So using the goutte browser driver in a dev-master version is in my eyes not a big problem. Although I wood rather not use the dev-master release of any kind of library in drupal core, I this case it is temporary and only used as scaffolding and not actively used by drupal core.

daffie’s picture

Status: Needs review » Needs work

The following libraries are added in this patch:

  1. behat/mink with version v1.6.1
  2. behat/mink-browserkit-driver with version v1.2.0
  3. behat/mink-goutte-driver with version v1.1.0
  4. fabpot/goutte with version dev-master
  5. symfony/browser-kit with version v2.6.4
  6. symfony/dom-crawler with version v2.6.4

All of these libraries are new in Drupal core, so problems there.

I have combined this patch with the latest patch from #2232861: Create BrowserTestBase for web-testing on top of Mink and let the testbot have a look at it. It came back green.

It all looks good to me. I have only one question left:

+++ b/core/composer.lock
@@ -2651,7 +2970,9 @@
+    "stability-flags": {
+        "fabpot/goutte": 20
+    },

Can someone explain to me what "fabpot/goutte": 20 does and why it is needed.

neclimdul’s picture

Status: Needs work » Needs review

All of these libraries are new in Drupal core, so problems there.

What is the problem? The interdiff should show that the only change fromt he committed version is the removal of the guzzle libraries and symfony/finder and the change of the goutte version.

+++ b/core/composer.lock
@@ -2651,7 +2970,9 @@
+    "stability-flags": {
+        "fabpot/goutte": 20
+    },

Can someone explain to me what "fabpot/goutte": 20 does and why it is needed.

That is in the lock file so it was obviously added composer. If my understanding is correct the reason is I explicitly installed goutte from a dev version and core's composer.json requires stable packages. That is to say it does not have "minimum-stability": "dev",. This is flagging that this package can have a different stability from the general rule for the package. When we move to a non-dev release this would go away.

neclimdul’s picture

Status: Needs review » Needs work

Sorry, I didn't mean to change the status because I wasn't sure what the library problem was.

daffie’s picture

Status: Needs work » Reviewed & tested by the community

It all looks good to me.

The following libraries are added in this patch:

  1. behat/mink with version v1.6.1
  2. behat/mink-browserkit-driver with version v1.2.0
  3. behat/mink-goutte-driver with version v1.1.0
  4. fabpot/goutte with version dev-master
  5. symfony/browser-kit with version v2.6.4
  6. symfony/dom-crawler with version v2.6.4

It gets a RTBC from me.

For the committer:

+++ b/core/composer.lock
@@ -2651,7 +2970,9 @@
+    "stability-flags": {
+        "fabpot/goutte": 20
+    },

This code is added by composer. Neclimdul and myself have the idea that the code is okay. But I would like to mention it anyway.

larowlan’s picture

Issue summary: View changes

+1 - no extra guzzle packages and the 2.x branch of Goutte - thanks folks

larowlan’s picture

webchick’s picture

Status: Reviewed & tested by the community » Fixed

Ok, let's try this again.

Committed and pushed to 8.0.x. Thanks!

  • webchick committed d653d38 on 8.0.x
    Issue #2433009 by hussainweb, grom358, neclimdul, daffie, larowlan,...
hussainweb’s picture

I am not sure if I'm missing something. The commit mentioned earlier only shows that core/composer.json and core/composer.lock have been changed, but the libraries themselves have not been added.

webchick’s picture

OH dang it. I committed the wrong patch. Sec.

webchick’s picture

There that should be much more betterer. :)

  • webchick committed 3eafd2d on 8.0.x
    Revert "Issue #2433009 by hussainweb, grom358, neclimdul, daffie,...
  • webchick committed ddbb2c7 on 8.0.x
    Issue #2433009 by hussainweb, grom358, neclimdul, daffie, larowlan,...
hussainweb’s picture

Yes, looks fine now. :)

larowlan’s picture

@fabpot just rolled 2.0.3 so can we get a follow up to remove dev-master for Goutte?

hussainweb’s picture

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.