Commit 97404021 authored by yann300's avatar yann300

add setEditorValue

parent f112f9ae
...@@ -13,7 +13,8 @@ module.exports = { ...@@ -13,7 +13,8 @@ module.exports = {
useFilter, useFilter,
addInstance, addInstance,
clickFunction, clickFunction,
verifyCallReturnValue verifyCallReturnValue,
setEditorValue
} }
function getCompiledContracts (browser, compiled, callback) { function getCompiledContracts (browser, compiled, callback) {
...@@ -134,6 +135,17 @@ function testFunction (fnFullName, txHash, log, expectedInput, expectedReturn, e ...@@ -134,6 +135,17 @@ function testFunction (fnFullName, txHash, log, expectedInput, expectedReturn, e
return this 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) { function addInstance (browser, address, done) {
browser.setValue('.ataddressinput', address, function () { browser.setValue('.ataddressinput', address, function () {
browser.click('div[class^="atAddress"]') browser.click('div[class^="atAddress"]')
...@@ -160,7 +172,7 @@ function addFile (browser, name, content, done) { ...@@ -160,7 +172,7 @@ function addFile (browser, name, content, done) {
done() done()
}) })
}) })
.setValue('#input textarea', content.content, function () {}) .setEditorValue(content.content)
.pause(1000) .pause(1000)
.perform(function () { .perform(function () {
done() done()
......
...@@ -23,6 +23,7 @@ module.exports = { ...@@ -23,6 +23,7 @@ module.exports = {
function runTests (browser, testData) { function runTests (browser, testData) {
browser.testFunction = contractHelper.testFunction browser.testFunction = contractHelper.testFunction
browser.setEditorValue = contractHelper.setEditorValue
browser browser
.waitForElementVisible('.newFile', 10000) .waitForElementVisible('.newFile', 10000)
.click('.compileView') .click('.compileView')
......
...@@ -21,6 +21,7 @@ module.exports = { ...@@ -21,6 +21,7 @@ module.exports = {
function runTests (browser) { function runTests (browser) {
browser.testFunction = contractHelper.testFunction browser.testFunction = contractHelper.testFunction
browser.clickFunction = contractHelper.clickFunction browser.clickFunction = contractHelper.clickFunction
browser.setEditorValue = contractHelper.setEditorValue
browser browser
.waitForElementVisible('.newFile', 10000) .waitForElementVisible('.newFile', 10000)
.click('.compileView') .click('.compileView')
......
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