diff --git a/src/app/components/plugin-manager-component.js b/src/app/components/plugin-manager-component.js index 484b4eb204..314a51ae45 100644 --- a/src/app/components/plugin-manager-component.js +++ b/src/app/components/plugin-manager-component.js @@ -145,8 +145,8 @@ class PluginManagerComponent extends ViewPlugin { const isNotRequired = ({profile}) => !this.appManager.isRequired(profile.name) const isNotHome = ({profile}) => profile.name !== 'home' const sortByName = (a, b) => { - const nameA = a.name.toUpperCase() - const nameB = b.name.toUpperCase() + const nameA = ((a.profile.displayName) ? a.profile.displayName : a.profile.name).toUpperCase() + const nameB = ((b.profile.displayName) ? b.profile.displayName : b.profile.name).toUpperCase() return (nameA < nameB) ? -1 : (nameA > nameB) ? 1 : 0 } diff --git a/test-browser/commands/scrollAndClick.js b/test-browser/commands/scrollAndClick.js new file mode 100644 index 0000000000..ab44f47d57 --- /dev/null +++ b/test-browser/commands/scrollAndClick.js @@ -0,0 +1,15 @@ +const EventEmitter = require('events') + +class scrollAndClick extends EventEmitter { + command (target) { + this.api + .scrollInto(target) + .click(target) + .perform(() => { + this.emit('complete') + }) + return this + } +} + +module.exports = scrollAndClick diff --git a/test-browser/commands/scrollInto.js b/test-browser/commands/scrollInto.js index 1bcc529ae5..e5727225c0 100644 --- a/test-browser/commands/scrollInto.js +++ b/test-browser/commands/scrollInto.js @@ -14,7 +14,7 @@ class ScrollInto extends EventEmitter { function _scrollInto (browser, target, cb) { browser.execute(function (target) { - document.querySelector(target).scrollIntoView() + document.querySelector(target).scrollIntoView(({block: 'center'})) }, [target], function () { cb() }) diff --git a/test-browser/helpers/init.js b/test-browser/helpers/init.js index 6b26763e37..1ce93a57d8 100644 --- a/test-browser/helpers/init.js +++ b/test-browser/helpers/init.js @@ -14,16 +14,13 @@ module.exports = function (browser, callback) { } function initModules (browser, callback) { - browser.pause(3000).click('#icon-panel div[plugin="pluginManager"]') - .execute(function () { - document.querySelector('div[id="pluginManager"]').scrollTop = document.querySelector('div[id="pluginManager"]').scrollHeight - }, [], function () { - browser.click('#pluginManager article[id="remixPluginManagerListItem_solidity"] button') + browser.pause(3000) + .click('#icon-panel div[plugin="pluginManager"]') + .scrollAndClick('#pluginManager article[id="remixPluginManagerListItem_solidity"] button') .pause(5000) - .click('#pluginManager article[id="remixPluginManagerListItem_udapp"] button') - .click('#pluginManager article[id="remixPluginManagerListItem_solidityStaticAnalysis"] button') - .click('#pluginManager article[id="remixPluginManagerListItem_debugger"] button') - .click('#icon-panel div[plugin="fileExplorers"]') + .scrollAndClick('#pluginManager article[id="remixPluginManagerListItem_udapp"] button') + .scrollAndClick('#pluginManager article[id="remixPluginManagerListItem_solidityStaticAnalysis"] button') + .scrollAndClick('#pluginManager article[id="remixPluginManagerListItem_debugger"] button') + .scrollAndClick('#icon-panel div[plugin="fileExplorers"]') .perform(() => { callback() }) - }) } diff --git a/test-browser/tests/remixd.js b/test-browser/tests/remixd.js index 6ef586de3f..7b93666164 100644 --- a/test-browser/tests/remixd.js +++ b/test-browser/tests/remixd.js @@ -60,7 +60,7 @@ function runTests (browser, testData) { .waitForElementVisible('#icon-panel', 2000) .clickLaunchIcon('fileExplorers') .clickLaunchIcon('pluginManager') - .click('#pluginManager article[id="remixPluginManagerListItem_remixd"] button') + .scrollAndClick('#pluginManager article[id="remixPluginManagerListItem_remixd"] button') .waitForElementVisible('#modal-footer-ok', 2000) .pause(2000) .click('#modal-footer-ok') @@ -99,7 +99,7 @@ function runTests (browser, testData) { .waitForElementNotPresent('[data-path="localhost/folder1/contract_' + browserName + '_toremove.sol"]') // check if removed (old) file is not present .click('[data-path="localhost/folder1/renamed_contract_' + browserName + '.sol"]') .clickLaunchIcon('pluginManager') - .click('#pluginManager article[id="remixPluginManagerListItem_remixd"] button') + .scrollAndClick('#pluginManager article[id="remixPluginManagerListItem_remixd"] button') .end() }