|
|
|
@ -42,6 +42,25 @@ module.exports = { |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
'Should execute `writeMultipleFiles` api from file manager external api #group1': function (browser: NightwatchBrowser) { |
|
|
|
|
browser |
|
|
|
|
.addFile('writeMultipleFiles.js', { content: executeWriteMultipleFiles }) |
|
|
|
|
.executeScriptInTerminal('remix.exeCurrent()') |
|
|
|
|
.pause(2000) |
|
|
|
|
.openFile('new_contract_1.sol') |
|
|
|
|
.getEditorValue((content) => { |
|
|
|
|
browser.assert.ok(content.indexOf('pragma solidity ^0.6.0') !== -1, 'content does not contain "pragma solidity ^0.6.0"') |
|
|
|
|
}) |
|
|
|
|
.openFile('new_contract_2.sol') |
|
|
|
|
.getEditorValue((content) => { |
|
|
|
|
browser.assert.ok(content.indexOf('pragma solidity ^0.8.0') !== -1, 'content does not contain "pragma solidity ^0.8.0"') |
|
|
|
|
}) |
|
|
|
|
.openFile('testing.txt') |
|
|
|
|
.getEditorValue((content) => { |
|
|
|
|
browser.assert.ok(content.indexOf('test') !== -1, 'content does not contain "test"') |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
'Should execute `readFile` api from file manager external api #group2': function (browser: NightwatchBrowser) { |
|
|
|
|
browser |
|
|
|
|
.addFile('writeFile.js', { content: executeWriteFile }) |
|
|
|
@ -143,6 +162,14 @@ const executeWriteFile = ` |
|
|
|
|
run() |
|
|
|
|
` |
|
|
|
|
|
|
|
|
|
const executeWriteMultipleFiles = ` |
|
|
|
|
const run = async () => { |
|
|
|
|
await remix.call('fileManager', 'writeMultipleFiles', ['new_contract_1.sol', 'new_contract_2.sol', 'testing.txt'], ['pragma solidity ^0.6.0', 'pragma solidity ^0.80', 'test'], '/') |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
run() |
|
|
|
|
` |
|
|
|
|
|
|
|
|
|
const executeReadFile = ` |
|
|
|
|
const run = async () => { |
|
|
|
|
const result = await remix.call('fileManager', 'readFile', 'new_contract.sol') |
|
|
|
|