computed-repeat.js 743 B

1234567891011121314151617181920212223242526272829
  1. casper.test.begin('Computed property depending on repeated items', 4, function (test) {
  2. casper
  3. .start('./fixtures/computed-repeat.html')
  4. .then(function () {
  5. test.assertSelectorHasText('#texts', 'a,b')
  6. })
  7. .thenClick('#add', function () {
  8. test.assertSelectorHasText('#texts', 'a,b,c')
  9. })
  10. .then(function () {
  11. this.fill('#form', {
  12. "text0": 'd',
  13. "text1": 'e',
  14. "text2": 'f',
  15. })
  16. })
  17. .then(function () {
  18. this.sendKeys('input[name="text2"]', 'fff')
  19. })
  20. .then(function () {
  21. test.assertField('text0', 'd')
  22. test.assertSelectorHasText('#texts', 'd,e,ffff')
  23. })
  24. .run(function () {
  25. test.done()
  26. })
  27. })