You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
514 B
18 lines
514 B
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)
|
|
})
|
|
}
|
|
}
|
|
|