view · edit · sidebar · attach · print · history

Index>

20140721-fix-interactions

Summary

  • interactions must work after printing a description

Commits

Index

Keep in Mind
  • Fix dojo error http://www.sitepen.com/blog/2012/10/31/debugging-dojo-common-error-messages/#forgot-dom-ready
  • I removed on May-27 tests for ix_registrationss, fix_sequences, fix_compositions, fix_packages from test/test_plugin/swissmedic.rb,as he could not find any references for them in the src code. Did I erroneously remove stuff when cleaning up the swissmedic import earlier?
  • The whole test for older/newer Packages must be adapted to xlsx. One must compare the rows (e.g. by creating csv files) and do the same stuff in xlsx!
  • One unit-test for searchbar fails and might be a clue why searching does not work correctly.
  • Added two skip in test/test_plugin/rss.rb. Why does the mocking not work there anymore?
  • Make ext/swissindex/test/test_swissindex.rb and skipping tests in migel-gem pass.

---

Interactions must work after printing a description

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.

  • Trying 7b8319aa09396bd225240c2cbb6a8786990da01b (Mon Jul 14 18:38:57). Okay. Interaction work
  • Trying eb9b14aa2316b00b2695520ad5d8099017941a38 (Tue Jul 15 09:56:18). Okay. Interaction work.
  • Trying f42f2db917672ef1ba5155b04a861323b3dd38f7 (Tue Jul 15 11:11:45). 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

  • create a prescription with a drug
  • click on the fachinfo with
  • print the fachinfo

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.

view · edit · sidebar · attach · print · history
Page last modified on July 22, 2014, at 08:28 AM