remix-project mirror
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
remix-project/apps/remix-ide/test-browser/commands/getInstalledPlugins.js

30 lines
837 B

const EventEmitter = require('events')
class GetInstalledPlugins extends EventEmitter {
command (cb) {
const browser = this.api
const plugins = []
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.push(attribute)
})
})
})
.perform((done) => {
done()
cb(plugins)
this.emit('complete')
})
return this
}
}
module.exports = GetInstalledPlugins