|
|
|
@ -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', |
|
|
|
@ -50,6 +50,7 @@ const tests = { |
|
|
|
|
.pause(5000) |
|
|
|
|
.switchBrowserWindow(extension_url, 'MetaMask', (browser) => { |
|
|
|
|
browser |
|
|
|
|
.hideMetaMaskPopup() |
|
|
|
|
.waitForElementVisible('*[data-testid="page-container-footer-next"]', 60000) |
|
|
|
|
.click('*[data-testid="page-container-footer-next"]') // this connects the metamask account to remix
|
|
|
|
|
.pause(2000) |
|
|
|
@ -83,6 +84,7 @@ const tests = { |
|
|
|
|
browser.switchBrowserWindow(extension_url, 'MetaMask', (browser) => { |
|
|
|
|
checkAlerts(browser) |
|
|
|
|
browser |
|
|
|
|
.hideMetaMaskPopup() |
|
|
|
|
.waitForElementPresent('[data-testid="page-container-footer-next"]') |
|
|
|
|
.click('[data-testid="page-container-footer-next"]') // approve the tx
|
|
|
|
|
.switchBrowserTab(0) // back to remix
|
|
|
|
@ -102,6 +104,7 @@ const tests = { |
|
|
|
|
.perform((done) => { |
|
|
|
|
browser.switchBrowserWindow(extension_url, 'MetaMask', (browser) => { |
|
|
|
|
browser |
|
|
|
|
.hideMetaMaskPopup() |
|
|
|
|
.waitForElementPresent('[data-testid="page-container-footer-next"]') |
|
|
|
|
.click('[data-testid="page-container-footer-next"]') // approve the tx
|
|
|
|
|
.switchBrowserTab(0) // back to remix
|
|
|
|
@ -162,6 +165,8 @@ const tests = { |
|
|
|
|
.perform((done) => { |
|
|
|
|
browser.switchBrowserWindow(extension_url, 'MetaMask', (browser) => { |
|
|
|
|
browser |
|
|
|
|
.hideMetaMaskPopup() |
|
|
|
|
.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 +182,8 @@ const tests = { |
|
|
|
|
.perform((done) => { // call delegate
|
|
|
|
|
browser.switchBrowserWindow(extension_url, 'MetaMask', (browser) => { |
|
|
|
|
browser |
|
|
|
|
.hideMetaMaskPopup() |
|
|
|
|
.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
|
|
|
|
@ -216,7 +223,9 @@ const tests = { |
|
|
|
|
.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()) |
|
|
|
@ -236,7 +245,7 @@ const branch = process.env.CIRCLE_BRANCH; |
|
|
|
|
const isMasterBranch = branch === 'master'; |
|
|
|
|
|
|
|
|
|
module.exports = { |
|
|
|
|
...(branch ? (isMasterBranch ? tests : {}) : tests), |
|
|
|
|
...{} //(branch ? (isMasterBranch ? tests : {}) : tests),
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
const localsCheck = { |
|
|
|
|