pull/3094/head
yann300 7 years ago committed by Eswara Sai
parent 5ce377e3ba
commit fbb1aca61b
  1. 26
      test-browser/helpers/contracts.js

@ -161,23 +161,19 @@ function setEditorValue (value, callback) {
return this
}
function addInstance (browser, address, isValidFormat, isValidChecksum, callback) {
function addInstance(browser, address, isValidFormat, isValidChecksum, callback) {
browser.setValue('.ataddressinput', address, function () {
browser.click('div[class^="atAddress"]')
.perform((client, done) => {
browser.execute(function () {
var ret = document.querySelector('div[class^="modalBody"] div').innerHTML
document.querySelector('#modal-footer-ok').click()
return ret
}, [], function (result) {
if (!isValidFormat) {
browser.assert.fail(result.value, 'Invalid address.', '')
} else if (!isValidChecksum) {
browser.assert.fail(result.value, 'Invalid checksum address.', '')
}
done()
})
}).perform(() => {
.execute(function () {
var ret = document.querySelector('div[class^="modalBody"] div').innerHTML
document.querySelector('#modal-footer-ok').click()
return ret
}, [], function (result) {
if (!isValidFormat) {
browser.assert.equal(result.value, 'Invalid address.')
} else if (!isValidChecksum) {
browser.assert.equal(result.value, 'Invalid checksum address.')
}
callback()
})
})

Loading…
Cancel
Save