|
|
@ -85,23 +85,17 @@ function clickFunction (fnFullName, expectedInput) { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function verifyCallReturnValue (browser, address, checks, done) { |
|
|
|
function verifyCallReturnValue (browser, address, checks, done) { |
|
|
|
browser.execute(function (address, checks) { |
|
|
|
browser.execute(function (address) { |
|
|
|
var nodes = document.querySelectorAll('#instance' + address + ' div[class^="contractProperty"] div[class^="value"]') |
|
|
|
var nodes = document.querySelectorAll('#instance' + address + ' div[class^="contractProperty"] div[class^="value"]') |
|
|
|
var ret = {sucess: true} |
|
|
|
var ret = [] |
|
|
|
for (var k in checks) { |
|
|
|
for (var k in checks) { |
|
|
|
var text = nodes[k].innerText ? nodes[k].innerText : nodes[k].textContent |
|
|
|
var text = nodes[k].innerText ? nodes[k].innerText : nodes[k].textContent |
|
|
|
text = text.replace('\n', '') |
|
|
|
ret.push(text) |
|
|
|
if (checks[k] !== text) { |
|
|
|
|
|
|
|
ret.sucess = false |
|
|
|
|
|
|
|
ret.expected = checks[k] |
|
|
|
|
|
|
|
ret.got = text |
|
|
|
|
|
|
|
return ret |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
return ret |
|
|
|
return ret |
|
|
|
}, [address, checks], function (result) { |
|
|
|
}, [address], function (result) { |
|
|
|
if (!result.value.sucess) { |
|
|
|
for (var k in checks) { |
|
|
|
browser.assert.fail('verifyCallReturnValue failed', JSON.stringify(result.value), '') |
|
|
|
browser.assert.equal(checks[k], result.value[k]) |
|
|
|
} |
|
|
|
} |
|
|
|
done() |
|
|
|
done() |
|
|
|
}) |
|
|
|
}) |
|
|
|