...
- Do a normal install on the machine you wish to test on (this is so a valid configuration file is present)
Create a behat.xml file in your config directory. It should contain the following settings:
Code Block language xml title behat.xml <?xml version="1.0" encoding="UTF-8"?> <rogo> <website>http://localhost:8000<8000/</website> <db_database>behat_database_schema_name</db_database> <db_user>username</db_user> <db_password>password</db_password> <data>path_to_behat_user_data</data> <faildump>path_for_screenshots_of_failures</faildump> </rogo>
- Run the following script:
testing/behat/cli/init.php
- Download selenium (V3.x is supported) from http://www.seleniumhq.org/download/
- Download ChromeDriver from https://sites.google.com/a/chromium.org/chromedriver/
...
- Start the webserver referenced in behat's website setting. You can use the builtin php web server with the following command: php
php -S localhost:8000
- Start Selenium with a command similar to: java
java -Dwebdriver.chrome.driver=<path_to_chromedriver> -jar selenium-server-standalone-<version_number>.jar
-Dwebdriver.chrome.driver=<path_to_chromedriver> - Run the following command to run the test suite:
vendor/bin/behat --config <rogo_root_directory>/testing/behat/config/behat.yml
Additional information
Info | ||
---|---|---|
| ||
It is also possible to configure behat using the main Rogo config using the following settings:
|
...
5. Run the following command to run the test suite: vendor/bin/behat --config <rogo_root_directory>/testing/behat/config/behat.yml
Ideas for the future
We can probably set things up so that our tests will run automatically in the cloud on something like: https://travis-ci.com/