Symfony 3.3 code for running Mink tests.
How to use this code:
-
First checkout on your development machine where you plan to run symfony a project based on Symfony 3.3. For example use the following command: symfony new mink_test 3.3
-
Copy locally to either the dev environment or a host machine this github repository.
-
Copy these sources files to the respective location on the development machine where you created the repository in step 1 above. For example: "tests/AppBundle/Controller/DefaultControllerTest.php" gets copied to the "tests/AppBundle/Controller/" folder.
-
Setup your test machine and run startx as per my article here: https://alvinbunk.wordpress.com/2016/08/03/using-mink-to-perform-functional-tests-in-symfony3-framework/
-
Make sure you have the 3 terminal windows open as per my above article. i.e. Selenium needs to be running.
-
Run the command "phpunit" from the Symfony root folder.
-
Watch the development machine as the tests automatically open a browser to run the various Mink test. Headless browser tests are run as well.
-
If you get errors, you haven't read the article correctly or you have missed something. Please double check everything!