This project is designed to provide a base framework for writing automated tests in Cucumber in Ruby. This implementation uses the capybara gem which makes writing tests even easier. The locator strategies are built around the Liferay UI TagLib so I encourage the use of the Liferay UI TagLib to make testing, or at least designing generalized xpaths, a lot easiser. The API Documentation can be found here.
The framework is divided into multiple layers that raises in technical level as you go lower. In the top level, testers will write in Cucumber in plain english as if they were writing a manual test.
The level below has step definitions written in ruby with a collection of convenience methods. XPaths here are designed to be generalized so that step definitions work per element. The top level stays easy so as long as you have a lean amount of clear step definitions.
In the lowest level, the capybara DSL is used to design the action methods. This is done so that testers have just the right amount of flexibility in the middle layer. When it comes to maintenance, most of the work will be done on the top and middle layers if done correctly.
Google Chrome is installed
Ubuntu 14 and above require additional dependencies.
What this installs is Ruby 2.3, capybara and its dependencies, capybara-screenshot which is configured to take screenshots on failure, and chromedriver-helper which is one of the simplest ways to get automating on chrome.
Install Ruby 2.3
sudo apt-add-repository ppa:brightbox/ruby-ng
sudo apt-get update
sudo apt-get install ruby2.3 ruby2.3-dev
Install Capybara
sudo apt-get install libqt4-dev libqtwebkit-dev
sudo apt-get install build-essential patch
sudo apt-get install ruby-dev zlib1g-dev liblzma-dev
sudo gem install nokogiri
sudo gem install capybara -v 2.7.1
Install the rest of the stuff
sudo gem install cucumber chunky_png rspec appium_lib headless chromedriver-helper capybara-screenshot
sudo gem install selenium-webdriver -v 2.53.4
Install Ruby 2.3
- Download and Ruby 2.3 https://dl.bintray.com/oneclick/rubyinstaller/rubyinstaller-2.3.3-x64.exe
- Install and make sure you check the option to "Add Ruby executables to your PATH"
- Download and install the Ruby Development Kit using this guide https://github.com/oneclick/rubyinstaller/wiki/Development-Kit
- Confirm that you're running ruby 2.3.3 by running
ruby -v
in a command window - Make sure you have gems installed by running
gem -v
on a command line
Install everything else
gem install nokogiri
gem install capybara -v 2.7.1
gem install cucumber chunky_png rspec appium_lib headless chromedriver-helper capybara-screenshot
gem install selenium-webdriver -v 2.53.4
Sublime Gherkin Auto Complete Plus https://github.com/austincrft/sublime-gherkin-auto-complete-plus
This plugin only works with Sublime Text 3 and enables Sublime to auto complete step definitions when writing a test.
YARDOC http://yardoc.org/
This Ruby gem is used to generate the api docs for this repo. If you make change, just execute generate-docs.sh and open doc/_index.html . Navigating to doc/requirements/step_transformers.html#step_definitions will show you an index of all the step definitions.