You are here

README.txt in Bear 7

Same filename and directory in other branches
  1. 7.2 tests/README.txt
To set up test framework, run composer install in this directory.

After the installer runs, add your site to your machine's hosts file so the tests will be able to interact with the site.

Edit behat.yml to set the base_url and webroot properly.

If you do not have Selenium setup, you can only run tests with Goutte, which means tests will not use Javascript.
To run only tests that don't require Javascript, use:
    bin/behat --tags "~@javascript"

The tests must be run from the machine hosting the site.

To run tests with Selenium (tests with '@javascript' tag):
  wget http://selenium.googlecode.com/files/selenium-server-standalone-2.44.0.jar
    [May need to visit the website to determine the latest Selenium version]
  sudo apt-get install xvfb
  We need an older version of firefox, but we also need dependencies, so first: sudo apt-get install firefox
  Then remove it (the dependencies will stay though): sudo apt-get remove firefox
  Now get the older version:
  wget https://ftp.mozilla.org/pub/mozilla.org/firefox/releases/31.0/linux-i686/en-US/firefox-31.0.tar.bz2
  tar xvf firefox-31.0.tar.bz2
  Move the extracted firefox directory: mv firefox/ /opt/
  sudo ln -s /opt/firefox/firefox /usr/bin/firefox
  xvfb-run firefox to test that firefox works. You may get an error: Xlib:  extension "RANDR" missing on display ":99". That's safe to ignore.
  xvfb-run java -jar selenium-server-standalone-2.45.0.jar
  Run behat tests in another terminal window

File

tests/README.txt
View source
  1. To set up test framework, run composer install in this directory.
  2. After the installer runs, add your site to your machine's hosts file so the tests will be able to interact with the site.
  3. Edit behat.yml to set the base_url and webroot properly.
  4. If you do not have Selenium setup, you can only run tests with Goutte, which means tests will not use Javascript.
  5. To run only tests that don't require Javascript, use:
  6. bin/behat --tags "~@javascript"
  7. The tests must be run from the machine hosting the site.
  8. To run tests with Selenium (tests with '@javascript' tag):
  9. wget http://selenium.googlecode.com/files/selenium-server-standalone-2.44.0.jar
  10. [May need to visit the website to determine the latest Selenium version]
  11. sudo apt-get install xvfb
  12. We need an older version of firefox, but we also need dependencies, so first: sudo apt-get install firefox
  13. Then remove it (the dependencies will stay though): sudo apt-get remove firefox
  14. Now get the older version:
  15. wget https://ftp.mozilla.org/pub/mozilla.org/firefox/releases/31.0/linux-i686/en-US/firefox-31.0.tar.bz2
  16. tar xvf firefox-31.0.tar.bz2
  17. Move the extracted firefox directory: mv firefox/ /opt/
  18. sudo ln -s /opt/firefox/firefox /usr/bin/firefox
  19. xvfb-run firefox to test that firefox works. You may get an error: Xlib: extension "RANDR" missing on display ":99". That's safe to ignore.
  20. xvfb-run java -jar selenium-server-standalone-2.45.0.jar
  21. Run behat tests in another terminal window