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.
19 lines
508 B
19 lines
508 B
9 years ago
|
exports.assertion = function (selector, count) {
|
||
|
this.message = 'Testing if element <' + selector + '> has count: ' + count
|
||
|
this.expected = count
|
||
|
this.pass = function (val) {
|
||
|
return val === this.expected
|
||
|
}
|
||
|
this.value = function (res) {
|
||
|
return res.value
|
||
|
}
|
||
|
this.command = function (cb) {
|
||
|
var self = this
|
||
|
return this.api.execute(function (selector) {
|
||
|
return document.querySelectorAll(selector).length
|
||
|
}, [selector], function (res) {
|
||
|
cb.call(self, res)
|
||
|
})
|
||
|
}
|
||
|
}
|