|
|
@ -196,8 +196,8 @@ module.exports = { |
|
|
|
|
|
|
|
|
|
|
|
'Should run a script right after compilation #group6': function (browser: NightwatchBrowser) { |
|
|
|
'Should run a script right after compilation #group6': function (browser: NightwatchBrowser) { |
|
|
|
browser |
|
|
|
browser |
|
|
|
.addFile('contracts/storage.sol', { content: scriptAutoExec.contract } ) |
|
|
|
.addFile('contracts/storage.sol', { content: scriptAutoExec.contract }) |
|
|
|
.addFile('scripts/deploy_storage.js', { content: scriptAutoExec.script } ) |
|
|
|
.addFile('scripts/deploy_storage.js', { content: scriptAutoExec.script }) |
|
|
|
.openFile('contracts/storage.sol') |
|
|
|
.openFile('contracts/storage.sol') |
|
|
|
.sendKeys('body', [browser.Keys.CONTROL, browser.Keys.SHIFT, 's']) |
|
|
|
.sendKeys('body', [browser.Keys.CONTROL, browser.Keys.SHIFT, 's']) |
|
|
|
.pause(15000) |
|
|
|
.pause(15000) |
|
|
@ -211,12 +211,12 @@ module.exports = { |
|
|
|
.waitForElementPresent('[data-id="basic-http-provider-modal-footer-ok-react"]') |
|
|
|
.waitForElementPresent('[data-id="basic-http-provider-modal-footer-ok-react"]') |
|
|
|
.execute(() => { |
|
|
|
.execute(() => { |
|
|
|
(document.querySelector('*[data-id="basic-http-providerModalDialogContainer-react"] input[data-id="modalDialogCustomPromp"]') as any).focus() |
|
|
|
(document.querySelector('*[data-id="basic-http-providerModalDialogContainer-react"] input[data-id="modalDialogCustomPromp"]') as any).focus() |
|
|
|
}, [], () => {}) |
|
|
|
}, [], () => { }) |
|
|
|
.setValue('[data-id="modalDialogCustomPromp"]', 'https://remix-goerli.ethdevops.io') |
|
|
|
.setValue('[data-id="modalDialogCustomPromp"]', 'https://remix-goerli.ethdevops.io') |
|
|
|
.modalFooterOKClick('basic-http-provider') |
|
|
|
.modalFooterOKClick('basic-http-provider') |
|
|
|
.clickLaunchIcon('filePanel') |
|
|
|
.clickLaunchIcon('filePanel') |
|
|
|
.openFile('README.txt') |
|
|
|
.openFile('README.txt') |
|
|
|
.addFile('scripts/log_tx_block.js', { content: scriptBlockAndTransaction } ) |
|
|
|
.addFile('scripts/log_tx_block.js', { content: scriptBlockAndTransaction }) |
|
|
|
.pause(1000) |
|
|
|
.pause(1000) |
|
|
|
.executeScriptInTerminal('remix.execute(\'scripts/log_tx_block.js\')') |
|
|
|
.executeScriptInTerminal('remix.execute(\'scripts/log_tx_block.js\')') |
|
|
|
// check if the input of the transaction is being logged (web3 call)
|
|
|
|
// check if the input of the transaction is being logged (web3 call)
|
|
|
@ -225,39 +225,69 @@ module.exports = { |
|
|
|
.waitForElementContainsText('*[data-id="terminalJournal"]', '0x00000000000000000000000000100000000000000000020000000000002000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000040000000060000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000100000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000001', 120000) |
|
|
|
.waitForElementContainsText('*[data-id="terminalJournal"]', '0x00000000000000000000000000100000000000000000020000000000002000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000040000000060000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000100000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000001', 120000) |
|
|
|
// check if the logsBloom is being logged (ethers.js call)
|
|
|
|
// check if the logsBloom is being logged (ethers.js call)
|
|
|
|
.waitForElementContainsText('*[data-id="terminalJournal"]', '"hex":"0x025cd8"', 120000) |
|
|
|
.waitForElementContainsText('*[data-id="terminalJournal"]', '"hex":"0x025cd8"', 120000) |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
'Should listen on all transactions #group8': function (browser: NightwatchBrowser) { |
|
|
|
'Should listen on all transactions #group8': function (browser: NightwatchBrowser) { |
|
|
|
browser |
|
|
|
const url = 'http://127.0.0.1:8545' |
|
|
|
.clickLaunchIcon('udapp') // connect to mainnet
|
|
|
|
const identifier = 'Custom' |
|
|
|
.switchEnvironment('External Http Provider') |
|
|
|
browser |
|
|
|
.waitForElementPresent('[data-id="basic-http-provider-modal-footer-ok-react"]') |
|
|
|
.clickLaunchIcon('udapp') // connect to mainnet
|
|
|
|
.execute(() => { |
|
|
|
.connectToExternalHttpProvider(url, identifier) |
|
|
|
(document.querySelector('*[data-id="basic-http-providerModalDialogContainer-react"] input[data-id="modalDialogCustomPromp"]') as any).focus() |
|
|
|
.openFile('contracts') |
|
|
|
}, [], () => {}) |
|
|
|
.openFile('contracts/1_Storage.sol') |
|
|
|
.setValue('[data-id="modalDialogCustomPromp"]', 'https://rpc.archivenode.io/e50zmkroshle2e2e50zm0044i7ao04ym') |
|
|
|
.clickLaunchIcon('solidity') |
|
|
|
.modalFooterOKClick('basic-http-provider') |
|
|
|
.click({ |
|
|
|
.click('[data-id="terminalClearConsole"]') // clear the console
|
|
|
|
selector: '*[data-id="compilerContainerCompileAndRunBtn"]', |
|
|
|
.click('[data-id="listenNetworkCheckInput"]') // start to listen
|
|
|
|
}) |
|
|
|
.waitForElementContainsText('*[data-id="terminalJournal"]', 'from:', 200000) |
|
|
|
.pause(10000) |
|
|
|
.waitForElementContainsText('*[data-id="terminalJournal"]', 'to:', 200000) |
|
|
|
.waitForElementNotPresent({ |
|
|
|
.click('[data-id="terminalClearConsole"]') // clear the console
|
|
|
|
locateStrategy: 'xpath', |
|
|
|
.waitForElementContainsText('*[data-id="terminalJournal"]', 'from:', 200000) |
|
|
|
selector: "//*[@class='remix_ui_terminal_log' and contains(.,'to:') and contains(.,'from:')]", |
|
|
|
.waitForElementContainsText('*[data-id="terminalJournal"]', 'to:', 200000) |
|
|
|
timeout: 120000 |
|
|
|
.click('[data-id="listenNetworkCheckInput"]') // stop to listen
|
|
|
|
}) |
|
|
|
.pause(30000) |
|
|
|
.click({ |
|
|
|
.click('[data-id="terminalClearConsole"]') // clear the console
|
|
|
|
selector: '[data-id="listenNetworkCheckInput"]', |
|
|
|
.pause(5000) |
|
|
|
}) // start to listen
|
|
|
|
.click('[data-id="terminalClearConsole"]') // clear the console
|
|
|
|
.click({ |
|
|
|
.pause(20000) |
|
|
|
selector: '*[data-id="compilerContainerCompileAndRunBtn"]', |
|
|
|
.execute(function () { |
|
|
|
}) |
|
|
|
return (document.querySelector('[data-id="terminalJournal"]') as any).innerText |
|
|
|
.pause(10000) |
|
|
|
}, [], function (result) { |
|
|
|
.findElements( |
|
|
|
browser.assert.equal(result.value, '', 'terminal log should be empty') |
|
|
|
{ |
|
|
|
|
|
|
|
locateStrategy: 'xpath', |
|
|
|
|
|
|
|
selector: "//*[@class='remix_ui_terminal_log' and contains(.,'to:') and contains(.,'from:')]", |
|
|
|
|
|
|
|
timeout: 120000, |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
, async (result) => { |
|
|
|
|
|
|
|
if (Array.isArray(result.value) && result.value.length > 0) { |
|
|
|
|
|
|
|
console.log('Found ' + result.value.length + ' transactions') |
|
|
|
|
|
|
|
browser |
|
|
|
|
|
|
|
.click({ |
|
|
|
|
|
|
|
selector: '[data-id="listenNetworkCheckInput"]', |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
.click({ |
|
|
|
|
|
|
|
selector: '*[data-id="terminalClearConsole"]', |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
.click({ |
|
|
|
|
|
|
|
selector: '*[data-id="compilerContainerCompileAndRunBtn"]', |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
.pause(10000) |
|
|
|
|
|
|
|
.waitForElementNotPresent({ |
|
|
|
|
|
|
|
locateStrategy: 'xpath', |
|
|
|
|
|
|
|
selector: "//*[@class='remix_ui_terminal_log' and contains(.,'to:') and contains(.,'from:')]", |
|
|
|
|
|
|
|
timeout: 120000 |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
.end() |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
browser |
|
|
|
|
|
|
|
.assert.fail('No transaction found') |
|
|
|
|
|
|
|
.end() |
|
|
|
|
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const asyncAwait = ` |
|
|
|
const asyncAwait = ` |
|
|
|
var p = function () { |
|
|
|
var p = function () { |
|
|
|
return new Promise(function (resolve, reject) { |
|
|
|
return new Promise(function (resolve, reject) { |
|
|
|