Skip to content

Commit

Permalink
Corrected watir tests. Added one
Browse files Browse the repository at this point in the history
  • Loading branch information
ngiger committed Aug 18, 2014
1 parent c4934b8 commit adb2b27
Showing 1 changed file with 24 additions and 7 deletions.
31 changes: 24 additions & 7 deletions spec/rezept_and_instantsearch_spec.rb
Expand Up @@ -153,6 +153,29 @@ def waitForPrintInfo(maxSeconds = 120)
sleep(1)
end

it "should possible to add first medicament by trademark search, then using instant" do
nrMedisToCheck = 1
@browser.goto OddbUrl
@browser.select_list(:name, "search_type").select("Markenname")
@browser.text_field(:name, "search_query").set(Four_Medis[0])
@browser.button(:name, "search").click
@browser.link(:href, /rezept/).click
set_zsr_of_doctor('P006309')
setGeneralInfo(nrMedisToCheck)
add_one_drug_to_rezept(Four_Medis[1])
checkGeneralInfo(nrMedisToCheck+1)
@browser.text.should match /Dr. med. Werner Meier/
oldWindowsSize = @browser.windows.size
@browser.button(:name, "print").click
@browser.windows.size.should == oldWindowsSize + 1 # must open a new window
@browser.windows.last.use
waitForPrintInfo
@browser.text.should match /Dr. med. Werner Meier/
@browser.text.should match /ZSR P006309/i
@browser.text.should match /EAN 7601000223449/i
checkGeneralInfo(nrMedisToCheck)
end

it "should print a correct prescription with comments, personal information, doctor info and a drug" do
@browser.goto OddbUrl
@browser.select_list(:name, "search_type").select("Markenname")
Expand All @@ -174,14 +197,8 @@ def waitForPrintInfo(maxSeconds = 120)
@browser.text.should match /Dr. med. Werner Meier/
@browser.text.should match /ZSR P006309/i
@browser.text.should match /EAN 7601000223449/i
@browser.text.index('http://2dmedication.org/').should > 0
@browser.text.index(';7680583920112|').should > 0 # EAN_ID of drug
@browser.text.index('|7601000223449|').should > 0 # GLN_ID of Dr. Meier
@browser.text.index('|P006309|').should > 0 # ZSR aka Konkordatsnummter des Arztes
@browser.text.index("|#{FirstName}|").should > 0
@browser.text.index("|#{FamilyName}|").should > 0
@browser.text.index("|19901231|").should > 0 # Must of format YYYYMMDD
end

it "should print the fachinfo when opening the fachinfo from a prescription" do
@browser.select_list(:name, "search_type").select("Markenname")
@browser.text_field(:name, "search_query").set(Four_Medis.first)
Expand Down

0 comments on commit adb2b27

Please sign in to comment.