Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test for plugin reload after webpage refresh #2760

Merged
merged 1 commit into from
Apr 22, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions test-browser/commands/getInstalledPlugins.js
Original file line number Diff line number Diff line change
@@ -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
17 changes: 17 additions & 0 deletions test-browser/tests/pluginManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,23 @@ module.exports = {
.waitForElementVisible('*[data-shared="tooltipPopup"]:nth-last-of-type(1)')
.pause(2000)
.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) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Skipped check for local plugin because RemixIDE does not currently support reloading of local plugin after refresh. Here is an issue tracking it #2760

browser.waitForElementVisible(`[plugin="${plugin}"`)
}
})
done()
})
})
.end()
},
tearDown: sauce
Expand Down