mirror of
https://github.com/vuejs/vue-cli.git
synced 2026-01-25 08:38:57 -06:00
@@ -7,12 +7,13 @@
|
||||
// For more information on custom assertions see:
|
||||
// http://nightwatchjs.org/guide#writing-custom-assertions
|
||||
|
||||
exports.assertion = function (selector, count) {
|
||||
exports.assertion = function elementCount (selector, count) {
|
||||
this.message = `Testing if element <${selector}> has count: ${count}`
|
||||
this.expected = count
|
||||
this.pass = val => val === count
|
||||
this.value = res => res.value
|
||||
this.command = cb => this.api.execute(function (selector) {
|
||||
return document.querySelectorAll(selector).length
|
||||
}, [selector], cb)
|
||||
function evaluator (_selector) {
|
||||
return document.querySelectorAll(_selector).length
|
||||
}
|
||||
this.command = cb => this.api.execute(evaluator, [selector], cb)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user