Commit 4741fc20 authored by Alex Beregszaszi's avatar Alex Beregszaszi Committed by GitHub

Merge pull request #250 from ethereum/testing

Fix testing and add compilation test.
parents fb490734 1d90c59a
'use strict'
var contractHelper = require('../helpers/contracts')
var init = require('../helpers/init')
var sauce = require('./sauce')
var sources = {
'sources': {
'Untitled': `pragma solidity ^0.4.0;
contract TestContract { function f() returns (uint) { return 8; } }`
}
}
module.exports = {
before: function (browser, done) {
init(browser, done)
},
'@sources': function () {
return sources
},
'Compiling': function (browser) {
runTests(browser)
},
tearDown: sauce
}
function runTests (browser) {
browser
.waitForElementVisible('.newFile', 10000)
contractHelper.testContracts(browser, sources.sources.Untitled, ['TestContract'], function () {
browser.click('.create .constructor .call')
.waitForElementPresent('.instance .call[title="f"]')
.click('.instance .call[title="f"]')
.waitForElementPresent('.output .returned')
.assert.containsText('.output .returned', '0x0000000000000000000000000000000000000000000000000000000000000008')
.assert.containsText('.output .decoded li', 'uint256: 8')
.end()
})
}
...@@ -10,7 +10,7 @@ module.exports = { ...@@ -10,7 +10,7 @@ module.exports = {
browser browser
.waitForElementVisible('.newFile', 10000) .waitForElementVisible('.newFile', 10000)
.click('.newFile') .click('.newFile')
.pause('10000') .pause(500)
.assert.containsText('.active', 'Untitled') .assert.containsText('.active', 'Untitled')
.end() .end()
}, },
......
...@@ -10,7 +10,6 @@ module.exports = { ...@@ -10,7 +10,6 @@ module.exports = {
'Smoke test': function (browser) { 'Smoke test': function (browser) {
browser browser
.waitForElementVisible('#righthand-panel', 10000) .waitForElementVisible('#righthand-panel', 10000)
.pause('10000')
.assert.containsText('#righthand-panel', 'Solidity version') .assert.containsText('#righthand-panel', 'Solidity version')
.end() .end()
}, },
......
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