fix ie/safari ui tests

pull/7/head
yann300 8 years ago
parent 7696ff1db1
commit 4262ccc7bd
  1. 18
      ci/browser_tests.sh
  2. 5
      nightwatch.js
  3. 66
      src/code/opcodes.js
  4. 4
      src/helpers/ui.js
  5. 4
      src/ui/CodeListView.js
  6. 8
      src/ui/DropdownPanel.js
  7. 2
      src/ui/Ethdebugger.js
  8. 1
      src/ui/TxBrowser.js
  9. BIN
      src/ui/img/play-arrow.png
  10. 7
      src/ui/styles/basicStyles.js
  11. 19
      test-browser/init.js
  12. 10
      test-browser/vmdebugger.js

@ -17,18 +17,28 @@ while [ ! -f $SAUCECONNECT_READYFILE ]; do
sleep .5
done
npm run nightwatch_remote_safari
echo $?
npm run nightwatch_remote_firefox
if [ $? -eq 1 ]
then
TEST_EXITCODE=1
fi
npm run nightwatch_remote_chrome
if [ $? -eq 1 ]
then
TEST_EXITCODE = 1
TEST_EXITCODE=1
fi
npm run nightwatch_remote_safari
if [ $? -eq 1 ]
then
TEST_EXITCODE=1
fi
npm run nightwatch_remote_ie
if [ $? -eq 1 ]
then
TEST_EXITCODE = 1
TEST_EXITCODE=1
fi
node ci/sauceDisconnect.js $SAUCECONNECT_USERNAME $SAUCECONNECT_ACCESSKEY $SAUCECONNECT_JOBIDENTIFIER

