remix-project mirror
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
remix-project/test-browser/helpers/contracts.js

27 lines
843 B

'use strict'
module.exports = {
checkCompiledContracts: checkCompiledContracts,
testContracts: testContracts
}
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])
})
})
callback()
})
}
function testContracts (browser, contractCode, compiledContractNames, callback) {
browser
.clearValue('#input textarea')
.click('.newFile')
.setValue('#input textarea', contractCode, function () {})
.waitForElementPresent('.udapp .create', 5000, true, function () {
checkCompiledContracts(browser, compiledContractNames, callback)
})
}