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

fixes sort of plugin list
pull/1/head
yann300 5 years ago committed by GitHub
commit 4fb8453295
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      src/app/components/plugin-manager-component.js
  2. 15
      test-browser/commands/scrollAndClick.js
  3. 2
      test-browser/commands/scrollInto.js
  4. 17
      test-browser/helpers/init.js
  5. 4
      test-browser/tests/remixd.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
}

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

@ -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()
})

@ -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() })
})
}

@ -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()
}

Loading…
Cancel
Save