fix browser test

pull/1/head
yann300 6 years ago
parent fc8867d358
commit 71c92a1843
  1. 21
      test-browser/helpers/contracts.js
  2. 1
      test-browser/tests/simpleContract.js

@ -24,7 +24,8 @@ module.exports = {
renameFile,
removeFile,
getAddressAtPosition,
clickLaunchIcon
clickLaunchIcon,
scrollDown
}
function clickLaunchIcon (icon) {
@ -153,11 +154,29 @@ function testConstantFunction (browser, address, fnFullName, expectedInput, expe
.click('.instance button[title="' + fnFullName + '"]')
.pause(1000)
.waitForElementPresent('#instance' + address + ' div[class^="contractActionsContainer"] div[class^="value"]')
.scrollDown('#runTabView')
.assert.containsText('#instance' + address + ' div[class^="contractActionsContainer"] div[class^="value"]', expectedOutput).perform(() => {
cb()
})
}
function scrollDown (target) {
return this.perform((client, done) => {
_scrollDown(this, target, () => {
done()
})
})
}
function _scrollDown (browser, target, cb) {
browser.execute(function () {
document.querySelector(target).scrollTop = 0
document.querySelector(target).scrollTop = document.querySelector(target).scrollHeight
}, [], function () {
cb()
})
}
function testFunction (fnFullName, txHash, log, expectedInput, expectedReturn, expectedEvent, callback) {
// this => browser
this.waitForElementPresent('.instance button[title="' + fnFullName + '"]')

@ -21,6 +21,7 @@ function runTests (browser) {
browser.setEditorValue = contractHelper.setEditorValue
browser.getEditorValue = contractHelper.getEditorValue
browser.clickLaunchIcon = contractHelper.clickLaunchIcon
browser.scrollDown = contractHelper.scrollDown
browser
.waitForElementVisible('#icon-panel', 10000)
.clickLaunchIcon('solidity')

Loading…
Cancel
Save