Unverified Commit 4fb84532 authored by yann300's avatar yann300 Committed by GitHub

Merge pull request #2313 from ethereum/LianaHus-patch-7

fixes sort of plugin list
parents b97b6ae2 593b5f9e
...@@ -145,8 +145,8 @@ class PluginManagerComponent extends ViewPlugin { ...@@ -145,8 +145,8 @@ class PluginManagerComponent extends ViewPlugin {
const isNotRequired = ({profile}) => !this.appManager.isRequired(profile.name) const isNotRequired = ({profile}) => !this.appManager.isRequired(profile.name)
const isNotHome = ({profile}) => profile.name !== 'home' const isNotHome = ({profile}) => profile.name !== 'home'
const sortByName = (a, b) => { const sortByName = (a, b) => {
const nameA = a.name.toUpperCase() const nameA = ((a.profile.displayName) ? a.profile.displayName : a.profile.name).toUpperCase()
const nameB = b.name.toUpperCase() const nameB = ((b.profile.displayName) ? b.profile.displayName : b.profile.name).toUpperCase()
return (nameA < nameB) ? -1 : (nameA > nameB) ? 1 : 0 return (nameA < nameB) ? -1 : (nameA > nameB) ? 1 : 0
} }
......
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
...@@ -14,7 +14,7 @@ class ScrollInto extends EventEmitter { ...@@ -14,7 +14,7 @@ class ScrollInto extends EventEmitter {
function _scrollInto (browser, target, cb) { function _scrollInto (browser, target, cb) {
browser.execute(function (target) { browser.execute(function (target) {
document.querySelector(target).scrollIntoView() document.querySelector(target).scrollIntoView(({block: 'center'}))
}, [target], function () { }, [target], function () {
cb() cb()
}) })
......
...@@ -14,16 +14,13 @@ module.exports = function (browser, callback) { ...@@ -14,16 +14,13 @@ module.exports = function (browser, callback) {
} }
function initModules (browser, callback) { function initModules (browser, callback) {
browser.pause(3000).click('#icon-panel div[plugin="pluginManager"]') browser.pause(3000)
.execute(function () { .click('#icon-panel div[plugin="pluginManager"]')
document.querySelector('div[id="pluginManager"]').scrollTop = document.querySelector('div[id="pluginManager"]').scrollHeight .scrollAndClick('#pluginManager article[id="remixPluginManagerListItem_solidity"] button')
}, [], function () {
browser.click('#pluginManager article[id="remixPluginManagerListItem_solidity"] button')
.pause(5000) .pause(5000)
.click('#pluginManager article[id="remixPluginManagerListItem_udapp"] button') .scrollAndClick('#pluginManager article[id="remixPluginManagerListItem_udapp"] button')
.click('#pluginManager article[id="remixPluginManagerListItem_solidityStaticAnalysis"] button') .scrollAndClick('#pluginManager article[id="remixPluginManagerListItem_solidityStaticAnalysis"] button')
.click('#pluginManager article[id="remixPluginManagerListItem_debugger"] button') .scrollAndClick('#pluginManager article[id="remixPluginManagerListItem_debugger"] button')
.click('#icon-panel div[plugin="fileExplorers"]') .scrollAndClick('#icon-panel div[plugin="fileExplorers"]')
.perform(() => { callback() }) .perform(() => { callback() })
})
} }
...@@ -60,7 +60,7 @@ function runTests (browser, testData) { ...@@ -60,7 +60,7 @@ function runTests (browser, testData) {
.waitForElementVisible('#icon-panel', 2000) .waitForElementVisible('#icon-panel', 2000)
.clickLaunchIcon('fileExplorers') .clickLaunchIcon('fileExplorers')
.clickLaunchIcon('pluginManager') .clickLaunchIcon('pluginManager')
.click('#pluginManager article[id="remixPluginManagerListItem_remixd"] button') .scrollAndClick('#pluginManager article[id="remixPluginManagerListItem_remixd"] button')
.waitForElementVisible('#modal-footer-ok', 2000) .waitForElementVisible('#modal-footer-ok', 2000)
.pause(2000) .pause(2000)
.click('#modal-footer-ok') .click('#modal-footer-ok')
...@@ -99,7 +99,7 @@ function runTests (browser, testData) { ...@@ -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 .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"]') .click('[data-path="localhost/folder1/renamed_contract_' + browserName + '.sol"]')
.clickLaunchIcon('pluginManager') .clickLaunchIcon('pluginManager')
.click('#pluginManager article[id="remixPluginManagerListItem_remixd"] button') .scrollAndClick('#pluginManager article[id="remixPluginManagerListItem_remixd"] button')
.end() .end()
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment