Setting Up System Specs
We have made it as simple as possible to have your system specs. Before running your specs ensure you have installed the chromedriver
and that selenium-server standalone
is in your system path.
Mac OS
You can install the chromedriver and selenium standalone server with brew
brew install selenium-server-standalonebrew install chromedriver
This will install the chrome driver on the system path /usr/local/bin/chromedriver
If you're running in a different OS such as Linux you can specify the chromedriver path as such
module GarnetSpecDRIVER = :chromePATH = "/usr/local/bin/chromedriver"end
System tests allows test user interactions with your application, running tests in either a real chrome browser. System tests use the Selenium Standalone Server.
For creating Amber system tests, you use the spec/system directory in your application. Here's how a system test looks like:
class SomeFeature < GarnetSpec::System::Testscenario "user visits amber framework and sees getting started button" dovisit "http://www.amberframework.org"timeout 1000click_on(:css, "header a.btn.btn-primary")wait 2000element(:tag_name, "body").text.should contain "Introduction"end​scenario "user visits amberframwork homepage and sees logo" dovisit "http://www.amberframework.org"wait 2000element(:class_name, "img-amber-logo").attribute("src").should match(%r(https://www.amberframework.org/assets/img/amber-logo-t-bg.png))endend
Run your specs with crystal spec
System Test currently only work with the Chrome Browser