remix-project mirror
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
remix-project/apps/remix-ide/test-browser/commands/clickFunction.js

26 lines
794 B

const EventEmitter = require('events')
class ClickFunction extends EventEmitter {
command (fnFullName, expectedInput) {
this.api.waitForElementPresent('.instance button[title="' + fnFullName + '"]')
.perform(function (client, done) {
client.execute(function () {
document.querySelector('#runTabView').scrollTop = document.querySelector('#runTabView').scrollHeight
}, [], function () {
if (expectedInput) {
client.setValue('#runTabView input[title="' + expectedInput.types + '"]', expectedInput.values, function () {})
}
done()
})
})
.click('.instance button[title="' + fnFullName + '"]')
5 years ago
.pause(2000)
.perform(() => {
this.emit('complete')
})
return this
}
}
module.exports = ClickFunction