events.js 660 B

1234567891011121314151617181920212223242526
  1. casper.test.begin('Events', 5, function (test) {
  2. // testing event delegation
  3. // mostly inline events
  4. // and e.stopPropagation(), e.preventDefault()
  5. casper
  6. .start('./fixtures/events.html')
  7. .thenClick('.normal', function () {
  8. test.assertNotVisible('.outer')
  9. })
  10. .thenClick('.exp', function () {
  11. test.assertNotVisible('.outer')
  12. test.assertSelectorHasText('.msg', 'hello')
  13. test.assertEval(function () {
  14. return !window.location.hash
  15. })
  16. })
  17. .thenClick('div', function () {
  18. test.assertVisible('.outer')
  19. })
  20. .run(function () {
  21. test.done()
  22. })
  23. })