Test web applications or rest services
The spec folder has examples of:
- testing a rest service
- testing a webpage with selenium
- testing a webpage using selenium and the page object pattern
Run all tests
bundle execute rake examples
Run specific tests
# rest client
bundle execute rake rspec_rest_client
# web page
bundle execute rake rspec_selenium
# web page w/ page object pattern
bundle execute rake rspec_selenium_page_obj
The default rake task will:
- load up irb
- include selnium
- include any page objects you've created
Get started by running
bundle exec rake
Once in the irb, use selenium
driver = Selenium::WebDriver.for :firefox
driver.navigate.to "http://google.com"
And page objects
# create page object
page_obj = GoogleHomePage.new(driver)
# use page object
page_obj.search("Santa Rosa")
ci_report can be generated for build automation; refer to the Rakefile to see an example
r4log can be used to send output to
- the console
- a log file
- splunk storm
To test with chrome you need:
- Download correct chrome driver
- Add it to your system path