Public test suite
Firefox is the default, and ArchivesSpace ships with the appropriate Firefox Webdriver executables for OSX and Linux.
To run using Chrome, you must first download the appropriate ChromeDriver
and place it somewhere in your OS system path. Mac users with Homebrew may accomplish this via
brew cask install chromedriver. Then export a SELENIUM_CHROME environment variable, e.g:
$ export SELENIUM_CHROME=true
$ export SELENIUM_HEADY_CHROME=true
When you run the tests (see below), a Chrome session will be launched in either headless or heady mode.
Please note, you must have either Firefox or Chrome installed on your system to run these tests. Consult the Firefox WebDriver or ChromeDriver documentation to ensure your Selenium, driver, browser, and OS versions all match and support each other. As of November 2018 only post-Quantum versions of Firefox (v. 57+) are supported via the built-in geckodriver.
Run the bootstrap build task to configure JRuby and all required dependencies:
$ cd .. $ build/run bootstrap
Note: all example code assumes you are running from your ArchivesSpace project directory.
Running the tests:
Run the full suite:
$ build/run public:test
Run all tests in a specific spec file:
$ build/run public:test -Dspec='path/to/spec/from/spec/directory'
so, for example,
$ build/run public:test -Dspec='features/accessibility_spec.rb'
Run a specific test:
$ build/run public:test -Dexample='[description from it block]'
so, for example,
$ build/run public:test -Dexample='does not return deaccessions when AppConfig[:pui_display_deaccessions] is false'
Note, however, that some public tests are dependent on a sequence of ordered steps and may not always run cleanly in isolation. In this case, more than the example provided may be run, and/or unexpected fails may result.