updated runs from URL

test for runs
set default value in input
pull/656/head
aniket-engg 4 years ago committed by Aniket
parent 006464f3f9
commit f3767c9299
  1. 4
      apps/remix-ide-e2e/src/tests/url.test.ts
  2. 6
      apps/remix-ide/src/app/tabs/compileTab/compilerContainer.js

@ -23,6 +23,7 @@ module.exports = {
.assert.containsText('#versionSelector option[selected="selected"]', '0.7.4+commit.3f05b770')
.assert.containsText('#evmVersionSelector option[selected="selected"]', 'istanbul')
.verify.elementPresent('#optimize:checked')
.verify.attributeEquals('#runs', 'value', '300')
},
'Should load using compiler from link passed in remix URL': function (browser: NightwatchBrowser) {
@ -34,9 +35,10 @@ module.exports = {
.pause(5000)
.assert.containsText('#versionSelector option[selected="selected"]', 'custom')
// default values
.assert.containsText('#evmVersionSelector option[selected="selected"]', 'default')
.verify.elementPresent('#optimize')
.assert.elementNotPresent('#optimize:checked')
.assert.containsText('#evmVersionSelector option[selected="selected"]', 'default')
.verify.elementPresent('#runs:disabled')
.end()
},

@ -197,12 +197,14 @@ class CompilerContainer {
class="custom-select ml-2 ${css.runs}"
id="runs"
placeholder="200"
value="200"
type="number"
title="Estimated number of times each opcode of the deployed code will be executed across the life-time of the contract."
onchange=${() => this.onchangeRuns()}
>`
if (this.compileTabLogic.optimize) this._view.runs.removeAttribute('disabled')
else {
if (this.compileTabLogic.optimize) {
this._view.runs.value = this.compileTabLogic.runs
} else {
this._view.runs.setAttribute('disabled', '')
}

Loading…
Cancel
Save