Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch behat/mink-extension to friends-of-behat/mink-extension #33

Closed
kdambekalns opened this issue Jun 22, 2023 · 6 comments
Closed

Switch behat/mink-extension to friends-of-behat/mink-extension #33

kdambekalns opened this issue Jun 22, 2023 · 6 comments
Assignees

Comments

@kdambekalns
Copy link
Member

The original package is about to be marked as abandoned, see Behat/MinkExtension#370 (comment)

@baschny
Copy link
Contributor

baschny commented Jun 29, 2023

I just coincidentally worked on this one just today and this is a maze of dependencies, abandoned projects, forks and misinformation on the net. Is Behat not really the "way to go" anymore for PHP based BDD? Is there a better / good alternative to that?

Meanwhile we still use it, and can confirm that this setup works for us (Neos 8):

{
  "require": {
    "behat/behat": "^3.13",
    "friends-of-behat/mink-extension": "^2.7",
    "behat/mink-browserkit-driver": "^2.1",
    "symfony/http-client": "^6.3",
    "behat/mink-selenium2-driver": "^1.6",
    "psr/container": "^1.1"
  },
  "config": {
    "bin-dir": "../../bin/"
  }
}

Comments on that:

  • https://github.com/minkphp/MinkGoutteDriver is also deprecated and it recommends using behat/mink-browserkit-driver instead
  • Original https://github.com/Behat/MinkExtension is - as you noted - abandoned and does not support "browserkit"
  • friends-of-behat/mink-extension added browserkit support, see Add support for BrowserKit driver FriendsOfBehat/MinkExtension#14
  • symfony/http-client is what makes the browserkit driver "work" (the driver within the driver...)
  • Since these packages all work on later Symfony versions than neos/flow, the psr/container requirement is just there to install older versions of this, else Flow/Neos will not be able to instanciate objects (i.e. Declaration of Neos\Flow\ObjectManagement\ObjectManagerInterface::has($objectName) must be compatible with Psr\Container\ContainerInterface::has(string $id): bool in /app/Packages/Framework/Neos.Flow/Classes/ObjectManagement/ObjectManagerInterface.php on line 60

To "activate" it, you need to:

  • add to behat.yml:
  extensions:
    Behat\MinkExtension:
      ...
      browserkit_http: ~
      ...
  • remove goutte

@kdambekalns
Copy link
Member Author

I just coincidentally worked on this one just today and this is a maze of dependencies, abandoned projects, forks and misinformation on the net. Is Behat not really the "way to go" anymore for PHP based BDD? Is there a better / good alternative to that?

I checked, and it seems Codeception is a viable alternative…

Meanwhile we still use it, and can confirm that this setup works for us (Neos 8):

Thanks! I'll try that, very helpful!

@mhsdesign
Copy link
Member

We dont recommend behat/mink-extension anymore and this package was cleaned up with 9.0

@baschny
Copy link
Contributor

baschny commented Nov 7, 2023

@mhsdesign what's the alternative for browser testing which you (or the Neos Team) recommends?

@mhsdesign
Copy link
Member

I would like to move this discussion to slack. But I had good experience with playwright - I think there is no golden bullet

@baschny
Copy link
Contributor

baschny commented Nov 7, 2023

Yes, we had started this discussion once, now I recall: https://neos-project.slack.com/archives/C04PYL8H3/p1695294536168449

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants