Skip to content
This repository has been archived by the owner on Dec 25, 2017. It is now read-only.

Commit

Permalink
💚 test(started): add getting started example tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kazupon committed Oct 27, 2016
1 parent 94060aa commit 9fd4af4
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 7 deletions.
4 changes: 2 additions & 2 deletions examples/started/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
<input type="text" @input="handleValidate" @focusout="handleValidate">
</validity>
<div class="errors">
<p v-if="result.required">required username!!</p>
<p v-if="result.minlength">too short username!!</p>
<p class="required" v-if="result.required">required username!!</p>
<p class="minlength" v-if="result.minlength">too short username!!</p>
</div>
</div>
<script>
Expand Down
25 changes: 20 additions & 5 deletions test/e2e/test/started.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,26 @@
module.exports = {
add: function (browser) {
started: function (browser) {
browser
.url('http://localhost:8080/examples/started/')
/*
.waitForElementVisible('p', 1000)
.assert.containsText('p', '3', 'You should be implemented !!')
*/
// initial loaded
.waitForElementVisible('#app', 1000)
.waitForElementNotPresent('.errors .required', 1000)
.waitForElementNotPresent('.errors .minlength', 1000)
// minlength invalid
.setValue('input', 'foo')
.trigger('input', 'input')
.waitForElementNotPresent('.errors .required', 1000)
.waitForElementPresent('.errors .minlength', 1000)
// and required invalid
.clearValue('input')
.trigger('input', 'input')
.waitForElementPresent('.errors .required', 1000)
.waitForElementPresent('.errors .minlength', 1000)
// valid !!
.setValue('input', 'kazupon')
.trigger('input', 'input')
.waitForElementNotPresent('.errors .required', 1000)
.waitForElementNotPresent('.errors .minlength', 1000)
.end()
}
}

0 comments on commit 9fd4af4

Please sign in to comment.