Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

Have Mink run multiple browsers in a single test #64

Open
hs2323 opened this issue Jan 21, 2016 · 3 comments
Open

Have Mink run multiple browsers in a single test #64

hs2323 opened this issue Jan 21, 2016 · 3 comments

Comments

@hs2323
Copy link

hs2323 commented Jan 21, 2016

I currently have this working with the Selenium driver. When I explicitly set the browser_name in the config_test.yml, it works. It seems I can only pass it one browser/selenium location/etc. Is there any way to have this so when I run PHPUnit from the command line, it can test multiple browsers at once (not necessarily in parallel) and potentially multiple Selenium instances? I know it is possible to do this in the PHPUnit-Selenium library by setting multiple browser parameters in a phpunit.xml file:

<selenium>
    <browser name="Internet Explorer" browser="*iexplore" host="192.168.56.101"  port="4444" />      
    <browser name="Firefox" browser="*firefox" />
    <browser name="Chrome" browser="googlechrome" />
</selenium>
@aik099
Copy link
Member

aik099 commented Jan 22, 2016

The MinkBundle (project you've reporting this issue in) is for Behat.

As for PHPUnit yes, you have some options when you start using https://github.com/minkphp/phpunit-mink for integration with Mink. It provides base test case class called BrowserTestCase that have ability to specify:

  • several browsers per test case class which will result in all tests in that class to be executed on each of specified browsers
  • browsers for each test in a test case class separately

When specifying a browser you can use any supported drivers (e.g. Selenium, Zombie, etc.).

This example from the docs explains that in detail: http://phpunit-mink.readthedocs.org/en/latest/getting-started.html

@stof
Copy link
Member

stof commented Feb 26, 2016

@aik099 no. MinkBundle is not for Behat (https://github.com/Behat/MinkExtension/ is). MinkBundle is for configuring Mink inside the Symfony DIC, to be used in a phpunit testsuite later (by taking it from the kernel of a KernelTestCase). In my opinion, this bundle was a total mistake (at that time, the integration of Behat and Symfony2 was also using a bundle to bring Behat into Symfony instead of bring Symfony into Behat, but BehatBundle is unmaintained since a long time).

So my own recommendation would be to stop using this bundle entirely, in favor of the proper integration (phpunit-mink in this case)

/cc @minkphp/minkbundle

@aik099
Copy link
Member

aik099 commented Feb 26, 2016

Easy to be confused because just by the name MinkBundle and MinkExtension are similar. Before they were even in same organization (even more confusion).

Maybe we can do this:

  • on MinkBundle README specify, that please use PHPUnit-Mink instead
  • do the same in composer.json

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

No branches or pull requests

3 participants