These examples are for building GUI acceptance tests using Selenium WebDriver (Selenium) in Ruby using an open source BDD framework called RSpec. (Sometimes these GUI tests are called integration tests or end to end tests.)
Many of these test ideas come from the Elemental Selenium tips site and elsewhere on the web as separate bits of example code. Then they get refactored into a single test suite with separate page objects as it presents a cleaner and more realistic view of how you might structure a similar test suite.
The challenge (and fun) with any automation is always about how to reveal new and interesting information through tests in a computer aided fashion.
- Build it
docker build -t selenium_rspec
- Run it
docker run -ti selenium_rspec /bin/bash
Can't do much from here at this point. TBD
- Download or clone the repo
- Run
bundle install
to install all of the required gems
Run tests individually:
- Switch to the /spec/ folder
- Run the tests at command line
rspec <specname>.rb
Run tests in parallel:
- Run tests at the command line
rake local:chrome
orrake local:firefox
(Must have a SauceLabs account:)
- Update config_cloud.rb file for
- SAUCE_USERNAME
- SAUCE_ACCESS_KEY
- Run the tests at command line
rspec -r ./config_cloud.rb
or - Run the tests in parallel at the command line
rake cloud:<browser[options]>
References to other code I've created:
- Running Headless Chrome. Code: https://gist.github.com/ckenst/c1e7f32f290312adfeec46a93d283ac0
- Running Chrome in a Docker container. Code: https://gist.github.com/ckenst/38e1651793cf8955d605ac72697682da
- Removed
gem 'sauce_whisk', '~> 0.0.21'