From 0a876d55e5ee3221f550cf1203a9c0ffe07fe3a2 Mon Sep 17 00:00:00 2001 From: yann300 Date: Mon, 6 Jan 2020 18:00:49 +0100 Subject: [PATCH] add browser tests --- src/app.js | 1 - test-browser/helpers/init.js | 16 +++++++++------- test-browser/tests/workspace.js | 17 +++++++++++++++++ 3 files changed, 26 insertions(+), 8 deletions(-) create mode 100644 test-browser/tests/workspace.js diff --git a/src/app.js b/src/app.js index 0e868a89193..bd928fdbad0 100644 --- a/src/app.js +++ b/src/app.js @@ -1,4 +1,3 @@ -/* global localStorage */ 'use strict' var isElectron = require('is-electron') diff --git a/test-browser/helpers/init.js b/test-browser/helpers/init.js index 1ce93a57d89..6e4fa7df6bb 100644 --- a/test-browser/helpers/init.js +++ b/test-browser/helpers/init.js @@ -1,14 +1,16 @@ -module.exports = function (browser, callback) { +module.exports = function (browser, callback, url, preloadPlugins = true) { browser - .url('http://127.0.0.1:8080') + .url(url || 'http://127.0.0.1:8080') .injectScript('test-browser/helpers/applytestmode.js', function () { browser.resizeWindow(2560, 1440, () => { - initModules(browser, () => { - browser.clickLaunchIcon('solidity').click('#autoCompile') - .perform(function () { - callback() + if (preloadPlugins) { + initModules(browser, () => { + browser.clickLaunchIcon('solidity').click('#autoCompile') + .perform(function () { + callback() + }) }) - }) + } else callback() }) }) } diff --git a/test-browser/tests/workspace.js b/test-browser/tests/workspace.js new file mode 100644 index 00000000000..e019f4392be --- /dev/null +++ b/test-browser/tests/workspace.js @@ -0,0 +1,17 @@ +'use strict' +var init = require('../helpers/init') +var sauce = require('./sauce') + +module.exports = { + before: function (browser, done) { + init(browser, done, 'http://127.0.0.1:8080?plugins=solidity,udapp', false) + }, + 'CheckSolidityActivatedAndUDapp': function (browser) { + browser + .waitForElementVisible('#icon-panel', 10000) + .clickLaunchIcon('solidity') + .clickLaunchIcon('udapp') + .end() + }, + tearDown: sauce +}