commits.js 1.4 KB

123456789101112131415161718192021222324252627282930313233343536
  1. casper.on('remote.message', function (e) {
  2. console.log(e)
  3. })
  4. casper.test.begin('commits', 18, function (test) {
  5. casper
  6. .start('examples/commits/index.html')
  7. .then(function () {
  8. // radio inputs & labels
  9. test.assertElementCount('input', 2)
  10. test.assertElementCount('label', 2)
  11. test.assertSelectorHasText('label[for="master"]', 'master')
  12. test.assertSelectorHasText('label[for="dev"]', 'dev')
  13. // initial fetched commits
  14. test.assertField('branch', 'master')
  15. test.assertSelectorHasText('p', 'vuejs/vue@master')
  16. test.assertElementCount('li', 3)
  17. test.assertSelectorHasText('li:first-child a.commit', '1111111')
  18. test.assertSelectorHasText('li:first-child span.message', 'one')
  19. test.assertSelectorHasText('li:first-child span.author', 'Evan')
  20. test.assertSelectorHasText('li:first-child span.date', '2014-10-15 13:52:58')
  21. })
  22. .thenClick('input[value="dev"]', function () {
  23. test.assertField('branch', 'dev')
  24. test.assertSelectorHasText('p', 'vuejs/vue@dev')
  25. test.assertElementCount('li', 3)
  26. test.assertSelectorHasText('li:first-child a.commit', '2222222')
  27. test.assertSelectorHasText('li:first-child span.message', 'two')
  28. test.assertSelectorHasText('li:first-child span.author', 'Evan')
  29. test.assertSelectorHasText('li:first-child span.date', '2014-10-15 13:52:58')
  30. })
  31. // run
  32. .run(function () {
  33. test.done()
  34. })
  35. })