add e2e tests

exposeHandleImport
yann300 4 years ago
parent 65dfed3e42
commit 90caf16781
  1. 26
      apps/remix-ide-e2e/src/tests/terminal.test.ts

@ -91,6 +91,7 @@ module.exports = {
.executeScript(`remix.execute('browser/resolveExternalUrlAndSave.js')`)
.pause(6000)
.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) {
@ -101,7 +102,19 @@ module.exports = {
.pause(1000)
.executeScript(`remix.execute('browser/resolveUrl.js')`)
.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()
},
@ -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 = `
(async () => {
try {

Loading…
Cancel
Save