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/commands/testContracts.js

28 lines
708 B

const EventEmitter = require('events')
class TestContracts extends EventEmitter {
command (fileName, contractCode, compiledContractNames) {
this.api.perform((done) => {
testContracts(this.api, fileName, contractCode, compiledContractNames, () => {
done()
this.emit('complete')
})
})
return this
}
}
function testContracts (browser, fileName, contractCode, compiledContractNames, callback) {
browser
.clickLaunchIcon('solidity')
.clearValue('#input textarea')
.addFile(fileName, contractCode)
.pause(1000)
.verifyContracts(compiledContractNames)
.perform(() => {
callback()
})
}
module.exports = TestContracts