Commit 08a807d6 authored by LianaHus's avatar LianaHus Committed by Liana Husikyan

added a test

parent 55c5b6bf
const EventEmitter = require('events')
class sendLowLevelTx extends EventEmitter {
command (address, value, callData, callback) {
this.api.perform((client, done) => {
this.api.execute(function (value) {
document.getElementById('deployAndRunLLTxSendTransaction').click
done()
if (callback) {
callback.call(this.api)
}
this.emit('complete')
})
})
return this
}
}
module.exports = sendLowLevelTx
'use strict'
var init = require('../helpers/init')
var sauce = require('./sauce')
module.exports = {
before: function (browser, done) {
init(browser, done)
},
'@sources': function () {
return sources
},
'Use special functions receive/fullback': function (browser) {
browser.waitForElementVisible('#icon-panel', 10000)
.testContracts('receiveAndfFallback.sol', sources[0]['browser/Untitled.sol'], ['CheckSpecials'])
.clickLaunchIcon('udapp'
.selectContract('CheckSpecials')
.createContract('')
.clickInstance(0)
.perform((done) => {
browser.getAddressAtPosition(0, (address) => {
browser.sendLowLevelTx(address, '0', '0xaa')
.journalLastChild('dd')
.waitForElementVisible('label[id="deployAndRunLLTxError"]')
.assert.containsText('label[id="deployAndRunLLTxError"]', '')
.perform(done)
})
})
)
},
tearDown: sauce
}
var sources = [
{
'browser/receiveAndfFallback.sol': {
content: `
contract CheckSpecials {
receive() payable external{}
fallback() external {}
}
`
},
'browser/receiveOnly.sol': {
content: `
contract CheckSpecials {
receive() payable external{}
}
`
},
'browser/fallbackOnly.sol': {
content: `
contract CheckSpecials {
fallback() payable external{}
}
`
}
}
]
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