Commit 90caf167 authored by yann300's avatar yann300

add e2e tests

parent 65dfed3e
...@@ -91,6 +91,7 @@ module.exports = { ...@@ -91,6 +91,7 @@ module.exports = {
.executeScript(`remix.execute('browser/resolveExternalUrlAndSave.js')`) .executeScript(`remix.execute('browser/resolveExternalUrlAndSave.js')`)
.pause(6000) .pause(6000)
.journalLastChildIncludes('Implementation of the {IERC20} interface.') .journalLastChildIncludes('Implementation of the {IERC20} interface.')
.openFile('browser/github/OpenZeppelin/openzeppelin-contracts/contracts/token/ERC20/ERC20.sol')
}, },
'Call Remix File Resolver (internal URL) from a script': function (browser: NightwatchBrowser) { 'Call Remix File Resolver (internal URL) from a script': function (browser: NightwatchBrowser) {
...@@ -101,7 +102,19 @@ module.exports = { ...@@ -101,7 +102,19 @@ module.exports = {
.pause(1000) .pause(1000)
.executeScript(`remix.execute('browser/resolveUrl.js')`) .executeScript(`remix.execute('browser/resolveUrl.js')`)
.pause(6000) .pause(6000)
.journalLastChildIncludes('contract Ballot {') .journalLastChildIncludes('contract Ballot {')
},
'Call Remix File Resolver (internal URL) from a script and specify a path': function (browser: NightwatchBrowser) {
browser
.click('*[data-id="terminalClearConsole"]') // clear the terminal
.addFile('resolveExternalUrlAndSaveToaPath.js', { content: resolveExternalUrlAndSaveToaPath })
.openFile('browser/resolveExternalUrlAndSaveToaPath.js')
.pause(1000)
.executeScript(`remix.execute('browser/resolveExternalUrlAndSaveToaPath.js')`)
.pause(6000)
.journalLastChildIncludes('abstract contract ERC20Burnable')
.openFile('browser/github/newFile.sol')
.end() .end()
}, },
...@@ -157,6 +170,17 @@ const resolveExternalUrlAndSave = ` ...@@ -157,6 +170,17 @@ const resolveExternalUrlAndSave = `
})() })()
` `
const resolveExternalUrlAndSaveToaPath = `
(async () => {
try {
console.log('start')
console.log(await remix.call('contentImport', 'resolveAndSave', 'https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC20/ERC20Burnable.sol', 'github/newFile.sol'))
} catch (e) {
console.log(e.message)
}
})()
`
const resolveUrl = ` const resolveUrl = `
(async () => { (async () => {
try { try {
......
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