22import { NightwatchBrowser } from 'nightwatch'
33import init from '../helpers/init'
44
5+ const branch = process . env . CIRCLE_BRANCH ;
6+ const isMasterBranch = branch === 'master' ;
7+ const runMasterTests : boolean = ( branch ? ( isMasterBranch ? true : false ) : true )
8+
59module . exports = {
610 '@disabled' : true ,
711 before : function ( browser : NightwatchBrowser , done : VoidFunction ) {
@@ -209,26 +213,27 @@ module.exports = {
209213 } ,
210214
211215 'Should run a script which log transaction and block using web3.js and ethers #group7' : function ( browser : NightwatchBrowser ) {
212- browser
213- . clickLaunchIcon ( 'udapp' )
214- . switchEnvironment ( 'basic-http-provider' )
215- . waitForElementPresent ( '[data-id="basic-http-provider-modal-footer-ok-react"]' )
216- . execute ( ( ) => {
217- ( document . querySelector ( '*[data-id="basic-http-providerModalDialogContainer-react"] input[data-id="modalDialogCustomPromp"]' ) as any ) . focus ( )
218- } , [ ] , ( ) => { } )
219- . setValue ( '[data-id="modalDialogCustomPromp"]' , 'https://go.getblock.io/ee42d0a88f314707be11dd799b122cb9' )
220- . modalFooterOKClick ( 'basic-http-provider' )
221- . clickLaunchIcon ( 'filePanel' )
222- . openFile ( 'README.txt' )
223- . addFile ( 'scripts/log_tx_block.js' , { content : scriptBlockAndTransaction } )
224- . pause ( 1000 )
225- . executeScriptInTerminal ( 'remix.execute(\'scripts/log_tx_block.js\')' )
226- // check if the input of the transaction is being logged (web3 call)
227- . waitForElementContainsText ( '*[data-id="terminalJournal"]' , '0x2b0006fa00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004e9e0000000000000000000000000000000000000000000000000000000000004ea373ded44d6900b8b479935bee9c82176261653e334586e0fd282f569357c0777bd9d084474837ac94bf96f2e26590222a2b8e46545657c7cf06ce2833d267bd6f131b5b3fd36cb1ca3e07cf422224df0766d1a677bbdb7ee4cc0d634efa5367a302a94dac422a16b9b8d5c10fe0555924f8189f6b498bef507b1d32e7915bd4df184f51e6d79ae6a1b11d5745ce7d625cecc3bd0dc50af4f999ffb927225f5e5c019b499f5e1fdcbc70c45df61df76013d1b0d45cdf6a267dac1b4620c0db2efd251f6548509c9c69f5bd9d1ee38ac0df0c73be2774f7d2e1fb7ef5129010f29d091e3c48aed0f035fc29804c99927d33ff2a19ff526979355ac50b2542bc5d8f2d41e4f850d5981e0420807469e828b03173b96b757fbaeacda335e11b3ab8b02a48456fab35d41ca26abde751d5fca8ef5e7ba5295278b6e46ce2aab6c10b3d185a6137d3e5c28bb8dd3a797feaf35520fcb949ea074e1869e0011ef01f8162135e44bb797d3d6215ff74ffbee972c97264fc15d11c840e6a7e796dc1a418572f6dbcc842594a558e1a9e3cb7a159284e16fec758bbc303d13edc28fb6d8bb110c3a398e4ded1748da9854eb84679ad0c99bc59bea7956b521db3ed0a9057510cc11365858704989690f0d891af81b213b1f2e91e41e4998a467656eac87e7025ac2840c17f2b106df7d32a0139036bdf5d87344ca37e9ce770e0dbeb5e021d03a7d496a6695eb06d3de9258b43f3883ce155767962b52083504b19d6d609090a2f96e9724902bf1adbf57359ac1dda48a8ffe596b8d95cac1429378769a6ec2ff1c8a9c0bc343b0a6468f36696bfb202cde9f6cd5241b814096d777751b44f0cc2ac9e7ba142227e8d5f2dd8da62573953540da1abce82c59287b2f7a87a111851758c2505d8c1ded6c42a49fc5577451ee56126d2275da490baa645c3bcac0c31dabee7aa35e6cdffb56ac0d952c2583c6f50f906dfb96f5a98c49a5919031cff880bffbe371a50162a7bd0fa0398a5898eaf6ad6db868a7d807846a3592325bb4207d67ad96bac76435368962ba8944d0201c2f620fb29373a6f35c815d101af98111e9b4cc61e8ae77fc63ce375068328ec8d05b49486666fb0f756f99d2fe747c95b2a553965f304a324879393897315d310841f0a200cd156f6ca4ed2' , 120000 )
228- // check if the logsBloom is being logged (web3 call)
229- . waitForElementContainsText ( '*[data-id="terminalJournal"]' , '0x0fbbd94c448fe6949f848380a1d145a974f386624b4b10aa40f9afb212b3ddeb' , 120000 ) // hash of 4757766
230- // check if the logsBloom is being logged (ethers.js call)
231- . waitForElementContainsText ( '*[data-id="terminalJournal"]' , '0x9db899cb75888a630ba50a1644c243b83d2eb38525eb828a06a5e8bb5663c0b0' , 120000 ) // hash of 4757767
216+ if ( runMasterTests )
217+ browser
218+ . clickLaunchIcon ( 'udapp' )
219+ . switchEnvironment ( 'basic-http-provider' )
220+ . waitForElementPresent ( '[data-id="basic-http-provider-modal-footer-ok-react"]' )
221+ . execute ( ( ) => {
222+ ( document . querySelector ( '*[data-id="basic-http-providerModalDialogContainer-react"] input[data-id="modalDialogCustomPromp"]' ) as any ) . focus ( )
223+ } , [ ] , ( ) => { } )
224+ . setValue ( '[data-id="modalDialogCustomPromp"]' , 'https://go.getblock.io/ee42d0a88f314707be11dd799b122cb9' )
225+ . modalFooterOKClick ( 'basic-http-provider' )
226+ . clickLaunchIcon ( 'filePanel' )
227+ . openFile ( 'README.txt' )
228+ . addFile ( 'scripts/log_tx_block.js' , { content : scriptBlockAndTransaction } )
229+ . pause ( 1000 )
230+ . executeScriptInTerminal ( 'remix.execute(\'scripts/log_tx_block.js\')' )
231+ // check if the input of the transaction is being logged (web3 call)
232+ . waitForElementContainsText ( '*[data-id="terminalJournal"]' , '0x2b0006fa00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004e9e0000000000000000000000000000000000000000000000000000000000004ea373ded44d6900b8b479935bee9c82176261653e334586e0fd282f569357c0777bd9d084474837ac94bf96f2e26590222a2b8e46545657c7cf06ce2833d267bd6f131b5b3fd36cb1ca3e07cf422224df0766d1a677bbdb7ee4cc0d634efa5367a302a94dac422a16b9b8d5c10fe0555924f8189f6b498bef507b1d32e7915bd4df184f51e6d79ae6a1b11d5745ce7d625cecc3bd0dc50af4f999ffb927225f5e5c019b499f5e1fdcbc70c45df61df76013d1b0d45cdf6a267dac1b4620c0db2efd251f6548509c9c69f5bd9d1ee38ac0df0c73be2774f7d2e1fb7ef5129010f29d091e3c48aed0f035fc29804c99927d33ff2a19ff526979355ac50b2542bc5d8f2d41e4f850d5981e0420807469e828b03173b96b757fbaeacda335e11b3ab8b02a48456fab35d41ca26abde751d5fca8ef5e7ba5295278b6e46ce2aab6c10b3d185a6137d3e5c28bb8dd3a797feaf35520fcb949ea074e1869e0011ef01f8162135e44bb797d3d6215ff74ffbee972c97264fc15d11c840e6a7e796dc1a418572f6dbcc842594a558e1a9e3cb7a159284e16fec758bbc303d13edc28fb6d8bb110c3a398e4ded1748da9854eb84679ad0c99bc59bea7956b521db3ed0a9057510cc11365858704989690f0d891af81b213b1f2e91e41e4998a467656eac87e7025ac2840c17f2b106df7d32a0139036bdf5d87344ca37e9ce770e0dbeb5e021d03a7d496a6695eb06d3de9258b43f3883ce155767962b52083504b19d6d609090a2f96e9724902bf1adbf57359ac1dda48a8ffe596b8d95cac1429378769a6ec2ff1c8a9c0bc343b0a6468f36696bfb202cde9f6cd5241b814096d777751b44f0cc2ac9e7ba142227e8d5f2dd8da62573953540da1abce82c59287b2f7a87a111851758c2505d8c1ded6c42a49fc5577451ee56126d2275da490baa645c3bcac0c31dabee7aa35e6cdffb56ac0d952c2583c6f50f906dfb96f5a98c49a5919031cff880bffbe371a50162a7bd0fa0398a5898eaf6ad6db868a7d807846a3592325bb4207d67ad96bac76435368962ba8944d0201c2f620fb29373a6f35c815d101af98111e9b4cc61e8ae77fc63ce375068328ec8d05b49486666fb0f756f99d2fe747c95b2a553965f304a324879393897315d310841f0a200cd156f6ca4ed2' , 120000 )
233+ // check if the logsBloom is being logged (web3 call)
234+ . waitForElementContainsText ( '*[data-id="terminalJournal"]' , '0x0fbbd94c448fe6949f848380a1d145a974f386624b4b10aa40f9afb212b3ddeb' , 120000 ) // hash of 4757766
235+ // check if the logsBloom is being logged (ethers.js call)
236+ . waitForElementContainsText ( '*[data-id="terminalJournal"]' , '0x9db899cb75888a630ba50a1644c243b83d2eb38525eb828a06a5e8bb5663c0b0' , 120000 ) // hash of 4757767
232237 } ,
233238
234239 'Should listen on all transactions #group8' : function ( browser : NightwatchBrowser ) {
@@ -291,46 +296,48 @@ module.exports = {
291296 } ,
292297
293298 'Should connect to mainnet fork and run web3.eth.getCode in the terminal #group9' : function ( browser : NightwatchBrowser ) {
294- browser
295- . clickLaunchIcon ( 'udapp' )
296- . switchEnvironment ( 'vm-mainnet-fork' )
297- . waitForElementPresent ( {
298- locateStrategy : 'css selector' ,
299- selector : 'select[data-id="runTabSelectAccount"] option[value="0xdD870fA1b7C4700F2BD7f44238821C26f7392148"]' ,
300- timeout : 240000
301- } )
302- . executeScriptInTerminal ( `web3.eth.getCode('0x180587b00c8642e2c7ac3a758712d97e6f7bdcc7')` ) // mainnet contract
303- . waitForElementContainsText ( '*[data-id="terminalJournal"]' , '0x608060405260043610601f5760003560e01c80635c60da1b14603157602b565b36602b576029605f565b005b6029605f565b348015603c57600080fd5b5060436097565b6040516001600160a01b03909116815260200160405180910390f35b609560917f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b60d1565b565b600060c97f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b905090565b90565b3660008037600080366000845af43d6000803e80801560ef573d6000f35b3d6000fdfea2646970667358221220969dbb4b1d8aec2bb348e26488dc1a33b6bcf0190f567d161312ab7ca9193d8d64736f6c63430008110033' , 120000 )
304- . click ( '*[data-id="terminalClearConsole"]' )
299+ if ( runMasterTests )
300+ browser
301+ . clickLaunchIcon ( 'udapp' )
302+ . switchEnvironment ( 'vm-mainnet-fork' )
303+ . waitForElementPresent ( {
304+ locateStrategy : 'css selector' ,
305+ selector : 'select[data-id="runTabSelectAccount"] option[value="0xdD870fA1b7C4700F2BD7f44238821C26f7392148"]' ,
306+ timeout : 240000
307+ } )
308+ . executeScriptInTerminal ( `web3.eth.getCode('0x180587b00c8642e2c7ac3a758712d97e6f7bdcc7')` ) // mainnet contract
309+ . waitForElementContainsText ( '*[data-id="terminalJournal"]' , '0x608060405260043610601f5760003560e01c80635c60da1b14603157602b565b36602b576029605f565b005b6029605f565b348015603c57600080fd5b5060436097565b6040516001600160a01b03909116815260200160405180910390f35b609560917f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b60d1565b565b600060c97f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b905090565b90565b3660008037600080366000845af43d6000803e80801560ef573d6000f35b3d6000fdfea2646970667358221220969dbb4b1d8aec2bb348e26488dc1a33b6bcf0190f567d161312ab7ca9193d8d64736f6c63430008110033' , 120000 )
310+ . click ( '*[data-id="terminalClearConsole"]' )
305311 } ,
306312
307313 'Should connect to the sepolia fork and run web3.eth.getCode in the terminal #group9' : function ( browser : NightwatchBrowser ) {
308- browser
309- . switchEnvironment ( 'vm-custom-fork' )
310- . waitForElementVisible ( '[data-id="vm-custom-fork-modal-footer-ok-react"]' )
311- . execute ( ( ) => {
312- ( document . querySelector ( '*[data-id="vm-custom-forkModalDialogContainer-react"] input[data-id="CustomForkNodeUrl"]' ) as any ) . focus ( )
313- } , [ ] , ( ) => { } )
314- . clearValue ( '*[data-id="CustomForkNodeUrl"]' ) . pause ( 1000 ) . setValue ( '*[data-id="CustomForkNodeUrl"]' , 'https://go.getblock.io/ee42d0a88f314707be11dd799b122cb9' )
315- . execute ( ( ) => {
316- ( document . querySelector ( '*[data-id="vm-custom-forkModalDialogContainer-react"] input[data-id="CustomForkBlockNumber"]' ) as any ) . focus ( )
317- } , [ ] , ( ) => { } )
318- . clearValue ( '*[data-id="CustomForkBlockNumber"]' ) . setValue ( '*[data-id="CustomForkBlockNumber"]' , 'latest' )
319- . execute ( ( ) => {
320- ( document . querySelector ( '*[data-id="vm-custom-forkModalDialogContainer-react"] input[data-id="CustomForkEvmType"]' ) as any ) . focus ( )
321- } , [ ] , ( ) => { } )
322- . click ( '*[data-id="CustomForkEvmType"] [value="cancun"]' )
323- . pause ( 5000 )
324- . modalFooterOKClick ( 'vm-custom-fork' )
325- . waitForElementPresent ( {
326- locateStrategy : 'css selector' ,
327- selector : 'select[data-id="runTabSelectAccount"] option[value="0xdD870fA1b7C4700F2BD7f44238821C26f7392148"]' ,
328- timeout : 240000
329- } )
330- . pause ( 5000 )
331- . executeScriptInTerminal ( `web3.eth.getCode('0x75F509A4eDA030470272DfBAf99A47D587E76709')` ) // sepolia contract
332- . waitForElementContainsText ( '*[data-id="terminalJournal"]' , byteCodeInSepolia , 120000 )
333- . click ( '*[data-id="terminalClearConsole"]' )
314+ if ( runMasterTests )
315+ browser
316+ . switchEnvironment ( 'vm-custom-fork' )
317+ . waitForElementVisible ( '[data-id="vm-custom-fork-modal-footer-ok-react"]' )
318+ . execute ( ( ) => {
319+ ( document . querySelector ( '*[data-id="vm-custom-forkModalDialogContainer-react"] input[data-id="CustomForkNodeUrl"]' ) as any ) . focus ( )
320+ } , [ ] , ( ) => { } )
321+ . clearValue ( '*[data-id="CustomForkNodeUrl"]' ) . pause ( 1000 ) . setValue ( '*[data-id="CustomForkNodeUrl"]' , 'https://go.getblock.io/ee42d0a88f314707be11dd799b122cb9' )
322+ . execute ( ( ) => {
323+ ( document . querySelector ( '*[data-id="vm-custom-forkModalDialogContainer-react"] input[data-id="CustomForkBlockNumber"]' ) as any ) . focus ( )
324+ } , [ ] , ( ) => { } )
325+ . clearValue ( '*[data-id="CustomForkBlockNumber"]' ) . setValue ( '*[data-id="CustomForkBlockNumber"]' , 'latest' )
326+ . execute ( ( ) => {
327+ ( document . querySelector ( '*[data-id="vm-custom-forkModalDialogContainer-react"] input[data-id="CustomForkEvmType"]' ) as any ) . focus ( )
328+ } , [ ] , ( ) => { } )
329+ . click ( '*[data-id="CustomForkEvmType"] [value="cancun"]' )
330+ . pause ( 5000 )
331+ . modalFooterOKClick ( 'vm-custom-fork' )
332+ . waitForElementPresent ( {
333+ locateStrategy : 'css selector' ,
334+ selector : 'select[data-id="runTabSelectAccount"] option[value="0xdD870fA1b7C4700F2BD7f44238821C26f7392148"]' ,
335+ timeout : 240000
336+ } )
337+ . pause ( 5000 )
338+ . executeScriptInTerminal ( `web3.eth.getCode('0x75F509A4eDA030470272DfBAf99A47D587E76709')` ) // sepolia contract
339+ . waitForElementContainsText ( '*[data-id="terminalJournal"]' , byteCodeInSepolia , 120000 )
340+ . click ( '*[data-id="terminalClearConsole"]' )
334341 } ,
335342
336343 'Should run a free function while being connected to mainnet #group9' : function ( browser : NightwatchBrowser ) {
@@ -354,29 +361,31 @@ module.exports = {
354361 console.log(resolver.addr(node));
355362 }
356363 `
357- browser
358- // .clickLaunchIcon('udapp')
359- . switchEnvironment ( 'vm-mainnet-fork' )
360- . clickLaunchIcon ( 'filePanel' )
361- . addFile ( 'test_mainnet.sol' , { content : script } )
362-
363- const path = "//*[@class='view-line' and contains(.,'resolveENS') and contains(.,'view')]//span//span[contains(.,'(')]"
364- const pathRunFunction = `//li//*[@aria-label='Run the free function "resolveENS"']`
365- browser . waitForElementVisible ( '#editorView' )
366- //.waitForElementPresent(pathRunFunction)
367- . pause ( 10000 ) // the parser need to parse the code
368- . useXpath ( )
369- . scrollToLine ( 16 )
370- . click ( path )
371- . perform ( function ( ) {
372- const actions = this . actions ( { async : true } ) ;
373- return actions
374- . keyDown ( this . Keys . SHIFT )
375- . keyDown ( this . Keys . ALT )
376- . sendKeys ( 'r' )
377- } )
378- . useCss ( )
379- . waitForElementContainsText ( '*[data-id="terminalJournal"]' , '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045' , 120000 )
364+ if ( runMasterTests ) {
365+ browser
366+ // .clickLaunchIcon('udapp')
367+ . switchEnvironment ( 'vm-mainnet-fork' )
368+ . clickLaunchIcon ( 'filePanel' )
369+ . addFile ( 'test_mainnet.sol' , { content : script } )
370+
371+ const path = "//*[@class='view-line' and contains(.,'resolveENS') and contains(.,'view')]//span//span[contains(.,'(')]"
372+ const pathRunFunction = `//li//*[@aria-label='Run the free function "resolveENS"']`
373+ browser . waitForElementVisible ( '#editorView' )
374+ //.waitForElementPresent(pathRunFunction)
375+ . pause ( 10000 ) // the parser need to parse the code
376+ . useXpath ( )
377+ . scrollToLine ( 16 )
378+ . click ( path )
379+ . perform ( function ( ) {
380+ const actions = this . actions ( { async : true } ) ;
381+ return actions
382+ . keyDown ( this . Keys . SHIFT )
383+ . keyDown ( this . Keys . ALT )
384+ . sendKeys ( 'r' )
385+ } )
386+ . useCss ( )
387+ . waitForElementContainsText ( '*[data-id="terminalJournal"]' , '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045' , 120000 )
388+ }
380389 } ,
381390
382391 'Should run free function which logs in the terminal #group10' : function ( browser : NightwatchBrowser ) {
0 commit comments