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

27 lines
668 B

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