@ -62,7 +62,8 @@ module.exports = {
'desiredCapabilities': {
'browserName': 'safari',
'javascriptEnabled': true,
'platform': 'MAC',
'platform': 'OS X 10.11',
'version': '9.0',
'acceptSslCerts': true,
'build': 'build-' + TRAVIS_JOB_NUMBER,
'tunnel-identifier': 'remix_tests_' + TRAVIS_JOB_NUMBER
@ -74,6 +75,8 @@ module.exports = {
'browserName': 'internet explorer',
'javascriptEnabled': true,
'acceptSslCerts': true,
'platform': 'WIN8.1',
'version': '11',
'build': 'build-' + TRAVIS_JOB_NUMBER,
'tunnel-identifier': 'remix_tests_' + TRAVIS_JOB_NUMBER
}

@ -102,39 +102,39 @@ var codes = {
0x7e: ['PUSH', 3, 0, 1, false],
0x7f: ['PUSH', 3, 0, 1, false],
0x80: ['DUP1', 3, 0, 1, false],
0x81: ['DUP2', 3, 0, 1, false],
0x82: ['DUP3', 3, 0, 1, false],
0x83: ['DUP4', 3, 0, 1, false],
0x84: ['DUP5', 3, 0, 1, false],
0x85: ['DUP6', 3, 0, 1, false],
0x86: ['DUP7', 3, 0, 1, false],
0x87: ['DUP8', 3, 0, 1, false],
0x88: ['DUP9', 3, 0, 1, false],
0x89: ['DUP10', 3, 0, 1, false],
0x8a: ['DUP11', 3, 0, 1, false],
0x8b: ['DUP12', 3, 0, 1, false],
0x8c: ['DUP13', 3, 0, 1, false],
0x8d: ['DUP14', 3, 0, 1, false],
0x8e: ['DUP15', 3, 0, 1, false],
0x8f: ['DUP16', 3, 0, 1, false],
0x90: ['SWAP1', 3, 0, 0, false],
0x91: ['SWAP2', 3, 0, 0, false],
0x92: ['SWAP3', 3, 0, 0, false],
0x93: ['SWAP4', 3, 0, 0, false],
0x94: ['SWAP5', 3, 0, 0, false],
0x95: ['SWAP6', 3, 0, 0, false],
0x96: ['SWAP7', 3, 0, 0, false],
0x97: ['SWAP8', 3, 0, 0, false],
0x98: ['SWAP9', 3, 0, 0, false],
0x99: ['SWAP10', 3, 0, 0, false],
0x9a: ['SWAP11', 3, 0, 0, false],
0x9b: ['SWAP12', 3, 0, 0, false],
0x9c: ['SWAP13', 3, 0, 0, false],
0x9d: ['SWAP14', 3, 0, 0, false],
0x9e: ['SWAP15', 3, 0, 0, false],
0x9f: ['SWAP16', 3, 0, 0, false],
0x80: ['DUP', 3, 0, 1, false],
0x81: ['DUP', 3, 0, 1, false],
0x82: ['DUP', 3, 0, 1, false],
0x83: ['DUP', 3, 0, 1, false],
0x84: ['DUP', 3, 0, 1, false],
0x85: ['DUP', 3, 0, 1, false],
0x86: ['DUP', 3, 0, 1, false],
0x87: ['DUP', 3, 0, 1, false],
0x88: ['DUP', 3, 0, 1, false],
0x89: ['DUP', 3, 0, 1, false],
0x8a: ['DUP', 3, 0, 1, false],
0x8b: ['DUP', 3, 0, 1, false],
0x8c: ['DUP', 3, 0, 1, false],
0x8d: ['DUP', 3, 0, 1, false],
0x8e: ['DUP', 3, 0, 1, false],
0x8f: ['DUP', 3, 0, 1, false],
0x90: ['SWAP', 3, 0, 0, false],
0x91: ['SWAP', 3, 0, 0, false],
0x92: ['SWAP', 3, 0, 0, false],
0x93: ['SWAP', 3, 0, 0, false],
0x94: ['SWAP', 3, 0, 0, false],
0x95: ['SWAP', 3, 0, 0, false],
0x96: ['SWAP', 3, 0, 0, false],
0x97: ['SWAP', 3, 0, 0, false],
0x98: ['SWAP', 3, 0, 0, false],
0x99: ['SWAP', 3, 0, 0, false],
0x9a: ['SWAP', 3, 0, 0, false],
0x9b: ['SWAP', 3, 0, 0, false],
0x9c: ['SWAP', 3, 0, 0, false],
0x9d: ['SWAP', 3, 0, 0, false],
0x9e: ['SWAP', 3, 0, 0, false],
0x9f: ['SWAP', 3, 0, 0, false],
0xa0: ['LOG0', 375, 2, 0, false],
0xa1: ['LOG1', 375, 3, 0, false],

@ -38,10 +38,14 @@ module.exports = {
for (var arg in arguments) {
for (var k in arguments[arg]) {
if (arguments[arg][k] && ret.indexOf(k) === -1) {
if (k.indexOf('*') === 0) {
ret += arguments[arg][k]
} else {
ret += k + ':' + arguments[arg][k] + ';'
}
}
}
}
return ret
},

@ -32,12 +32,16 @@ CodeListView.prototype.indexChanged = function (index) {
if (this.itemSelected) {
this.itemSelected.removeAttribute('selected')
this.itemSelected.removeAttribute('style')
if (this.itemSelected.firstChild) {
this.itemSelected.firstChild.removeAttribute('style')
}
}
this.itemSelected = this.codeView.children[index]
this.itemSelected.setAttribute('style', ui.formatCss({'background-color': '#eeeeee'}))
this.itemSelected.setAttribute('selected', 'selected')
if (this.itemSelected.firstChild) {
this.itemSelected.firstChild.setAttribute('style', ui.formatCss({'margin-left': '2px'}))
}
this.codeView.scrollTop = this.itemSelected.offsetTop - parseInt(this.codeView.offsetHeight)
}
}

@ -25,7 +25,7 @@ DropdownPanel.prototype.update = function (_data) {
if (_data) {
this.data = _data
}
this.view.querySelector('.dropdownpanel div').innerHTML = ''
this.view.querySelector('.dropdownpanel div.dropdowncontent').innerHTML = ''
if (!this.raw) {
var data = JSON.stringify(this.data, null, '\t')
if (!this.data || data === '[]' || data === '{}') {
@ -41,13 +41,13 @@ DropdownPanel.prototype.update = function (_data) {
div.appendChild(yo`<div><div style=${ui.formatCss(basicStyles.truncate, {display: 'inline-block', 'width': '10%'})} >${k}</div><div style=${ui.formatCss(basicStyles.truncate, {display: 'inline-block', 'width': '50%'})} >${this.data[k]}</div></div>`)
}
}
this.view.querySelector('.dropdownpanel div').appendChild(div)
this.view.querySelector('.dropdownpanel div.dropdowncontent').appendChild(div)
this.view.querySelector('.btn').setAttribute('data-clipboard-text', data)
if (Clipboard && !this.clipboard) {
this.clipboard = new Clipboard(this.view.querySelector('.btn'))
}
} else {
this.view.querySelector('.dropdownpanel div').appendChild(this.data)
this.view.querySelector('.dropdownpanel div.dropdowncontent').appendChild(this.data)
this.view.querySelector('.btn').style.display = 'none'
}
}
@ -63,7 +63,7 @@ DropdownPanel.prototype.render = function (overridestyle) {
<button style=${ui.formatCss(style.button, styleDropdown.copyBtn)} class="btn" type="button">
Copy to clipboard
</button>
<div style=${ui.formatCss(styleDropdown.inner, overridestyle)} class='dropdowncontent'><span>Empty</span></div>
<div style=${ui.formatCss(styleDropdown.inner, overridestyle)} class='dropdowncontent'><div>Empty</div></div>
</div>
</div>`
if (!this.view) {

@ -81,7 +81,7 @@ Ethdebugger.prototype.debug = function (tx) {
Ethdebugger.prototype.render = function () {
var view = yo`<div style=${ui.formatCss(style.font)}>
<div style='margin: auto; width: 31%'>
<div style='margin: auto; width: 61%'>
${this.txBrowser.render()}
${this.stepManager.render()}
</div>

@ -34,7 +34,6 @@ function TxBrowser (_parent) {
TxBrowser.prototype.setDefaultValues = function () {
this.blockNumber = null
this.txNumber = ''
this.connectInfo = ''
this.basicPanel.data = {}
this.basicPanel.update()

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

@ -63,12 +63,7 @@ module.exports = {
'-moz-box-shadow': 'inset 0px 1px 0px 0px #ffffff',
'-webkit-box-shadow': 'inset 0px 1px 0px 0px #ffffff',
'box-shadow': 'inset 0px 1px 0px 0px #ffffff',
'background': '-webkit-gradient(linear, left top, left bottom, color-stop(0.05, #f9f9f9), color-stop(1, #e9e9e9))', // eslint-disable-line
'background': '-moz-linear-gradient(top, #f9f9f9 5%, #e9e9e9 100%)', // eslint-disable-line
'background': '-webkit-linear-gradient(top, #f9f9f9 5%, #e9e9e9 100%)', // eslint-disable-line
'background': '-o-linear-gradient(top, #f9f9f9 5%, #e9e9e9 100%)', // eslint-disable-line
'background': '-ms-linear-gradient(top, #f9f9f9 5%, #e9e9e9 100%)', // eslint-disable-line
'background': 'linear-gradient(to bottom, #f9f9f9 5%, #e9e9e9 100%)', // eslint-disable-line
'*background': 'background:-webkit-gradient(linear, left top, left bottom, color-stop(0.05, #f9f9f9), color-stop(1, #e9e9e9));background: -moz-linear-gradient(top, #f9f9f9 5%, #e9e9e9 100%);;background: -webkit-linear-gradient(top, #f9f9f9 5%, #e9e9e9 100%);background: -webkit-linear-gradient(top, #f9f9f9 5%, #e9e9e9 100%);background: -webkit-linear-gradient(top, #f9f9f9 5%, #e9e9e9 100%);background: -webkit-linear-gradient(top, #f9f9f9 5%, #e9e9e9 100%);background: -o-linear-gradient(top, #f9f9f9 5%, #e9e9e9 100%);background: -ms-linear-gradient(top, #f9f9f9 5%, #e9e9e9 100%);background: linear-gradient(to bottom, #f9f9f9 5%, #e9e9e9 100%);', // eslint-disable-line
'filter': "progid:DXImageTransform.Microsoft.gradient(startColorstr='#f9f9f9', endColorstr='#e9e9e9',GradientType=0)", // eslint-disable-line
'background-color': '#f9f9f9',
'-moz-border-radius': '6px',

@ -128,31 +128,34 @@ browser.fireEvent = function (el, key, times, callback) {
}
function assertPanel (id, browser, value) {
var selector = id + ' .dropdownpanel div div'
browser.execute(function (id) {
var node = document.querySelector(id)
var selector = '.dropdownpanel div.dropdowncontent div'
browser.execute(function (id, selector) {
var el = document.getElementById(id.replace('#', '').replace('.', ''))
var node = el.querySelector(selector)
var ret = []
for (var k in node.children) {
for (var k = 0; k < node.children.length; k++) {
if (node.children[k].innerText) {
ret.push(node.children[k].innerText)
}
}
return ret
}, [selector], function (returnValues) {
}, [id, selector], function (returnValues) {
value.map(function (item, index) {
browser.assert.equal(returnValues.value[index], value[index])
var testValue = returnValues.value[index].replace(/\r\n/g, '').replace(/\t/g, '').replace(/\s/g, '')
browser.assert.equal(testValue, value[index])
})
})
return browser
}
function assertPanelValue (id, browser, index, value) {
var selector = id + ' .dropdownpanel div div'
var selector = id + ' .dropdownpanel .dropdowncontent div'
browser.execute(function (id, index) {
var node = document.querySelector(id)
return node.children[index].innerText
}, [selector, index], function (returnValues) {
browser.assert.equal(returnValues.value, value)
var testValue = returnValues.value.replace(/\r\n/g, '').replace(/\t/g, '').replace(/\s/g, '')
browser.assert.equal(testValue, value)
})
return browser
}

@ -64,15 +64,15 @@ function panels (browser) {
.assertCallData(['0x60fe47b10000000000000000000000000000000000000000000000000000000000000038'])
.assertCallStack(['0x0d3a18d64dfe4f927832ab58d6451cecc4e517c5'])
.assertStackValue(1, '0x60')
.assertMemoryValue(6, '0x6060606040526040516020806045833981\t????R??Q????E?9?')
.assertMemoryValue(7, '0x7001604052808051906020019091905050\t???R??Q???????PP')
.assertMemoryValue(8, '0x805b806001016000600050819055505b50\t?????????P??UP?P')
.assertMemoryValue(6, '0x6060606040526040516020806045833981????R??Q????E?9?')
.assertMemoryValue(7, '0x7001604052808051906020019091905050???R??Q???????PP')
.assertMemoryValue(8, '0x805b806001016000600050819055505b50?????????P??UP?P')
.click('#intoforward') // CREATE
.assertStack(['Empty'])
.assertStorageChanges(['Empty'])
.assertMemory(['Empty'])
.assertCallData(['0x0000000000000000000000000000000000000000000000000000000000000000000000000000006060606040526040516020806045833981016040528080519060200190919050505b806001016000600050819055'])
.assertCallStack(['0x0d3a18d64dfe4f927832ab58d6451cecc4e517c5', '(Contract Creation - Step 63)'])
.assertCallStack(['0x0d3a18d64dfe4f927832ab58d6451cecc4e517c5', '(ContractCreation-Step63)'])
return browser
}
@ -160,7 +160,7 @@ function stepdetail (browser) {
.assertStepDetail('63', '63', '', '32000', '79283', '0x0d3a18d64dfe4f927832ab58d6451cecc4e517c5')
.click('#intoforward')
.click('#overforward')
.assertStepDetail('108', '44', '', '0', '27145', '(Contract Creation - Step 63)')
.assertStepDetail('108', '44', '', '0', '27145', '(ContractCreation-Step63)')
.click('#intoforward')
.assertStepDetail('109', '64', '', '3', '25145', '0x0d3a18d64dfe4f927832ab58d6451cecc4e517c5')
return browser

Loading…
Cancel
Save