README 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. -------------------------------------------------------------------------------
  2. dojox.robot.recorder
  3. -------------------------------------------------------------------------------
  4. Version 0.1
  5. Release date: 2008-07-30
  6. -------------------------------------------------------------------------------
  7. Project state: experimental
  8. -------------------------------------------------------------------------------
  9. Project authors
  10. Mark Hays
  11. -------------------------------------------------------------------------------
  12. Project description
  13. Writing automated test cases takes time, and DOH is no exception. You have to
  14. look up element ids, invent dojo.queries for elements with no id,
  15. figure out exactly how many pixels to move the mouse . . . the list goes on.
  16. This recorder module enables DOH test case writers to create complete DOH test
  17. scripts directly from their actions and input on a Web page. Simply drop the
  18. generated code into your test page, set a pass condition, and the test will
  19. repeat your actions.
  20. -------------------------------------------------------------------------------
  21. Dependencies:
  22. dojo
  23. -------------------------------------------------------------------------------
  24. Documentation
  25. See installation instructions below to prepare a test page for recording.
  26. To record a test, click in an area of the document with no dojo.stopEvents
  27. and press CTRL-ALT-ENTER in the main window. You will get a verification alert
  28. when you successfully start the recorder. Then you can interact with the Web
  29. page and the recorder will monitor your actions. It's usually good to record one
  30. test per widget instance per type of interaction (keyboard vs mouse for instance)
  31. you are testing.
  32. After you finish interacting with the Web page, click out of any dojo.stopEvents
  33. and press CTRL-ALT-ENTER again. You will see a box containing the generated source
  34. code for your recording. Copy this into a dojo.addOnLoad on the same page to register
  35. the test with DOH. Replace the /*Your condition here*/ text with a JS condition that
  36. indicates that the test passed. Again, having multiple small tests will help you
  37. keep the condition small. Add a doh.run() call after you register all of your tests
  38. to make them execute when you load the page.
  39. -------------------------------------------------------------------------------
  40. Installation instructions
  41. To ready the recorder for a particular page, add this line to your dojo.requires:
  42. dojo.require("dojox.robot.recorder");
  43. You can safely remove this line after you are finished recording your tests.
  44. -------------------------------------------------------------------------------
  45. Additional Notes
  46. Known limitations:
  47. - Content in an iframe might not report events to the recorder.
  48. - keyDown/keyUp events are supported by DOH, but not by the recorder.
  49. If you hold a key down, it will generate lots of keyPress events instead.
  50. Simply change these to one keyDown call yourself.