Commit 09a4147f authored by yann300's avatar yann300

improve testing output and event

parent 99b3b01b
...@@ -135,13 +135,25 @@ function testFunction (fnFullName, txHash, log, expectedInput, expectedReturn, e ...@@ -135,13 +135,25 @@ function testFunction (fnFullName, txHash, log, expectedInput, expectedReturn, e
.click('#editor-container div[class^="terminal"] span[id="tx' + txHash + '"] div[class^="log"]') .click('#editor-container div[class^="terminal"] span[id="tx' + txHash + '"] div[class^="log"]')
.perform(function (client, done) { .perform(function (client, done) {
if (expectedReturn) { if (expectedReturn) {
client.assert.containsText('#editor-container div[class^="terminal"] span[id="tx' + txHash + '"] table[class^="txTable"] #decodedoutput', expectedReturn) client.getText('#editor-container div[class^="terminal"] span[id="tx' + txHash + '"] table[class^="txTable"] #decodedoutput', (result) => {
console.log(result)
var equal = deepequal(JSON.parse(result.value), JSON.parse(expectedReturn))
if (!equal) {
client.assert.fail('expected ' + expectedReturn + ' got ' + result.value, 'info about error', '')
}
})
} }
done() done()
}) })
.perform(function (client, done) { .perform(function (client, done) {
if (expectedEvent) { if (expectedEvent) {
client.assert.containsText('#editor-container div[class^="terminal"] span[id="tx' + txHash + '"] table[class^="txTable"] #logs', expectedEvent) client.getText('#editor-container div[class^="terminal"] span[id="tx' + txHash + '"] table[class^="txTable"] #logs', (result) => {
console.log(result)
var equal = deepequal(JSON.parse(result.value), JSON.parse(expectedEvent))
if (!equal) {
client.assert.fail('expected ' + expectedEvent + ' got ' + result.value, 'info about error', '')
}
})
} }
done() done()
if (callback) callback() if (callback) callback()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment