diff --git a/test-browser/helpers/contracts.js b/test-browser/helpers/contracts.js index 841a96368a..3b53223d73 100644 --- a/test-browser/helpers/contracts.js +++ b/test-browser/helpers/contracts.js @@ -13,7 +13,8 @@ module.exports = { useFilter, addInstance, clickFunction, - verifyCallReturnValue + verifyCallReturnValue, + setEditorValue } function getCompiledContracts (browser, compiled, callback) { @@ -134,6 +135,17 @@ function testFunction (fnFullName, txHash, log, expectedInput, expectedReturn, e return this } +function setEditorValue (value) { + this.perform((client, done) => { + this.execute(function (value) { + document.getElementById('input').editor.session.setValue(value) + }, [value], function (result) { + done() + }) + }) + return this +} + function addInstance (browser, address, done) { browser.setValue('.ataddressinput', address, function () { browser.click('div[class^="atAddress"]') @@ -160,7 +172,7 @@ function addFile (browser, name, content, done) { done() }) }) - .setValue('#input textarea', content.content, function () {}) + .setEditorValue(content.content) .pause(1000) .perform(function () { done() diff --git a/test-browser/tests/ballot.js b/test-browser/tests/ballot.js index e6c6be3bb0..0bf04ed247 100644 --- a/test-browser/tests/ballot.js +++ b/test-browser/tests/ballot.js @@ -23,6 +23,7 @@ module.exports = { function runTests (browser, testData) { browser.testFunction = contractHelper.testFunction + browser.setEditorValue = contractHelper.setEditorValue browser .waitForElementVisible('.newFile', 10000) .click('.compileView') diff --git a/test-browser/tests/compiling.js b/test-browser/tests/compiling.js index 1b6df78165..0d13d93a5d 100644 --- a/test-browser/tests/compiling.js +++ b/test-browser/tests/compiling.js @@ -21,6 +21,7 @@ module.exports = { function runTests (browser) { browser.testFunction = contractHelper.testFunction browser.clickFunction = contractHelper.clickFunction + browser.setEditorValue = contractHelper.setEditorValue browser .waitForElementVisible('.newFile', 10000) .click('.compileView')