Evan You
9 years ago
3 changed files with 36 additions and 19 deletions
@ -0,0 +1,18 @@ |
|||
exports.assertion = function (selector, expected) { |
|||
this.message = 'Testing if element <' + selector + '> is checked.' |
|||
this.expected = expected !== false |
|||
this.value = function (res) { |
|||
return res.value |
|||
} |
|||
this.pass = function (val) { |
|||
return val === this.expected |
|||
} |
|||
this.command = function (cb) { |
|||
var self = this |
|||
return this.api.execute(function (selector) { |
|||
return document.querySelector(selector).checked |
|||
}, [selector], function (res) { |
|||
cb.call(self, res) |
|||
}) |
|||
} |
|||
} |
@ -0,0 +1,18 @@ |
|||
module.exports = { |
|||
'commits': function (browser) { |
|||
browser |
|||
.url('http://localhost:8080/examples/commits/') |
|||
.waitForElementVisible('li', 1000) |
|||
.assert.elementCount('input', 2) |
|||
.assert.elementCount('label', 2) |
|||
.assert.containsText('label[for="master"]', 'master') |
|||
.assert.containsText('label[for="dev"]', 'dev') |
|||
.assert.checked('#master') |
|||
.assert.checked('#dev', false) |
|||
.assert.containsText('p', 'vuejs/vue@master') |
|||
.assert.elementCount('li', 3) |
|||
.assert.elementCount('li .commit', 3) |
|||
.assert.elementCount('li .message', 3) |
|||
.end() |
|||
} |
|||
} |
Loading…
Reference in new issue