Skip to content

Commit

Permalink
Added sevikar,lamivudin and iscador to watir tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ngiger committed Sep 16, 2015
1 parent 13b5ed2 commit 34550f0
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 1 deletion.
55 changes: 55 additions & 0 deletions spec/smoketest_spec.rb
Expand Up @@ -71,6 +71,61 @@ def check_nutriflex_56091(text)
@browser.url.should match OddbUrl
end

it "should display the correct color iscador U" do
login
@browser.goto OddbUrl
@browser.select_list(:name, "search_type").select("Markenname")
@browser.text_field(:name, "search_query").set('iscador U')
sleep(0.1)
@browser.button(:name, "search").click
@browser.element(:id => 'ikscat_1').wait_until_present
@browser.element(:id => 'ikscat_1').text.should eq 'A / SL'
@browser.link(:text => 'FI').exists?.should eq true
@browser.link(:text => 'PI').exists?.should eq true
@browser.td(:text => 'A').exists?.should eq true
@browser.td(:text => 'C').exists?.should eq false
@browser.link(:text => 'FB').exists?.should eq true
(@browser.link(:text => /Iscador/i).style 'background-color').should match /0, 0, 0, 0/
@browser.element(:id => 'ikscat_1').hover
res = @browser.element(:text => /Spezialitätenliste/).wait_until_present
res.should eq true
@browser.text_field(:text => /Medikamentennamen/).exists?
res = @browser.element(:text => /Spezialitätenliste/).wait_until_present
@browser.buttons.first.click # Don't know how to close it else
@browser.back
end

it "should display a limitation link for Sevikar" do
login
@browser.goto OddbUrl
@browser.select_list(:name, "search_type").select("Markenname")
@browser.text_field(:name, "search_query").set('Sevikar')
sleep(0.1)
@browser.button(:name, "search").click
@browser.element(:id => 'ikscat_1').wait_until_present
@browser.element(:id => 'ikscat_1').text.should eq 'B / SL'
@browser.link(:text => 'L').exists?.should eq true
@browser.link(:text => 'L').href.should match /limitation_text\/reg/
@browser.link(:text => 'FI').exists?.should eq true
@browser.link(:text => 'PI').exists?.should eq true
@browser.td(:text => 'A').exists?.should eq false
@browser.td(:text => 'C').exists?.should eq false
# @browser.link(:text => '10%').exists?.should eq true
@browser.link(:text => 'FB').exists?.should eq true
end

it "should display lamivudin with SO and SG in category (price comparision)" do
login
@browser.goto OddbUrl
@browser.select_list(:name, "search_type").select("Preisvergleich")
@browser.text_field(:name, "search_query").set('lamivudin')
sleep(0.1)
@browser.button(:name, "search").click
@browser.element(:id => 'ikscat_1').wait_until_present
@browser.tds.find{ |x| x.text.eql?('A / SL / SO')}.exists?.should eq true
@browser.tds.find{ |x| x.text.eql?('A / SL / SG')}.exists?.should eq true
end

it "should show a registration info" do
login
@browser.goto "#{OddbUrl}/de/#{Flavor}/show/reg/56091"
Expand Down
6 changes: 5 additions & 1 deletion spec/spec_helper.rb
Expand Up @@ -10,7 +10,11 @@
end

BreakIntoPry = false
require 'pry' if BreakIntoPry
begin
require 'pry'
rescue LoadError
# ignore error for Travis-CI
end
for_running_in_irb = %(
require 'watir'; require 'pp'
homeUrl ||= "oddb-ci2.dyndns.org"
Expand Down

0 comments on commit 34550f0

Please sign in to comment.