added scrollAndclick command to browsertest

pull/1/head
LianaHus 5 years ago
parent acbd919a75
commit f1f1971a3b
  1. 4
      test-browser/commands/scrollAndClick.js
  2. 15
      test-browser/helpers/init.js

@ -1,6 +1,6 @@
const EventEmitter = require('events') const EventEmitter = require('events')
class ScrollAndClick extends EventEmitter { class scrollAndClick extends EventEmitter {
command (target) { command (target) {
this.api this.api
.scrollInto(target) .scrollInto(target)
@ -12,4 +12,4 @@ class ScrollAndClick extends EventEmitter {
} }
} }
module.exports = ScrollAndClick module.exports = scrollAndClick

@ -16,16 +16,11 @@ module.exports = function (browser, callback) {
function initModules (browser, callback) { function initModules (browser, callback) {
browser.pause(3000) browser.pause(3000)
.click('#icon-panel div[plugin="pluginManager"]') .click('#icon-panel div[plugin="pluginManager"]')
.scrollInto('#pluginManager article[id="remixPluginManagerListItem_solidity"] button') .scrollAndClick('#pluginManager article[id="remixPluginManagerListItem_solidity"] button')
.click('#pluginManager article[id="remixPluginManagerListItem_solidity"] button')
.pause(5000) .pause(5000)
.scrollInto('#pluginManager article[id="remixPluginManagerListItem_udapp"] button') .scrollAndClick('#pluginManager article[id="remixPluginManagerListItem_udapp"] button')
.click('#pluginManager article[id="remixPluginManagerListItem_udapp"] button') .scrollAndClick('#pluginManager article[id="remixPluginManagerListItem_solidityStaticAnalysis"] button')
.scrollInto('#pluginManager article[id="remixPluginManagerListItem_solidityStaticAnalysis"] button') .scrollAndClick('#pluginManager article[id="remixPluginManagerListItem_debugger"] button')
.click('#pluginManager article[id="remixPluginManagerListItem_solidityStaticAnalysis"] button') .scrollAndClick('#icon-panel div[plugin="fileExplorers"]')
.scrollInto('#pluginManager article[id="remixPluginManagerListItem_debugger"] button')
.click('#pluginManager article[id="remixPluginManagerListItem_debugger"] button')
.scrollInto('#icon-panel div[plugin="fileExplorers"]')
.click('#icon-panel div[plugin="fileExplorers"]')
.perform(() => { callback() }) .perform(() => { callback() })
} }

Loading…
Cancel
Save