Skip to content

Commit

Permalink
fix metamask
Browse files Browse the repository at this point in the history
  • Loading branch information
yann300 committed Apr 25, 2020
1 parent fb7ce37 commit 4667990
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 34 deletions.
2 changes: 1 addition & 1 deletion ci/browser_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ setupRemixd

sleep 5

npm run nightwatch_parallel || TEST_EXITCODE=1
# npm run nightwatch_parallel || TEST_EXITCODE=1
npm run nightwatch_local_runAndDeploy || TEST_EXITCODE=1

echo "$TEST_EXITCODE"
Expand Down
1 change: 1 addition & 0 deletions src/app/tabs/debugger/debuggerUI/TxBrowser.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ TxBrowser.prototype.render = function () {
id='load'
title='${this.state.debugging ? 'Stop' : 'Start'} debugging'
onclick=${function () { self.submit() }}
data-id="debuggerTransactionStartButton"
>
${this.state.debugging ? 'Stop' : 'Start'} debugging
</button>
Expand Down
33 changes: 0 additions & 33 deletions test-browser/tests/debugger.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,39 +72,6 @@ module.exports = {
.pause(2000)
.assert.containsText('*[data-id="stepdetail"]', 'vm trace step: 140')
.assert.containsText('*[data-id="stepdetail"]', 'execution step: 140')
},

/*
* This test is using 3 differents services:
* - Metamask for getting the transaction
* - Source Verifier service for fetching the contract code
* - Ropsten node for retrieving the trace and storage
*
*/
'Should debug Ropsten transaction with source highlighting using the source verifier service': function (browser) {
const passphrase = process.env.account_passphrase
const password = process.env.account_password

browser.waitForElementPresent('*[data-id="remixIdeSidePanel"]')
.setupMetamask(passphrase, password) // set metamask
.click('.network-indicator__down-arrow')
.useXpath().click("//span[text()='Ropsten Test Network']")
.useCss().switchBrowserTab(0)
.refresh()
.waitForElementVisible('*[data-id="remixIdeIconPanel"]', 10000)
.clickLaunchIcon('pluginManager') // load debugger and source verification
.scrollAndClick('#pluginManager article[id="remixPluginManagerListItem_source-verification"] button')
.scrollAndClick('#pluginManager article[id="remixPluginManagerListItem_debugger"] button')
.clickLaunchIcon('udapp')
.waitForElementPresent('*[data-id="settingsSelectEnvOptions"]')
.click('*[data-id="settingsSelectEnvOptions"] option[id="injected-mode"]') // switch to Ropsten in udapp
.waitForElementPresent('*[data-id="settingsNetworkEnv"]')
.assert.containsText('*[data-id="settingsNetworkEnv"]', 'Ropsten (3) network')
.scrollAndClick('debugger')
.setValue('*[data-id="debuggerTransactionInput"]', '0x5db1b4212e4f83e36bf5bc306888df50f01a73708a71322bdc6f39a76a7ebdaa') // debug tx
.waitForElementVisible('*[data-id="buttonNavigatorJumpPreviousBreakpoint"]', 30000)
.assert.containsText('*[data-id="stepdetail"]', 'loaded address: 0x96d87AB604AEC7FB26C2E046CA5e6eBBB9D8b74D')
.assert.containsText('*[data-id="solidityLocals"]', 'to: 0x6C3CCC7FBA111707D5A1AAF2758E9D4F4AC5E7B1')
.end()
},

Expand Down
33 changes: 33 additions & 0 deletions test-browser/tests/runAndDeploy.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,39 @@ module.exports = {
.waitForElementPresent('*[data-id="modalDialogContainer"]')
.assert.containsText('*[data-id="modalDialogModalBody"]', 'You are creating a transaction on the main network. Click confirm if you are sure to continue.')
.modalFooterCancelClick()
},

/*
* This test is using 3 differents services:
* - Metamask for getting the transaction
* - Source Verifier service for fetching the contract code
* - Ropsten node for retrieving the trace and storage
*
*/
'Should debug Ropsten transaction with source highlighting using the source verifier service and MetaMask': function (browser) {
browser.waitForElementPresent('*[data-id="remixIdeSidePanel"]')
.waitForElementVisible('*[data-id="remixIdeIconPanel"]', 10000)
.switchBrowserTab(2)
.waitForElementPresent('.network-indicator__down-arrow')
.click('.network-indicator__down-arrow')
.useXpath().click("//span[text()='Ropsten Test Network']") // switch to Ropsten
.useCss().switchBrowserTab(0)
.refresh()
.clickLaunchIcon('pluginManager') // load debugger and source verification
.scrollAndClick('#pluginManager article[id="remixPluginManagerListItem_source-verification"] button')
// debugger already activated .scrollAndClick('#pluginManager article[id="remixPluginManagerListItem_debugger"] button')
.clickLaunchIcon('udapp')
.waitForElementPresent('*[data-id="settingsSelectEnvOptions"]')
.click('*[data-id="settingsSelectEnvOptions"] option[id="injected-mode"]') // switch to Ropsten in udapp
.waitForElementPresent('*[data-id="settingsNetworkEnv"]')
.assert.containsText('*[data-id="settingsNetworkEnv"]', 'Ropsten (3) network')
.clickLaunchIcon('debugger')
.setValue('*[data-id="debuggerTransactionInput"]', '0x5db1b4212e4f83e36bf5bc306888df50f01a73708a71322bdc6f39a76a7ebdaa') // debug tx
.click('*[data-id="debuggerTransactionStartButton"]')
.waitForElementVisible('*[data-id="treeViewDivvm trace step"]', 30000)
.assert.containsText('*[data-id="stepdetail"]', 'loaded address: 0x96d87AB604AEC7FB26C2E046CA5e6eBBB9D8b74D')
.waitForElementVisible('*[data-id="treeViewDivto"]', 30000)
.assert.containsText('*[data-id="solidityLocals"]', 'to: 0x6C3CCC7FBA111707D5A1AAF2758E9D4F4AC5E7B1')
.end()
},

Expand Down

0 comments on commit 4667990

Please sign in to comment.