Skip to content

Latest commit

 

History

History
41 lines (30 loc) · 1.74 KB

tests_watir.textile

File metadata and controls

41 lines (30 loc) · 1.74 KB

Watir/Selenium GUI tests for Oddb.org

These GUI-tests allow you to check whether a complete oddb.org installation with the database, yus-daemon, etc
is working correctly.
It also uses some common names to test whether the different searches work, e.g. we assume that we can find
a medicament named Aspirin.

To use it, check the following requirements

  • you have the necessary gems installed, eg. by calling bundle install --gemfile Gemfile.watir
    • watir-webdriver
    • watir
    • rspec
  • You have changed HomeURL in spec/spec_helper.rb to point to the site you want to test

Then you can run a single test by calling bundle exec rspec spec/smoke_test.rb

Creating new tests interactively

Here is a irb sample, which demonstrates the main points.

require Dir.pwd + ‘/spec/spec_helper.rb’
@browser = Watir::Browser.new # should open firefox, the default watir browser
@browser.goto OddbUrl # Now it should show the home page of the your test site
page = OddMain.new(OddbUrl, true)
puts @browser.selects0.text # should ouput Preisvergleich <..>
@browser.buttons1.click # goes to the paypal site
@browser.back # to back
@browser.select(:name => /search_type/).select(‘Interaktion’)

Recording

Firefox has a TestWise-Recorder which allows you to record a session and create watir scripts.

Further reading

Watir.com provides a lot of good documentation, eg.