---
Zeno remarked that interaction don't work anymore after my changes for printing a prescription.
Watir tests produce 5 errors like
1) ch.oddb.org should not loose existing comment after adding a new prescription Failure/Error: @browser.link(:href, /rezept/).click Net::ReadTimeout: Net::ReadTimeout # ./spec/rezept_and_instantsearch_spec.rb:104:in `block (2 levels) in <top (required)>'
Bisecting the changes.
Add interactions to print. Preserve comments when adding/deleting drugs.
Now many tests fail in spec/interactions_spec.rb. I see eg. #<Watir::Exception::UnknownObjectException: unable to locate element, using {:id=>"interaction_chooser_searchbar", :tag_name=>"input or textarea", :type=>"(any text type)"}>
. But still some interactions are show. But after printing a prescriptions interactions don't work any more. Conclusion the commit f42f2db917672ef1ba5155b04a861323b3dd38f7 is the culprit!
After adding some debug printfs I finally found the problem. Trying to apply the fix with the latest checkout. Must look why I still get the failure ch.oddb.org should show the correct url after deleting a medicament
. Problem seen in the JavaScript console. element is null when executing var text = element.innerText || element.textContent;
Fixed the errors, correct watir tests with sinovial and added test for printing descriptions and checking family name, etc when adding/deleting a drug. See commits
Now working on why I cannot preserver the comments when printing. Adding an onclick javascript to change the path to something like http://oddb-ci2.dyndns.org/de/gcc/print/rezept/ean/7680495260405. Still having problems with quoting the javascript.
After changing src/view/printtemplate.rb to use View::PublicTemplate instead of HtmlGrid::DivTemplate as base class I get the first time a java script error when loading the print namely PrescriptionPrint.init: catched error: TypeError: Cannot set property 'checked' of null
. Made some progress and see that I can set the names/birthday correctly. Still problems with comments, probably because I tried to suppress comments if the default was entered.
Also I have problems, that going back does not work when entering the print. This seems to work. Added a watir test for it.
Adding a new watir test as Zeno remarked that printing a fachinfo does not work when
Now it prints the rezept instead of the fachinfo.
Added a watir test for it too. As I have now an URL with /print/rezept I should probably use this to decide whether I am printing a prescription than a global variable. Will refactor this tomorrow.