Commit b5509376 authored by ioedeveloper's avatar ioedeveloper

Update getInstalledPlugins command

parent e42fa3bb
...@@ -3,23 +3,26 @@ const EventEmitter = require('events') ...@@ -3,23 +3,26 @@ const EventEmitter = require('events')
class GetInstalledPlugins extends EventEmitter { class GetInstalledPlugins extends EventEmitter {
command (cb) { command (cb) {
const browser = this.api const browser = this.api
const plugins = []
browser.waitForElementPresent('[plugin]:not([plugin=""]') browser.click('*[data-id="remixIdeIconPanel"]')
.perform((done) => { .waitForElementPresent('[plugin]:not([plugin=""])')
browser.execute(() => { .elements('css selector', '[plugin]:not([plugin=""])', (res) => {
const pluginNames = [] res.value.forEach(function (jsonWebElement) {
const plugins = document.querySelectorAll('[plugin]:not([plugin=""]') const jsonWebElementId = jsonWebElement.ELEMENT || jsonWebElement[Object.keys(jsonWebElement)[0]]
browser.elementIdAttribute(jsonWebElementId, 'plugin', (jsonElement) => {
const attribute = jsonElement.value
plugins.forEach(plugin => { plugins.push(attribute)
pluginNames.push(plugin.getAttribute('plugin')) })
}) })
return pluginNames })
}, [], (result) => { .perform((done) => {
done() done()
cb(result.value) cb(plugins)
this.emit('complete') this.emit('complete')
}) })
})
return this return this
} }
} }
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment