mirror of https://github.com/vuejs/vue.git
24 lines
636 B
JavaScript
24 lines
636 B
JavaScript
casper.test.begin('Validation', 4, function (test) {
|
|
|
|
casper
|
|
.start('./fixtures/validation.html', function () {
|
|
test.assertElementCount('.valid', 0)
|
|
this.sendKeys('input', '@hello.com')
|
|
})
|
|
.then(function () {
|
|
test.assertElementCount('.valid', 1)
|
|
|
|
this.evaluate(function () {
|
|
document.querySelector('input').setSelectionRange(4,4)
|
|
})
|
|
this.sendKeys('input', 'hoho')
|
|
})
|
|
.then(function () {
|
|
test.assertElementCount('.valid', 1)
|
|
test.assertField('email', 'hihihoho@hello.com')
|
|
})
|
|
.run(function () {
|
|
test.done()
|
|
})
|
|
|
|
}) |