From 4262ccc7bd232d5add6c74be2b83bde9db3fe4ad Mon Sep 17 00:00:00 2001 From: yann300 Date: Mon, 17 Oct 2016 13:01:46 +0200 Subject: [PATCH] fix ie/safari ui tests --- ci/browser_tests.sh | 18 +++++++--- nightwatch.js | 5 ++- src/code/opcodes.js | 66 +++++++++++++++++------------------ src/helpers/ui.js | 6 +++- src/ui/CodeListView.js | 8 +++-- src/ui/DropdownPanel.js | 8 ++--- src/ui/Ethdebugger.js | 2 +- src/ui/TxBrowser.js | 1 - src/ui/img/play-arrow.png | Bin 1492 -> 0 bytes src/ui/styles/basicStyles.js | 7 +--- test-browser/init.js | 19 +++++----- test-browser/vmdebugger.js | 10 +++--- 12 files changed, 84 insertions(+), 66 deletions(-) delete mode 100644 src/ui/img/play-arrow.png diff --git a/ci/browser_tests.sh b/ci/browser_tests.sh index efc435e945..658337b521 100755 --- a/ci/browser_tests.sh +++ b/ci/browser_tests.sh @@ -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 diff --git a/nightwatch.js b/nightwatch.js index c21e2a7282..3a817bf5de 100644 --- a/nightwatch.js +++ b/nightwatch.js @@ -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 } diff --git a/src/code/opcodes.js b/src/code/opcodes.js index 021a3686f3..9506bf1e29 100644 --- a/src/code/opcodes.js +++ b/src/code/opcodes.js @@ -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], diff --git a/src/helpers/ui.js b/src/helpers/ui.js index 2860d2da44..16f2dd99a6 100644 --- a/src/helpers/ui.js +++ b/src/helpers/ui.js @@ -38,7 +38,11 @@ module.exports = { for (var arg in arguments) { for (var k in arguments[arg]) { if (arguments[arg][k] && ret.indexOf(k) === -1) { - ret += k + ':' + arguments[arg][k] + ';' + if (k.indexOf('*') === 0) { + ret += arguments[arg][k] + } else { + ret += k + ':' + arguments[arg][k] + ';' + } } } } diff --git a/src/ui/CodeListView.js b/src/ui/CodeListView.js index 0cf400799f..0e000c212f 100644 --- a/src/ui/CodeListView.js +++ b/src/ui/CodeListView.js @@ -32,12 +32,16 @@ CodeListView.prototype.indexChanged = function (index) { if (this.itemSelected) { this.itemSelected.removeAttribute('selected') this.itemSelected.removeAttribute('style') - this.itemSelected.firstChild.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') - this.itemSelected.firstChild.setAttribute('style', ui.formatCss({'margin-left': '2px'})) + if (this.itemSelected.firstChild) { + this.itemSelected.firstChild.setAttribute('style', ui.formatCss({'margin-left': '2px'})) + } this.codeView.scrollTop = this.itemSelected.offsetTop - parseInt(this.codeView.offsetHeight) } } diff --git a/src/ui/DropdownPanel.js b/src/ui/DropdownPanel.js index 5d2bba56be..b4c3d2cfce 100644 --- a/src/ui/DropdownPanel.js +++ b/src/ui/DropdownPanel.js @@ -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`
${k}
${this.data[k]}
`) } } - 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) { - + ` if (!this.view) { diff --git a/src/ui/Ethdebugger.js b/src/ui/Ethdebugger.js index c7f8a07b70..341dfebbb9 100644 --- a/src/ui/Ethdebugger.js +++ b/src/ui/Ethdebugger.js @@ -81,7 +81,7 @@ Ethdebugger.prototype.debug = function (tx) { Ethdebugger.prototype.render = function () { var view = yo`
-
+
${this.txBrowser.render()} ${this.stepManager.render()}
diff --git a/src/ui/TxBrowser.js b/src/ui/TxBrowser.js index be734871d7..058b80413a 100644 --- a/src/ui/TxBrowser.js +++ b/src/ui/TxBrowser.js @@ -34,7 +34,6 @@ function TxBrowser (_parent) { TxBrowser.prototype.setDefaultValues = function () { this.blockNumber = null - this.txNumber = '' this.connectInfo = '' this.basicPanel.data = {} this.basicPanel.update() diff --git a/src/ui/img/play-arrow.png b/src/ui/img/play-arrow.png deleted file mode 100644 index 3414a07289398e3a90b6a939bd93ab261166b1da..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1492 zcmWlZe>Bs37{|xVhQ^Jdd^Mt6E5ELe`I&qDh#?xvukM|lnEY7ix|c27yR{T*j=F0# zR7x06a{F7!(9Y?8m^b1e0D4*GBoI1nR!C7v#3^jAl-d9}@mX{0b!@Nkc%jD=vL$8(!uYa7p9yx^} z9na}k^xmo1)}Q$_*F20AYNmg+ydKQu3^)C`yzue)x2fWe?q!Nyuf=eI)w0y@zumL5 zeWx#~@zf1+f9c1*U|U~l$0dUSgEPp(vsj@i#w3eMD}=J%rG{EYM7V|%RF0w=0Oq^VgrEqqzKc|*y2P`hgQiTO zlBQ+yY+RsDNCY)A1f~3Q9Bi;)ee*VY_!fB55RY_P@bo9|1B0AJd5sI6#Ye=3K<2JY-ZoCX|5xK`-rcv;!Ot@*>Kr1xsu@k{ctRiQ;tlv#iiX|f3xfCvP*7?C}u@m+6 zmi*V-_>+iozir0B`3y#KIR$+&W_b zZ=S3Y>Xe_U(Un`A1 zS31s`g@1hOBgms4J9RdDG}5!oc(Ai2+TPnn`!29Ek8X3ke*KrWNQFEEI;KnscycxJSyBPKH4-yP zCn!8+7Y==bs~frWjXE5mJJULbLe#^LC02jp#{r7H1Vz_HK=Ct- zBtVf4V-Q$FV&MblEmT%B$yp-UIjj$7_fw$l9lIi&^>{E*>j4^Vx)4z8B9I?Kb!u>3jhEB diff --git a/src/ui/styles/basicStyles.js b/src/ui/styles/basicStyles.js index eb6c91c5c3..1002aeb7ac 100644 --- a/src/ui/styles/basicStyles.js +++ b/src/ui/styles/basicStyles.js @@ -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', diff --git a/test-browser/init.js b/test-browser/init.js index b39a74cd25..642c4661dd 100644 --- a/test-browser/init.js +++ b/test-browser/init.js @@ -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 } diff --git a/test-browser/vmdebugger.js b/test-browser/vmdebugger.js index 8ae1a6999f..861f51098c 100644 --- a/test-browser/vmdebugger.js +++ b/test-browser/vmdebugger.js @@ -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