pull/1/head
yann300 7 years ago
parent cd17c73730
commit 794f04547c
  1. 40
      test-browser/tests/ballot.js

@ -27,14 +27,17 @@ function runTests (browser, testData) {
browser browser
.waitForElementVisible('.newFile', 10000) .waitForElementVisible('.newFile', 10000)
.click('.compileView') .click('.compileView')
contractHelper.testContracts(browser, 'Untitled.sol', sources[0]['browser/Untitled.sol'], ['Ballot'], function () { .perform((client, done) => {
browser contractHelper.testContracts(browser, 'Untitled.sol', sources[0]['browser/Untitled.sol'], ['Ballot'], function () {
.click('.runView') done()
.setValue('input[placeholder="uint8 _numProposals"]', '1', () => {}) })
}).click('.runView')
.setValue('input[placeholder="uint8 _numProposals"]', '1')
.click('#runTabView div[class^="create"]') .click('#runTabView div[class^="create"]')
.testFunction('delegate - transact (not payable)', '0x0571a2439ea58bd349dd130afb8aff62a33af14c06de0dbc3928519bdf13ce2e', .testFunction('delegate - transact (not payable)', '0x0571a2439ea58bd349dd130afb8aff62a33af14c06de0dbc3928519bdf13ce2e',
'[vm] from:0xca3...a733c, to:Ballot.delegate(address) 0x692...77b3a, value:0 wei, data:0x5c1...4d2db, 0 logs, hash:0x057...3ce2e', '[vm] from:0xca3...a733c, to:Ballot.delegate(address) 0x692...77b3a, value:0 wei, data:0x5c1...4d2db, 0 logs, hash:0x057...3ce2e',
{types: 'address to', values: '"0x4b0897b0513fdc7c541b6d9d7e929c4e5364d2db"'}, null, null) {types: 'address to', values: '"0x4b0897b0513fdc7c541b6d9d7e929c4e5364d2db"'}, null, null)
.pause(500)
.click('span#tx0x0571a2439ea58bd349dd130afb8aff62a33af14c06de0dbc3928519bdf13ce2e button[class^="debug"]') .click('span#tx0x0571a2439ea58bd349dd130afb8aff62a33af14c06de0dbc3928519bdf13ce2e button[class^="debug"]')
.pause(1000) .pause(1000)
.click('#jumppreviousbreakpoint') .click('#jumppreviousbreakpoint')
@ -42,11 +45,12 @@ function runTests (browser, testData) {
.click('#asmcodes .title') .click('#asmcodes .title')
.pause(500) .pause(500)
.perform(function (client, done) { .perform(function (client, done) {
console.log('goToVMtraceStep')
contractHelper.goToVMtraceStep(browser, 39, () => { contractHelper.goToVMtraceStep(browser, 39, () => {
done() done()
}) })
}) })
.pause(5000) .pause(1000)
.perform(function (client, done) { .perform(function (client, done) {
contractHelper.checkDebug(browser, 'soliditystate', stateCheck, () => { contractHelper.checkDebug(browser, 'soliditystate', stateCheck, () => {
done() done()
@ -59,18 +63,24 @@ function runTests (browser, testData) {
}) })
.click('.runView') .click('.runView')
.click('div[class^="udappClose"]') .click('div[class^="udappClose"]')
.perform(function (client, done) { .perform((client, done) => {
contractHelper.addFile(client, 'ballot.abi', { content: ballotABI }, () => { console.log('ballot.abi')
contractHelper.addInstance(client, '0x692a70d2e424a56d2c6c27aa97d1a86395877b3a', () => { contractHelper.addFile(browser, 'ballot.abi', { content: ballotABI }, () => {
browser.testFunction('delegate - transact (not payable)', '0xd3cd54e2f76f3993078ecf9e1b54a148def4520afc141a182293b3610bddf10f', done()
'[vm] from:0xca3...a733c, to:Ballot.delegate(address) 0x692...77b3a, value:0 wei, data:0x5c1...4d2db, 0 logs, hash:0xd3c...df10f',
{types: 'address to', values: '"0x4b0897b0513fdc7c541b6d9d7e929c4e5364d2db"'}, null, null).perform(() => {
browser.end()
})
})
}) })
}) })
}) .perform((client, done) => {
console.log('addInstance 0x692a70d2e424a56d2c6c27aa97d1a86395877b3a')
contractHelper.addInstance(browser, '0x692a70d2e424a56d2c6c27aa97d1a86395877b3a', () => {
done()
})
})
.perform((client, done) => {
console.log('delegate - transact (not payable)')
browser.testFunction('delegate - transact (not payable)', '0xd3cd54e2f76f3993078ecf9e1b54a148def4520afc141a182293b3610bddf10f',
'[vm] from:0xca3...a733c, to:Ballot.delegate(address) 0x692...77b3a, value:0 wei, data:0x5c1...4d2db, 0 logs, hash:0xd3c...df10f',
{types: 'address to', values: '"0x4b0897b0513fdc7c541b6d9d7e929c4e5364d2db"'}, null, null, () => { done() })
}).end()
} }
var localsCheck = { var localsCheck = {

Loading…
Cancel
Save