Test for plugin reload after webpage refresh

pull/1/head
ioedeveloper 5 years ago
parent 6366dde073
commit f59ff83354
  1. 27
      test-browser/commands/getInstalledPlugins.js
  2. 17
      test-browser/tests/pluginManager.js

@ -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

@ -127,6 +127,23 @@ module.exports = {
.waitForElementVisible('*[data-shared="tooltipPopup"]:nth-last-of-type(1)') .waitForElementVisible('*[data-shared="tooltipPopup"]:nth-last-of-type(1)')
.pause(2000) .pause(2000)
.assert.containsText('*[data-shared="tooltipPopup"]:nth-last-of-type(1)', 'Cannot create Plugin : This name has already been used') .assert.containsText('*[data-shared="tooltipPopup"]:nth-last-of-type(1)', 'Cannot create Plugin : This name has already been used')
},
'Should load back installed plugins after reload': function (browser) {
browser.waitForElementVisible('*[data-id="pluginManagerComponentPluginManager"]')
.getInstalledPlugins((plugins) => {
browser.refresh()
.waitForElementVisible('*[data-id="remixIdeSidePanel"]')
.pause(3000)
.perform((done) => {
plugins.forEach(plugin => {
if (plugin !== testData.pluginName) {
browser.waitForElementVisible(`[plugin="${plugin}"`)
}
})
done()
})
})
.end() .end()
}, },
tearDown: sauce tearDown: sauce

Loading…
Cancel
Save