A very very basic example framework in Ruby, using Cucumber, Capybara and Site Prism (for Page Objects), along with RSpec expectations, cucumber profiles and reporting.
- You are not 100% new to Ruby or Cucumber or Web Automation Testing.
- You have some general idea as to what a web page/website is.
- A basic framework for testing websites, using Ruby.
- A good example to see RSpec expectations in action.
- A trivial example of how you can encapsulate your functionality using page objects and code DRYness.
- Some basic control regarding choosing a browser at runtime
- Simple intro into Rake.
- An all-in-one super duper framework.
- Something that you can 100% copy over for any app (though I suspect you'd be able to use most, as is).
- No multi language
Drop me an email, [email protected] for any comments, suggestions, etc.
- Unfortunately, no updates, its basic.
Please ensure that you have the latest Chromedriver installed and setup...
https://sites.google.com/a/chromium.org/chromedriver/downloads
I like to use RVM to get my house in order...
- cd into capybara-siteprism-example-framework/
- rvm use ruby-2.3.0
- rvm gemset create capybara-siteprism-example-framework
- rvm gemset use capybara-siteprism-example-framework
- gem install nokogiri -v '1.8.2'
- bundle install
After cd'ing into the 'capybara-siteprism-example-framework' directory...
cucumber features/google_search.feature
Note that the default profile will choose Chrome as the default browser.
Then to run the tests using the default profile...
cucumber features/google_search.feature
You can also choose to use Rake (rake is a task runner, check out https://github.com/ruby/rake for useful info)
To list the available tasks...
# rake -T
# rake google_search_chrome # Run Google Search feature with default profile
Then, to run the task...
rake google_search_chrome