@ -5,6 +5,10 @@ import init from '../helpers/init'
const passphrase = 'explain uniform adapt basic blue onion rebel pull rice erase volcano couple'
const password = 'remix_is_cool'
const checkBrowserIsChrome = function ( browser : NightwatchBrowser ) {
return browser . browserName . indexOf ( 'chrome' ) > - 1
}
module .exports = {
'@disabled' : true ,
before : function ( browser : NightwatchBrowser , done : VoidFunction ) {
@ -16,6 +20,7 @@ module.exports = {
} ,
'Should connect to Sepolia Test Network using MetaMask #group1' : function ( browser : NightwatchBrowser ) {
if ( ! checkBrowserIsChrome ( browser ) ) return
browser . waitForElementPresent ( '*[data-id="remixIdeSidePanel"]' )
. setupMetamask ( passphrase , password )
. useCss ( ) . switchBrowserTab ( 0 )
@ -29,14 +34,19 @@ module.exports = {
. pause ( 5000 )
. switchBrowserWindow ( 'chrome-extension://mmejnnbljapjihcidiglpfkpnojpiamk/home.html' , 'MetaMask' , ( browser ) = > {
browser
. waitForElementVisible ( '*[data-testid="page-container-footer-next"]' )
. click ( '*[data-testid="page-container-footer-next"]' ) // this connects the metamask account to remix
. pause ( 2000 )
. waitForElementVisible ( '*[data-testid="page-container-footer-next"]' )
. click ( '*[data-testid="page-container-footer-next"]' )
. click ( '*[data-testid="popover-close"]' )
// .waitForElementVisible('*[data-testid="popover-close"]')
// .click('*[data-testid="popover-close"]')
} )
. switchBrowserTab ( 0 ) // back to remix
} ,
'Should add a contract file #group1' : function ( browser : NightwatchBrowser ) {
if ( ! checkBrowserIsChrome ( browser ) ) return
browser . waitForElementVisible ( '*[data-id="remixIdeSidePanel"]' )
. clickLaunchIcon ( 'filePanel' )
. addFile ( 'Greet.sol' , sources [ 0 ] [ 'Greet.sol' ] )
@ -45,7 +55,8 @@ module.exports = {
} ,
'Should deploy contract on Sepolia Test Network using MetaMask #group1' : function ( browser : NightwatchBrowser ) {
browser . clearConsole ( ) . waitForElementPresent ( '*[data-id="runTabSelectAccount"] option' )
if ( ! checkBrowserIsChrome ( browser ) ) return
browser . clearConsole ( ) . waitForElementPresent ( '*[data-id="runTabSelectAccount"] option' , 45000 )
. clickLaunchIcon ( 'filePanel' )
. openFile ( 'Greet.sol' )
. clickLaunchIcon ( 'udapp' )
@ -66,6 +77,7 @@ module.exports = {
} ,
'Should run low level interaction (fallback function) on Sepolia Test Network using MetaMask #group1' : function ( browser : NightwatchBrowser ) {
if ( ! checkBrowserIsChrome ( browser ) ) return
browser . clearConsole ( ) . waitForElementPresent ( '*[data-id="remixIdeSidePanel"]' )
. clickInstance ( 0 )
. waitForElementPresent ( '*[data-id="pluginManagerSettingsDeployAndRunLLTxSendTransaction"]' )
@ -84,6 +96,7 @@ module.exports = {
} ,
'Should connect to Ethereum Main Network using MetaMask #group1' : function ( browser : NightwatchBrowser ) {
if ( ! checkBrowserIsChrome ( browser ) ) return
browser . waitForElementPresent ( '*[data-id="remixIdeSidePanel"]' )
. switchBrowserTab ( 1 )
. click ( '[data-testid="network-display"]' )
@ -99,16 +112,17 @@ module.exports = {
} ,
'Should deploy contract on Ethereum Main Network using MetaMask #group1' : function ( browser : NightwatchBrowser ) {
if ( ! checkBrowserIsChrome ( browser ) ) return
browser . waitForElementPresent ( '*[data-id="runTabSelectAccount"] option' )
. clickLaunchIcon ( 'filePanel' )
. openFile ( 'Greet.sol' )
. clickLaunchIcon ( 'udapp' )
. waitForElementPresent ( '*[data-id="Deploy - transact (not payable)"]' )
. click ( '*[data-id="Deploy - transact (not payable)"]' )
. waitForElementPresent ( '*[data-id="modalDialogContainer"]' , 1 5000 )
. waitForElementVisible ( '*[data-id="udappNotifyModalDialogModalBody-react"]' , 6 5000 )
. modalFooterOKClick ( 'udappNotify' )
. pause ( 10000 )
. assert . containsText ( '*[data-id="modalDialogModalBody "]' , 'You are about to create a transaction on Main Network. Confirm the details to send the info to your provider.' )
. assert . containsText ( '*[data-id="udappNotifyModalDialogModalBody-react "]' , 'You are about to create a transaction on Main Network. Confirm the details to send the info to your provider.' )
. modalFooterCancelClick ( 'udappNotify' )
} ,
@ -120,7 +134,12 @@ module.exports = {
*
* /
'Should debug Sepolia transaction with source highlighting using the source verifier service and MetaMask #group1' : function ( browser : NightwatchBrowser ) {
if ( ! checkBrowserIsChrome ( browser ) ) return
browser . waitForElementPresent ( '*[data-id="remixIdeSidePanel"]' )
. switchBrowserTab ( 1 )
. click ( '[data-testid="network-display"]' )
. click ( 'div[data-testid="Sepolia"]' ) // switch to sepolia
. useCss ( ) . switchBrowserTab ( 0 )
. waitForElementVisible ( '*[data-id="remixIdeIconPanel"]' , 10000 )
. clickLaunchIcon ( 'pluginManager' ) // load debugger and source verification
// .scrollAndClick('#pluginManager article[id="remixPluginManagerListItem_sourcify"] button')
@ -138,6 +157,7 @@ module.exports = {
} ,
'Call web3.eth.getAccounts() using Injected Provider (Metamask) #group1' : function ( browser : NightwatchBrowser ) {
if ( ! checkBrowserIsChrome ( browser ) ) return
browser
. executeScriptInTerminal ( 'web3.eth.getAccounts()' )
. journalLastChildIncludes ( '[ "0x76a3ABb5a12dcd603B52Ed22195dED17ee82708f" ]' )