parent
bff67fd7a4
commit
68e94cf087
@ -0,0 +1,15 @@ |
||||
const EventEmitter = require('events') |
||||
|
||||
class ElementIsPresent extends EventEmitter { |
||||
command (cssSelector) { |
||||
this.api.execute((cssSelector) => { |
||||
return !!document.querySelector(cssSelector) |
||||
}, [cssSelector], (result) => { |
||||
this.api.assert.equal(false, result.value, `${cssSelector} should not be present`) |
||||
this.emit('complete') |
||||
}) |
||||
return this |
||||
} |
||||
} |
||||
|
||||
module.exports = ElementIsPresent |
@ -0,0 +1,15 @@ |
||||
const EventEmitter = require('events') |
||||
|
||||
class ElementIsPresent extends EventEmitter { |
||||
command (cssSelector) { |
||||
this.api.execute((cssSelector) => { |
||||
return !!document.querySelector(cssSelector) |
||||
}, [cssSelector], (result) => { |
||||
this.api.assert.equal(true, result.value, `${cssSelector} should be present`) |
||||
this.emit('complete') |
||||
}) |
||||
return this |
||||
} |
||||
} |
||||
|
||||
module.exports = ElementIsPresent |
Loading…
Reference in new issue