|
|
|
@ -11,7 +11,7 @@ const checkBrowserIsChrome = function (browser: NightwatchBrowser) { |
|
|
|
|
return browser.browserName.indexOf('chrome') > -1 |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const checkAlerts = function (browser: NightwatchBrowser){ |
|
|
|
|
const checkAlerts = function (browser: NightwatchBrowser) { |
|
|
|
|
browser.isVisible({ |
|
|
|
|
selector: '//*[contains(.,"not have enough")]', |
|
|
|
|
locateStrategy: 'xpath', |
|
|
|
@ -38,7 +38,7 @@ const tests = { |
|
|
|
|
'Should connect to Sepolia Test Network using MetaMask #group1 #flaky': function (browser: NightwatchBrowser) { |
|
|
|
|
if (!checkBrowserIsChrome(browser)) return |
|
|
|
|
browser.waitForElementPresent('*[data-id="remixIdeSidePanel"]') |
|
|
|
|
.setupMetamask(passphrase, password)
|
|
|
|
|
.setupMetamask(passphrase, password) |
|
|
|
|
.useCss().switchBrowserTab(0) |
|
|
|
|
.refreshPage() |
|
|
|
|
.waitForElementVisible('*[data-id="remixIdeIconPanel"]', 10000) |
|
|
|
@ -55,8 +55,8 @@ const tests = { |
|
|
|
|
.pause(2000) |
|
|
|
|
.waitForElementVisible('*[data-testid="page-container-footer-next"]', 60000) |
|
|
|
|
.click('*[data-testid="page-container-footer-next"]') |
|
|
|
|
// .waitForElementVisible('*[data-testid="popover-close"]')
|
|
|
|
|
// .click('*[data-testid="popover-close"]')
|
|
|
|
|
// .waitForElementVisible('*[data-testid="popover-close"]')
|
|
|
|
|
// .click('*[data-testid="popover-close"]')
|
|
|
|
|
}) |
|
|
|
|
.switchBrowserTab(0) // back to remix
|
|
|
|
|
}, |
|
|
|
@ -90,7 +90,7 @@ const tests = { |
|
|
|
|
.waitForElementContainsText('*[data-id="terminalJournal"]', 'from: 0x76a...2708f', 60000) |
|
|
|
|
.perform(() => done()) |
|
|
|
|
}) |
|
|
|
|
})
|
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
'Should run low level interaction (fallback function) on Sepolia Test Network using MetaMask #group1': function (browser: NightwatchBrowser) { |
|
|
|
@ -108,8 +108,8 @@ const tests = { |
|
|
|
|
.waitForElementContainsText('*[data-id="terminalJournal"]', 'view on etherscan', 60000) |
|
|
|
|
.waitForElementContainsText('*[data-id="terminalJournal"]', 'from: 0x76a...2708f', 60000) |
|
|
|
|
.perform(() => done()) |
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
'Should connect to Ethereum Main Network using MetaMask #group1': function (browser: NightwatchBrowser) { |
|
|
|
@ -162,6 +162,7 @@ const tests = { |
|
|
|
|
.perform((done) => { |
|
|
|
|
browser.switchBrowserWindow(extension_url, 'MetaMask', (browser) => { |
|
|
|
|
browser |
|
|
|
|
.saveScreenshot('./reports/screenshots/metamask_4.png') |
|
|
|
|
.waitForElementPresent('[data-testid="page-container-footer-next"]', 60000) |
|
|
|
|
.click('[data-testid="page-container-footer-next"]') // approve the tx
|
|
|
|
|
.switchBrowserTab(0) // back to remix
|
|
|
|
@ -169,7 +170,7 @@ const tests = { |
|
|
|
|
.waitForElementContainsText('*[data-id="terminalJournal"]', 'from: 0x76a...2708f', 60000) |
|
|
|
|
.perform(() => done()) |
|
|
|
|
}) |
|
|
|
|
})
|
|
|
|
|
}) |
|
|
|
|
.waitForElementPresent('*[data-id="universalDappUiContractActionWrapper"]', 60000) |
|
|
|
|
.clearConsole() |
|
|
|
|
.clickInstance(0) |
|
|
|
@ -177,6 +178,7 @@ const tests = { |
|
|
|
|
.perform((done) => { // call delegate
|
|
|
|
|
browser.switchBrowserWindow(extension_url, 'MetaMask', (browser) => { |
|
|
|
|
browser |
|
|
|
|
.saveScreenshot('./reports/screenshots/metamask_5.png') |
|
|
|
|
.waitForElementPresent('[data-testid="page-container-footer-next"]', 60000) |
|
|
|
|
.click('[data-testid="page-container-footer-next"]') // approve the tx
|
|
|
|
|
.switchBrowserTab(0) // back to remix
|
|
|
|
@ -199,11 +201,11 @@ const tests = { |
|
|
|
|
*/ |
|
|
|
|
'Should debug Sepolia transaction with source highlighting MetaMask #group1': function (browser: NightwatchBrowser) { |
|
|
|
|
if (!checkBrowserIsChrome(browser)) return |
|
|
|
|
let txhash
|
|
|
|
|
browser.waitForElementVisible('*[data-id="remixIdeIconPanel"]', 10000) |
|
|
|
|
let txhash |
|
|
|
|
browser.waitForElementVisible('*[data-id="remixIdeIconPanel"]', 10000) |
|
|
|
|
.clickLaunchIcon('pluginManager') // load debugger and source verification
|
|
|
|
|
// .scrollAndClick('#pluginManager article[id="remixPluginManagerListItem_sourcify"] button')
|
|
|
|
|
// debugger already activated .scrollAndClick('#pluginManager article[id="remixPluginManagerListItem_debugger"] button')
|
|
|
|
|
// .scrollAndClick('#pluginManager article[id="remixPluginManagerListItem_sourcify"] button')
|
|
|
|
|
// debugger already activated .scrollAndClick('#pluginManager article[id="remixPluginManagerListItem_debugger"] button')
|
|
|
|
|
.clickLaunchIcon('udapp') |
|
|
|
|
.perform((done) => { |
|
|
|
|
browser.getLastTransactionHash((hash) => { |
|
|
|
@ -213,17 +215,17 @@ const tests = { |
|
|
|
|
}) |
|
|
|
|
.perform((done) => { |
|
|
|
|
browser |
|
|
|
|
.waitForElementVisible('*[data-id="remixIdeIconPanel"]', 10000) |
|
|
|
|
.clickLaunchIcon('debugger') |
|
|
|
|
.setValue('*[data-id="debuggerTransactionInput"]', txhash) // debug tx
|
|
|
|
|
.saveScreenshot('./reports/screenshot/metamask_2.png') |
|
|
|
|
.click('*[data-id="debuggerTransactionStartButton"]') |
|
|
|
|
.saveScreenshot('./reports/screenshot/metamask_3.png') |
|
|
|
|
.waitForElementVisible('*[data-id="treeViewDivto"]', 30000) |
|
|
|
|
.checkVariableDebug('soliditylocals', localsCheck) |
|
|
|
|
.perform(() => done()) |
|
|
|
|
.waitForElementVisible('*[data-id="remixIdeIconPanel"]', 10000) |
|
|
|
|
.clickLaunchIcon('debugger') |
|
|
|
|
.setValue('*[data-id="debuggerTransactionInput"]', txhash) // debug tx
|
|
|
|
|
.saveScreenshot('./reports/screenshots/metamask_2.png') |
|
|
|
|
.click('*[data-id="debuggerTransactionStartButton"]') |
|
|
|
|
.saveScreenshot('./reports/screenshots/metamask_3.png') |
|
|
|
|
.waitForElementVisible('*[data-id="treeViewDivto"]', 30000) |
|
|
|
|
.checkVariableDebug('soliditylocals', localsCheck) |
|
|
|
|
.perform(() => done()) |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
'Call web3.eth.getAccounts() using Injected Provider (Metamask) #group1': function (browser: NightwatchBrowser) { |
|
|
|
@ -231,7 +233,7 @@ const tests = { |
|
|
|
|
browser |
|
|
|
|
.executeScriptInTerminal('web3.eth.getAccounts()') |
|
|
|
|
.journalLastChildIncludes('["0x76a3ABb5a12dcd603B52Ed22195dED17ee82708f"]') |
|
|
|
|
}
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const branch = process.env.CIRCLE_BRANCH; |
|
|
|
@ -252,7 +254,7 @@ const sources = [ |
|
|
|
|
{ |
|
|
|
|
'Greet.sol': { |
|
|
|
|
content: |
|
|
|
|
` |
|
|
|
|
` |
|
|
|
|
pragma solidity ^0.8.0; |
|
|
|
|
contract HelloWorld { |
|
|
|
|
string public message; |
|
|
|
|