Debugger e2e tests

pull/1/head
ioedeveloper 5 years ago committed by yann300
parent 74af512b93
commit 2e642cce20
  1. 1
      package.json
  2. 6
      src/app/ui/multiParamManager.js
  3. 2
      src/app/ui/txLogger.js
  4. 2
      src/app/ui/universal-dapp-ui.js
  5. 73
      test-browser/tests/debugger.js

@ -182,6 +182,7 @@
"nightwatch_local_publishContract": "nightwatch ./test-browser/tests/publishContract.js --config nightwatch.js --env chrome ",
"nightwatch_local_generalSettings": "nightwatch ./test-browser/tests/generalSettings.js --config nightwatch.js --env chrome ",
"nightwatch_local_fileExplorer": "nightwatch ./test-browser/tests/fileExplorer.js --config nightwatch.js --env chrome ",
"nightwatch_local_debugger": "nightwatch ./test-browser/tests/debugger.js --config nightwatch.js --env chrome ",
"onchange": "onchange build/app.js -- npm-run-all lint",
"prepublish": "mkdirp build; npm-run-all -ls downloadsolc_root build",
"remixd": "remixd -s ./contracts --remix-ide http://127.0.0.1:8080",

@ -116,14 +116,14 @@ class MultiParamManager {
title = this.funABI.type === 'receive' ? '(receive)' : '(fallback)'
}
this.basicInputField = yo`<input class="form-control"></input>`
this.basicInputField = yo`<input class="form-control" data-shared="multiParamManagerBasicInputField"></input>`
this.basicInputField.setAttribute('placeholder', this.inputs)
this.basicInputField.setAttribute('title', this.inputs)
var onClick = () => {
this.clickCallBack(this.funABI.inputs, this.basicInputField.value)
}
let funcButton = yo`<button onclick=${() => onClick()} class="${css.instanceButton} btn btn-sm">${title}</button>`
let funcButton = yo`<button onclick=${() => onClick()} data-shared="multiParamManagerFuncButton" class="${css.instanceButton} btn btn-sm">${title}</button>`
this.contractActionsContainerSingle = yo`
<div class="${css.contractActionsContainerSingle} pt-2">
${funcButton}
@ -142,7 +142,7 @@ class MultiParamManager {
}
}
var expandedButton = yo`<button onclick=${() => { multiOnClick() }} class="${css.instanceButton}"></button>`
var expandedButton = yo`<button onclick=${() => { multiOnClick() }} class="${css.instanceButton}" data-shared="multiParamManagerExpandedButton"></button>`
this.contractActionsContainerMulti = yo`<div class="${css.contractActionsContainerMulti}" >
<div class="${css.contractActionsContainerMultiInner} text-dark" >

@ -215,7 +215,7 @@ function renderKnownTransaction (self, data, blockchain) {
${checkTxStatus(data.receipt, txType)}
${context(self, {from, to, data}, blockchain)}
<div class=${css.buttons}>
<button class="${css.debug} btn btn-primary btn-sm" onclick=${(e) => debug(e, data, self)}>Debug</div>
<button data-shared="txLoggerDebugButton" class="${css.debug} btn btn-primary btn-sm" onclick=${(e) => debug(e, data, self)}>Debug</div>
</div>
<i class="${css.arrow} fas fa-angle-down"></i>
</div>

@ -60,7 +60,7 @@ UniversalDAppUI.prototype.renderInstanceFromABI = function (contractABI, address
var shortAddress = helper.shortenAddress(address)
var title = yo`
<div class="${css.title} alert alert-secondary">
<button class="btn ${css.titleExpander}" onclick="${(e) => { toggleClass(e) }}">
<button data-id="universalDappUiTitleExpander" class="btn ${css.titleExpander}" onclick="${(e) => { toggleClass(e) }}">
<i class="fas fa-angle-right" aria-hidden="true"></i>
</button>
<div class="input-group ${css.nameNbuts}">

@ -0,0 +1,73 @@
'use strict'
var init = require('../helpers/init')
var sauce = require('./sauce')
module.exports = {
before: function (browser, done) {
init(browser, done)
},
'@sources': function () {
return sources
},
'Should launch debugger': function (browser) {
browser.addFile('blah.sol', sources[0]['browser/blah.sol'])
.clickLaunchIcon('udapp')
.waitForElementPresent('*[title="Deploy - transact (not payable)"]')
.click('*[title="Deploy - transact (not payable)"]')
.waitForElementPresent('*[data-shared="txLoggerDebugButton"]:nth-of-type(1)')
.click('*[data-shared="txLoggerDebugButton"]:nth-of-type(1)')
.assert.containsText('*[data-id="sidePanelSwapitTitle"]', 'DEBUGGER')
},
'Should debug failing transaction': function (browser) {
browser.waitForElementVisible('*[data-id="verticalIconsKindudapp"]')
.clickLaunchIcon('udapp')
.waitForElementPresent('*[data-id="universalDappUiTitleExpander"]')
.click('*[data-id="universalDappUiTitleExpander"]')
.waitForElementPresent('*[data-shared="multiParamManagerBasicInputField"]:nth-of-type(1)')
.sendKeys('*[data-shared="multiParamManagerBasicInputField"]:nth-of-type(1)', '"toast", 999')
.pause(100000)
.end()
},
tearDown: sauce
}
var sources = [
{
'browser/blah.sol': {
content: `
pragma solidity >=0.4.22 <0.6.0;
contract Kickstarter {
enum State { Started, Completed }
struct Project {
address owner;
string name;
uint goal;
State state;
}
Project[] public projects;
constructor() public {
}
function createProject(string memory name, uint goal) public {
Project storage project = projects[projects.length];
project.name = name;
project.owner = msg.sender;
project.state = State.Started;
project.goal = goal;
}
}
`
}
}
]
Loading…
Cancel
Save