minkphp / MinkBundle

Mink library integration bundle for Symfony2
MIT License
60 stars 18 forks source link

Have Mink run multiple browsers in a single test #64

Open hs2323 opened 8 years ago

hs2323 commented 8 years ago

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 commented 8 years ago

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:

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 commented 8 years ago

@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 commented 8 years ago

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: