From eb585cc0964733a7e7af795274bee4205a6cff09 Mon Sep 17 00:00:00 2001 From: LianaHus Date: Tue, 2 Jun 2020 10:07:22 +0200 Subject: [PATCH] test improved --- test-browser/commands/noWorkerErrorFor.js | 12 ++++++------ test-browser/tests/usingWebWorker.test.js | 10 +++++++++- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/test-browser/commands/noWorkerErrorFor.js b/test-browser/commands/noWorkerErrorFor.js index c3c0f854d6..1fcb30dafc 100644 --- a/test-browser/commands/noWorkerErrorFor.js +++ b/test-browser/commands/noWorkerErrorFor.js @@ -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') }) @@ -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() }) } diff --git a/test-browser/tests/usingWebWorker.test.js b/test-browser/tests/usingWebWorker.test.js index b6918fad47..c59da319d3 100644 --- a/test-browser/tests/usingWebWorker.test.js +++ b/test-browser/tests/usingWebWorker.test.js @@ -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