Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Added trailing slash to website URL, moved parameter order for java

...

  1. Do a normal install on the machine you wish to test on (this is so a valid configuration file is present) 
  2. Create a behat.xml file in your config directory. It should contain the following settings:

    Code Block
    languagexml
    titlebehat.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>
    


  3. Run the following script: testing/behat/cli/init.php
  4. Download selenium from http://www.seleniumhq.org/download/
  5. Download ChromeDriver from https://sites.google.com/a/chromium.org/chromedriver/

...

  1. 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
  2. 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>
  3. Run the following command to run the test suite: vendor/bin/behat --config <rogo_root_directory>/testing/behat/config/behat.yml

Additional information

Info
titleAlternative configuration

It is also possible to configure behat using the main Rogo config using the following settings:

  1. $cfg_behat_website - Should be a url and specific port, for example http://localhost:8000/
  2. $cfg_behat_db_database - Should be the name of a database schema that is different to the live schema, but on the same server
  3. $cfg_behat_data - The location that you wish behat to store user data files, must be different to the value of $cfg_rogo_data
  4. $cfg_behat_db_user - Username that can be used to fully control your database
  5. $cfg_behat_db_password - The password for the database user
Note
Settings in the behat.xml file will override any behat settings in the main config.inc.php file.


...

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/