|
|
|
@ -115,6 +115,34 @@ module.exports = { |
|
|
|
|
.verifyContracts(['test13', 'ERC20'], { wait: 30000 }) |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
'Test NPM Import (with unpkg.com) and the package.json contains a module remapping #group3': function (browser: NightwatchBrowser) { |
|
|
|
|
browser |
|
|
|
|
.setSolidityCompilerVersion('soljson-v0.8.7+commit.e28d00a7.js') |
|
|
|
|
.waitForElementPresent({ |
|
|
|
|
selector: `//*[@data-id='compilerloaded' and @data-version='soljson-v0.8.7+commit.e28d00a7.js']`, |
|
|
|
|
locateStrategy: 'xpath', |
|
|
|
|
timeout: 120000 |
|
|
|
|
}) |
|
|
|
|
.clickLaunchIcon('filePanel') |
|
|
|
|
.click('li[data-id="treeViewLitreeViewItemREADME.txt"') |
|
|
|
|
.addFile('package.json', sources[9]['package.json']) |
|
|
|
|
.addFile('Untitled10.sol', sources[9]['Untitled10.sol'])
|
|
|
|
|
// avoid invalid source issues
|
|
|
|
|
.isVisible({ |
|
|
|
|
selector: '*[data-id="treeViewLitreeViewItem.deps/npm/@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol"]', |
|
|
|
|
timeout: 120000, |
|
|
|
|
suppressNotFoundErrors: true |
|
|
|
|
}) |
|
|
|
|
.clickLaunchIcon('solidity') |
|
|
|
|
.click('[data-id="compilerContainerCompileBtn"]') |
|
|
|
|
.clickLaunchIcon('filePanel') |
|
|
|
|
.isVisible({ |
|
|
|
|
selector: '*[data-id="treeViewLitreeViewItem.deps/npm/@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol"]', |
|
|
|
|
timeout: 120000, |
|
|
|
|
}) |
|
|
|
|
.verifyContracts(['test15', 'ERC20'], { wait: 30000 }) |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
'Test NPM Import (the version is specified in package.json) #group4': function (browser: NightwatchBrowser) { |
|
|
|
|
browser |
|
|
|
|
// clone https://github.com/yann300/remix-reward
|
|
|
|
@ -168,5 +196,11 @@ const sources = [ |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
'Untitled9.sol': { content: 'pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; contract test13 {}' } |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
'Untitled10.sol': { content: 'pragma solidity ^0.8.0; import "@module_remapping/token/ERC20/ERC20.sol"; contract test15 {}' }, |
|
|
|
|
'package.json': { content: `"dependencies": {
|
|
|
|
|
"@module_remapping": "npm:@openzeppelin/contracts@^4.9.0" |
|
|
|
|
},` }
|
|
|
|
|
} |
|
|
|
|
] |
|
|
|
|