parent
6366dde073
commit
f59ff83354
@ -0,0 +1,27 @@ |
||||
const EventEmitter = require('events') |
||||
|
||||
class GetInstalledPlugins extends EventEmitter { |
||||
command (cb) { |
||||
const browser = this.api |
||||
|
||||
browser.waitForElementPresent('[plugin]:not([plugin=""]') |
||||
.perform((done) => { |
||||
browser.execute(() => { |
||||
const pluginNames = [] |
||||
const plugins = document.querySelectorAll('[plugin]:not([plugin=""]') |
||||
|
||||
plugins.forEach(plugin => { |
||||
pluginNames.push(plugin.getAttribute('plugin')) |
||||
}) |
||||
return pluginNames |
||||
}, [], (result) => { |
||||
done() |
||||
cb(result.value) |
||||
this.emit('complete') |
||||
}) |
||||
}) |
||||
return this |
||||
} |
||||
} |
||||
|
||||
module.exports = GetInstalledPlugins |
Loading…
Reference in new issue