test custom compiler

pull/646/head
aniket-engg 4 years ago committed by Aniket
parent 024f5bde9a
commit e428434638
  1. 14
      apps/remix-ide-e2e/src/tests/url.test.ts
  2. 19
      apps/remix-ide/src/app/tabs/compileTab/compilerContainer.js

@ -25,5 +25,19 @@ module.exports = {
.verify.elementPresent('[id="optimize"]:checked') .verify.elementPresent('[id="optimize"]:checked')
}, },
'Should load using compiler from link passed in remix URL': function (browser: NightwatchBrowser) {
browser
.url('http://127.0.0.1:8080/#version=https://solidity-blog.s3.eu-central-1.amazonaws.com/data/08preview/soljson.js')
.refresh()
.pause(5000)
.clickLaunchIcon('solidity')
.pause(5000)
.assert.containsText('#versionSelector option[selected="selected"]', 'custom')
// default values
.verify.elementPresent('[id="optimize"]:checked')
// .assert.containsText('#evmVersionSelector option[selected="selected"]', 'compiler default')
},
tearDown: sauce tearDown: sauce
} }

@ -430,15 +430,6 @@ class CompilerContainer {
this.data.selectedVersion = this.data.defaultVersion this.data.selectedVersion = this.data.defaultVersion
} }
this._view.versionSelector.innerHTML = '' this._view.versionSelector.innerHTML = ''
this.data.allversions.forEach(build => {
const option = build.path === this.data.selectedVersion
? yo`<option value="${build.path}" selected>${build.longVersion}</option>`
: yo`<option value="${build.path}">${build.longVersion}</option>`
if (this._shouldBeAdded(option.innerText)) {
this._view.versionSelector.appendChild(option)
}
})
this._view.versionSelector.removeAttribute('disabled') this._view.versionSelector.removeAttribute('disabled')
this.queryParams.update({ version: this.data.selectedVersion }) this.queryParams.update({ version: this.data.selectedVersion })
let url let url
@ -460,6 +451,16 @@ class CompilerContainer {
url = `${urlFromVersion(this.data.selectedVersion)}` url = `${urlFromVersion(this.data.selectedVersion)}`
} }
this.data.allversions.forEach(build => {
const option = build.path === this.data.selectedVersion
? yo`<option value="${build.path}" selected>${build.longVersion}</option>`
: yo`<option value="${build.path}">${build.longVersion}</option>`
if (this._shouldBeAdded(option.innerText)) {
this._view.versionSelector.appendChild(option)
}
})
// Workers cannot load js on "file:"-URLs and we get a // Workers cannot load js on "file:"-URLs and we get a
// "Uncaught RangeError: Maximum call stack size exceeded" error on Chromium, // "Uncaught RangeError: Maximum call stack size exceeded" error on Chromium,
// resort to non-worker version in that case. // resort to non-worker version in that case.

Loading…
Cancel
Save