Skip to content

Commit

Permalink
add e2e test - debug with source verifier
Browse files Browse the repository at this point in the history
  • Loading branch information
yann300 committed Apr 25, 2020
1 parent 944ab58 commit ef3dfd9
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
gist_token = <token>
gist_token = 5e82bb8078bb9378c449978f016d702cab8570cb
account_passphrase = <passphrase>
account_password = <password>
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 @@ -93,6 +93,7 @@ TxBrowser.prototype.render = function () {
type='text'
oninput=${this.txInputChanged.bind(this)}
placeholder=${'Transaction hash, should start with 0x'}
data-id="debuggerTransactionInput"
/>
`
let txButton = yo`
Expand Down
27 changes: 27 additions & 0 deletions test-browser/tests/debugger.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,33 @@ 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)
.click('.network-indicator__down-arrow')
.useXpath().click("//span[text()='Ropsten Test Network']")
.useCss().switchBrowserTab(0)
.refresh()
.waitForElementVisible('*[data-id="remixIdeIconPanel"]', 10000)
.clickLaunchIcon('pluginManager')
.scrollAndClick('#pluginManager article[id="remixPluginManagerListItem_source-verification"] button')
.scrollAndClick('debugger')
.setValue('*[data-id="debuggerTransactionInput"]', '0x5db1b4212e4f83e36bf5bc306888df50f01a73708a71322bdc6f39a76a7ebdaa')
.waitForElementVisible('*[data-id="buttonNavigatorJumpPreviousBreakpoint"]', 30000)
.assert.containsText('*[data-id="stepdetail"]', 'loaded address: 0x96d87AB604AEC7FB26C2E046CA5e6eBBB9D8b74D')
.assert.containsText('*[data-id="solidityLocals"]', 'to: 0x6C3CCC7FBA111707D5A1AAF2758E9D4F4AC5E7B1')
.end()
},

Expand Down

0 comments on commit ef3dfd9

Please sign in to comment.