Merge pull request #668 from ethereum/compileRunTab12

compile run tab -12
pull/1/head
yann300 7 years ago committed by GitHub
commit f2940c0e30
  1. 25
      test-browser/helpers/contracts.js
  2. 2
      test-browser/tests/ballot.js
  3. 13
      test-browser/tests/compiling.js
  4. 2
      test-browser/tests/sharedFolderExplorer.js
  5. 2
      test-browser/tests/simpleContract.js
  6. 2
      test-browser/tests/staticanalysis.js

@ -6,12 +6,25 @@ module.exports = {
}
function checkCompiledContracts (browser, compiled, callback) {
browser.elements('css selector', '.udapp .title', function (elements) {
elements.value.map(function (item, i) {
browser.elementIdText(item.ELEMENT, function (text) {
browser.assert.equal(text.value.split('\n')[0], compiled[i])
})
browser.execute(function () {
var contracts = document.querySelectorAll('#compileTabView select option')
if (!contracts) {
return null
} else {
var ret = []
for (var c in contracts) {
ret.push(contracts[c].innerText)
}
return ret
}
}, [], function (result) {
if (!result.value) {
browser.end('no compiled contracts')
} else {
result.value.map(function (item, i) {
browser.assert.equal(item, compiled[i])
})
}
callback()
})
}
@ -21,7 +34,7 @@ function testContracts (browser, contractCode, compiledContractNames, callback)
.clearValue('#input textarea')
.click('.newFile')
.setValue('#input textarea', contractCode, function () {})
.waitForElementPresent('.udapp .create', 50000, true, function () {
.waitForElementPresent('#compileTabView select option', 50000, true, function () {
checkCompiledContracts(browser, compiledContractNames, callback)
})
}

@ -26,7 +26,7 @@ module.exports = {
function runTests (browser, testData) {
browser
.waitForElementVisible('.newFile', 10000)
.click('.envView')
.click('.compileView')
contractHelper.testContracts(browser, sources.sources['browser/Untitled.sol'], ['browser/Untitled.sol:Ballot'], function () {
browser.end()
})

@ -26,11 +26,15 @@ module.exports = {
function runTests (browser) {
browser
.waitForElementVisible('.newFile', 10000)
.click('.envView')
.click('.compileView')
contractHelper.testContracts(browser, sources.sources['browser/Untitled.sol'], ['browser/Untitled.sol:TestContract'], function () {
browser.click('.create .constructor .call')
.waitForElementPresent('.instance .call[title="f"]')
.click('.instance .call[title="f"]')
browser.click('.runView')
.click('#runTabView div[class^="create"]')
.waitForElementPresent('.instance button[title="f"]')
.click('.instance button[title="f"]')
.end()
/*
TODO: this will be logged in the dom console
.waitForElementPresent('.output .returned')
.assert.containsText('.output .returned', '0x0000000000000000000000000000000000000000000000000000000000000008')
.execute(function () {
@ -39,5 +43,6 @@ function runTests (browser) {
browser.assert.containsText('.output .decoded li', 'uint256: 8')
.end()
})
*/
})
}

@ -42,7 +42,7 @@ function runTests (browser, testData) {
.assert.containsText('[data-path="localhost/folder1/contract1.sol"]', 'contract1.sol')
.assert.containsText('[data-path="localhost/folder1/contract2.sol"]', 'contract2.sol')
.click('[data-path="localhost/folder1/contract2.sol"]')
.waitForElementPresent('.udapp .create', 50000, true, function () {
.waitForElementPresent('#compileTabView select option', 50000, true, function () {
contractHelper.checkCompiledContracts(browser, ['localhost/folder1/contract2.sol:test2'], function () {
browser.click('.websocketconn').end()
})

@ -25,7 +25,7 @@ module.exports = {
function runTests (browser) {
browser
.waitForElementVisible('.newFile', 10000)
.click('.envView')
.click('.compileView')
contractHelper.testContracts(browser, sources.sources['browser/Untitled.sol'], ['browser/Untitled.sol:test1', 'browser/Untitled.sol:test2'], function () {
browser.end()
})

@ -32,7 +32,7 @@ module.exports = {
function runTests (browser) {
browser
.waitForElementVisible('.newFile', 10000)
.click('.envView')
.click('.compileView')
contractHelper.testContracts(browser, sources.sources['browser/Untitled.sol'], ['browser/Untitled.sol:TooMuchGas', 'browser/Untitled.sol:test1', 'browser/Untitled.sol:test2'], function () {
browser
.click('.staticanalysisView')

Loading…
Cancel
Save