It can be used for:
- testing GUI of web-application within a web-browser
- API testing and mathching responses/requests against JSON-schema provided.
- Rvm (optional)
- Docker (optional)
- Firefox (using Google Chrome/Chromium requires additional configuring)
- Ruby 2.5.1
Within a terminal in a project folder:
- Run
bundle
to install gems set in Gemfile - Then run tests with
rspec
Within a terminal in a project folder:
- To use Chromium set
Capybara.javascript_driver = :selenium_chrome_headless
in spec/spec_helper.rb and change browser in a Docker file (follow comments) - Make sure your Gemfile.lock exists
bundle i
- Build a docker image named dockerrspec with
docker build --rm -t dockerrspec .
- Run tests with
docker run -it --rm --name remotetesting dockerrspec
WARNING always make sure that Firefox or Chromium runs in a headless mode in case of Docker.
Browser and it's mode settings are in spec/spec_helper.rb file.
By default headless Firefox is set Capybara.javascript_driver = :firefox_headless
.
- :selenium_firefox
- :selenium_firefox_headless
- :selenium_chrome
- :selenium_chrome_headless
getaddrinfo: nodename nor servname provided, or not known
: OS X must have127.0.0.1 localhost
in/etc/hosts