|
|
|
@ -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', |
|
|
|
@ -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
|
|
|
|
|
}, |
|
|
|
@ -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
|
|
|
|
@ -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
|
|
|
|
@ -200,10 +202,10 @@ 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) |
|
|
|
|
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,15 +215,15 @@ 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()) |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
}, |
|
|
|
@ -252,7 +254,7 @@ const sources = [ |
|
|
|
|
{ |
|
|
|
|
'Greet.sol': { |
|
|
|
|
content: |
|
|
|
|
` |
|
|
|
|
` |
|
|
|
|
pragma solidity ^0.8.0; |
|
|
|
|
contract HelloWorld { |
|
|
|
|
string public message; |
|
|
|
|