From d9c572175622499e025c16d71ca66846b9233ab9 Mon Sep 17 00:00:00 2001 From: LianaHus Date: Fri, 29 May 2020 18:03:06 +0200 Subject: [PATCH] added command --- package.json | 2 +- test-browser/commands/noWorkerErrorFor.js | 28 +++++++++++++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 test-browser/commands/noWorkerErrorFor.js diff --git a/package.json b/package.json index 9d12f75283..5d36e605f7 100644 --- a/package.json +++ b/package.json @@ -139,7 +139,6 @@ "ethereumjs-tx": "^2.1.2", "ethereumjs-vm": "4.1.3", "http-server": "^0.11.1", - "npm-install-version": "^6.0.2", "time-stamp": "^2.2.0", "winston": "^3.3.3" }, @@ -221,6 +220,7 @@ "nanohtml": "^1.6.3", "nightwatch": "^1.3.5", "notify-error": "^1.2.0", + "npm-install-version": "^6.0.2", "npm-link-local": "^1.1.0", "npm-merge-driver": "^2.3.5", "npm-run-all": "^4.0.2", diff --git a/test-browser/commands/noWorkerErrorFor.js b/test-browser/commands/noWorkerErrorFor.js new file mode 100644 index 0000000000..c3c0f854d6 --- /dev/null +++ b/test-browser/commands/noWorkerErrorFor.js @@ -0,0 +1,28 @@ +const EventEmitter = require('events') + +class NoWorkerErrorFor extends EventEmitter { + command (version, content) { + this.api.perform((done) => { + noWorkerErrorFor(this.api, version, content, () => { + done() + this.emit('complete') + }) + }) + return this + } +} + +function noWorkerErrorFor (browser, version, done) { + browser + .clickLaunchIcon('solidity') + .setSolidityCompilerVersion(version) + .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() + }) +} + +module.exports = NoWorkerErrorFor