|
|
|
@ -3,23 +3,26 @@ const EventEmitter = require('events') |
|
|
|
|
class GetInstalledPlugins extends EventEmitter { |
|
|
|
|
command (cb) { |
|
|
|
|
const browser = this.api |
|
|
|
|
const plugins = [] |
|
|
|
|
|
|
|
|
|
browser.waitForElementPresent('[plugin]:not([plugin=""]') |
|
|
|
|
.perform((done) => { |
|
|
|
|
browser.execute(() => { |
|
|
|
|
const pluginNames = [] |
|
|
|
|
const plugins = document.querySelectorAll('[plugin]:not([plugin=""]') |
|
|
|
|
browser.click('*[data-id="remixIdeIconPanel"]') |
|
|
|
|
.waitForElementPresent('[plugin]:not([plugin=""])') |
|
|
|
|
.elements('css selector', '[plugin]:not([plugin=""])', (res) => { |
|
|
|
|
res.value.forEach(function (jsonWebElement) { |
|
|
|
|
const jsonWebElementId = jsonWebElement.ELEMENT || jsonWebElement[Object.keys(jsonWebElement)[0]] |
|
|
|
|
|
|
|
|
|
browser.elementIdAttribute(jsonWebElementId, 'plugin', (jsonElement) => { |
|
|
|
|
const attribute = jsonElement.value |
|
|
|
|
|
|
|
|
|
plugins.forEach(plugin => { |
|
|
|
|
pluginNames.push(plugin.getAttribute('plugin')) |
|
|
|
|
plugins.push(attribute) |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
return pluginNames |
|
|
|
|
}, [], (result) => { |
|
|
|
|
}) |
|
|
|
|
.perform((done) => { |
|
|
|
|
done() |
|
|
|
|
cb(result.value) |
|
|
|
|
cb(plugins) |
|
|
|
|
this.emit('complete') |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
return this |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|