refactor ballot

pull/3094/head
yann300 6 years ago
parent 1f401744e8
commit f8b0c62df5
  1. 22
      test-browser/tests/ballot.js

@ -14,14 +14,8 @@ module.exports = {
'@sources': function () { '@sources': function () {
return sources return sources
}, },
'Ballot': function (browser) { 'Deploy Ballot': function (browser) {
runTests(browser) browser
},
tearDown: sauce
}
function runTests (browser, testData) {
browser
.waitForElementVisible('#icon-panel', 10000) .waitForElementVisible('#icon-panel', 10000)
.clickLaunchIcon('solidity') .clickLaunchIcon('solidity')
.testContracts('Untitled.sol', sources[0]['browser/Untitled.sol'], ['Ballot']) .testContracts('Untitled.sol', sources[0]['browser/Untitled.sol'], ['Ballot'])
@ -33,7 +27,10 @@ function runTests (browser, testData) {
.testFunction('delegate - transact (not payable)', '0x0571a2439ea58bd349dd130afb8aff62a33af14c06de0dbc3928519bdf13ce2e', .testFunction('delegate - transact (not payable)', '0x0571a2439ea58bd349dd130afb8aff62a33af14c06de0dbc3928519bdf13ce2e',
`[vm]\nfrom:0xca3...a733c\nto:Ballot.delegate(address) 0x692...77b3a\nvalue:0 wei\ndata:0x5c1...4d2db\nlogs:0\nhash:0x057...3ce2e`, `[vm]\nfrom:0xca3...a733c\nto:Ballot.delegate(address) 0x692...77b3a\nvalue:0 wei\ndata:0x5c1...4d2db\nlogs:0\nhash:0x057...3ce2e`,
{types: 'address to', values: '"0x4b0897b0513fdc7c541b6d9d7e929c4e5364d2db"'}, null, null) {types: 'address to', values: '"0x4b0897b0513fdc7c541b6d9d7e929c4e5364d2db"'}, null, null)
.pause(500) },
'Debug Ballot / delegate': function (browser) {
browser.pause(500)
.click('span#tx0x0571a2439ea58bd349dd130afb8aff62a33af14c06de0dbc3928519bdf13ce2e button[class^="debug"]') .click('span#tx0x0571a2439ea58bd349dd130afb8aff62a33af14c06de0dbc3928519bdf13ce2e button[class^="debug"]')
.pause(2000) .pause(2000)
.clickLaunchIcon('debugger') .clickLaunchIcon('debugger')
@ -43,7 +40,10 @@ function runTests (browser, testData) {
.pause(1000) .pause(1000)
.checkVariableDebug('soliditystate', stateCheck) .checkVariableDebug('soliditystate', stateCheck)
.checkVariableDebug('soliditylocals', localsCheck) .checkVariableDebug('soliditylocals', localsCheck)
.clickLaunchIcon('run') },
'Access Ballot via at address': function (browser) {
browser.clickLaunchIcon('run')
.click('button[class^="udappClose"]') .click('button[class^="udappClose"]')
.addFile('ballot.abi', { content: ballotABI }) .addFile('ballot.abi', { content: ballotABI })
.addAtAddressInstance('0x692a70D2e424a56D2C6C27aA97D1a86395877b3B', true, false) .addAtAddressInstance('0x692a70D2e424a56D2C6C27aA97D1a86395877b3B', true, false)
@ -56,6 +56,8 @@ function runTests (browser, testData) {
`[vm]\nfrom:0xca3...a733c\nto:Ballot.delegate(address) 0x692...77b3a\nvalue:0 wei\ndata:0x5c1...4d2db\nlogs:0\nhash:0xd3c...df10f`, `[vm]\nfrom:0xca3...a733c\nto:Ballot.delegate(address) 0x692...77b3a\nvalue:0 wei\ndata:0x5c1...4d2db\nlogs:0\nhash:0xd3c...df10f`,
{types: 'address to', values: '"0x4b0897b0513fdc7c541b6d9d7e929c4e5364d2db"'}, null, null) {types: 'address to', values: '"0x4b0897b0513fdc7c541b6d9d7e929c4e5364d2db"'}, null, null)
.end() .end()
},
tearDown: sauce
} }
var localsCheck = { var localsCheck = {

Loading…
Cancel
Save