@@ -147,6 +147,24 @@ module.exports = {
147
147
. verifyContracts ( [ 'test15' , 'ERC20' ] , { wait : 30000 } )
148
148
} ,
149
149
150
+ 'Test NPM Import (prefixed by `npm:` and remappings.txt), it should import from two different solidity version #group3' : function ( browser : NightwatchBrowser ) {
151
+ browser
152
+ . setSolidityCompilerVersion ( 'soljson-v0.8.30+commit.73712a01.js' )
153
+ . waitForElementPresent ( {
154
+ selector : `//*[@data-id='compilerloaded' and @data-version='soljson-v0.8.30+commit.73712a01.js']` ,
155
+ locateStrategy : 'xpath' ,
156
+ timeout : 120000
157
+ } )
158
+ . clickLaunchIcon ( 'filePanel' )
159
+ . click ( 'li[data-id="treeViewLitreeViewItemREADME.txt"' )
160
+ . addFile ( 'remappings.txt' , sources [ 10 ] [ 'remappings.txt' ] )
161
+ . addFile ( 'Untitled11.sol' , sources [ 10 ] [ 'Untitled11.sol' ] )
162
+ . clickLaunchIcon ( 'solidity' )
163
+ . click ( '[data-id="compilerContainerCompileBtn"]' )
164
+ . clickLaunchIcon ( 'filePanel' )
165
+ . verifyContracts ( [ 'Address' , 'Strings' ] , { wait : 30000 } )
166
+ } ,
167
+
150
168
'Test NPM Import (the version is specified in package.json) #group4' : function ( browser : NightwatchBrowser ) {
151
169
browser
152
170
// clone https://github.com/yann300/remix-reward
@@ -208,5 +226,15 @@ const sources = [
208
226
"@module_remapping": "npm:@openzeppelin/contracts@^4.9.0"
209
227
}
210
228
}` }
229
+ } ,
230
+ {
231
+ 'Untitled11.sol' : { content : `import "@openzeppelin/contracts@5.0.2/utils/Strings.sol";
232
+ import "@openzeppelin/contracts@4.7.3/utils/Address.sol";` } ,
233
+ 'remappings.txt' : { content : `@openzeppelin/contracts@4.7.3/=npm:@openzeppelin/contracts@4.7.3/
234
+ @openzeppelin/contracts@4.8.3/=npm:@openzeppelin/contracts@4.8.3/
235
+ @openzeppelin/contracts@4.9.6/=npm:@openzeppelin/contracts@4.9.6/
236
+ @openzeppelin/contracts@5.0.2/=npm:@openzeppelin/contracts@5.0.2/
237
+ @openzeppelin/contracts@5.1.0/=npm:@openzeppelin/contracts@5.1.0/
238
+ ` }
211
239
}
212
240
]
0 commit comments