Skip to content

Commit

Permalink
test improved
Browse files Browse the repository at this point in the history
  • Loading branch information
LianaHus committed Jun 3, 2020
1 parent 689b91d commit eb585cc
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
12 changes: 6 additions & 6 deletions test-browser/commands/noWorkerErrorFor.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
const EventEmitter = require('events')

class NoWorkerErrorFor extends EventEmitter {
command (version, content) {
command (version) {
this.api.perform((done) => {
noWorkerErrorFor(this.api, version, content, () => {
noWorkerErrorFor(this.api, version, () => {
done()
this.emit('complete')
})
Expand All @@ -12,16 +12,16 @@ class NoWorkerErrorFor extends EventEmitter {
}
}

function noWorkerErrorFor (browser, version, done) {
function noWorkerErrorFor (browser, version, callback) {
browser
.clickLaunchIcon('solidity')
.setSolidityCompilerVersion(version)
.pause(2000)
.waitForElementPresent('*[data-id="compiledErrors"]')
.notContainsText('*[data-id="compiledErrors"]', 'worker error:undefined')
.notContainsText('*[data-id="compiledErrors"]', 'Uncaught RangeError: Maximum call stack size exceeded')
.notContainsText('*[data-id="compiledErrors"]', 'RangeError: Maximum call stack size exceeded')
.perform(function (done) {
done()
.perform(() => {
callback()
})
}

Expand Down
10 changes: 9 additions & 1 deletion test-browser/tests/usingWebWorker.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,20 @@ module.exports = {
'Using Web Worker': function (browser) {
browser
.waitForElementVisible('*[data-id="remixIdeIconPanel"]', 10000)
.addFile('basic.sol', sources[0]['browser/basic.sol'])
.clickLaunchIcon('fileExplorers')
.openFile('browser/basic.sol')
.clickLaunchIcon('solidity')
.execute(() => {
document.getElementById('nightlies').checked = true
})
.noWorkerErrorFor('soljson-v0.3.4+commit.7dab890.js')
.noWorkerErrorFor('soljson-v0.6.5+commit.f956cc89.js')
.noWorkerErrorFor('soljson-v0.6.8-nightly.2020.5.14+commit.a6d0067b.js')
.noWorkerErrorFor('soljson-v0.6.0-nightly.2019.12.17+commit.d13438ee.js')
.noWorkerErrorFor('soljson-v0.4.26+commit.4563c3fc.js')
.execute(() => {
document.getElementById('nightlies').checked = false
})
},

tearDown: sauce
Expand Down

0 comments on commit eb585cc

Please sign in to comment.