From b6f8fe38186ca87fe130435137a73dca4d3b87ea Mon Sep 17 00:00:00 2001 From: ioedeveloper Date: Thu, 13 Feb 2020 07:37:24 +0000 Subject: [PATCH] Added plugin manager tests --- package.json | 1 + .../components/plugin-manager-component.js | 20 ++++---- test-browser/tests/plugin.js | 50 +++++++++++++++++++ 3 files changed, 61 insertions(+), 10 deletions(-) create mode 100644 test-browser/tests/plugin.js diff --git a/package.json b/package.json index 58d8473d26..7b07a1f461 100644 --- a/package.json +++ b/package.json @@ -176,6 +176,7 @@ "nightwatch_local_gist": "nightwatch ./test-browser/tests/gist.js --config nightwatch.js --env chrome ", "nightwatch_local_workspace": "nightwatch ./test-browser/tests/workspace.js --config nightwatch.js --env chrome ", "nightwatch_local_defaultLayout": "nightwatch ./test-browser/tests/defaultLayout.js --config nightwatch.js --env chrome ", + "nightwatch_local_plugin": "nightwatch ./test-browser/tests/plugin.js --config nightwatch.js --env chrome ", "onchange": "onchange build/app.js -- npm-run-all lint", "prepublish": "mkdirp build; npm-run-all -ls downloadsolc_root build", "remixd": "remixd -s ./contracts --remix-ide http://127.0.0.1:8080", diff --git a/src/app/components/plugin-manager-component.js b/src/app/components/plugin-manager-component.js index 5400c40d19..354d3efeaa 100644 --- a/src/app/components/plugin-manager-component.js +++ b/src/app/components/plugin-manager-component.js @@ -106,11 +106,11 @@ class PluginManagerComponent extends ViewPlugin { const activationButton = isActive ? yo` - ` : yo` - ` @@ -179,34 +179,34 @@ class PluginManagerComponent extends ViewPlugin { ? yo` ` : '' const inactiveTile = inactives.length !== 0 ? yo` ` : '' const settings = new PluginManagerSettings().render() const rootView = yo` -
-
- +
+
+
-
+
${activeTile} -
+
${actives.map(name => this.renderItem(name))}
${inactiveTile} -
+
${inactives.map(name => this.renderItem(name))}
diff --git a/test-browser/tests/plugin.js b/test-browser/tests/plugin.js new file mode 100644 index 0000000000..1c460c0c9a --- /dev/null +++ b/test-browser/tests/plugin.js @@ -0,0 +1,50 @@ +'use strict' +const init = require('../helpers/init') +const sauce = require('./sauce') + +module.exports = { + before: function (browser, done) { + init(browser, done, 'http://127.0.0.1:8080', false) + }, + + 'Should Load Plugin Manager': function (browser) { + browser.waitForElementVisible('div[data-id="remixIdeSidePanel"]') + .pause(3000) + .click('div[plugin="pluginManager"]') + .waitForElementVisible('div[data-id="pluginManagerComponentPluginManager"]') + .assert.containsText('h6[data-id="sidePanelSwapitTitle"]', 'PLUGIN MANAGER') + }, + + 'Should Search for plugins': function (browser) { + browser.waitForElementVisible('div[data-id="pluginManagerComponentPluginManager"]') + .click('input[data-id="pluginManagerComponentSearchInput"]') + .keys('debugger') + .waitForElementVisible('button[data-id="pluginManagerComponentActivateButtondebugger"]') + .clearValue('input[data-id="pluginManagerComponentSearchInput"]') + .click('input[data-id="pluginManagerComponentSearchInput"]') + .keys('Deploy & run transactions') + .waitForElementVisible('button[data-id="pluginManagerComponentActivateButtonudapp"]') + .clearValue('input[data-id="pluginManagerComponentSearchInput"]') + .click('input[data-id="pluginManagerComponentSearchInput"]') + .keys('ZoKrates') + .waitForElementVisible('button[data-id="pluginManagerComponentActivateButtonZoKrates"]') + .clearValue('input[data-id="pluginManagerComponentSearchInput"]') + .click('input[data-id="pluginManagerComponentSearchInput"]') + .keys(browser.Keys.ENTER) + }, + + + 'Should activate plugins': function (browser) { + browser.waitForElementVisible('div[data-id="pluginManagerComponentPluginManager"]') + .click('div[data-id="pluginManagerComponentPluginManager"]') + .scrollAndClick('button[data-id="pluginManagerComponentActivateButtondebugger"]') + .waitForElementVisible('button[data-id="pluginManagerComponentDeactivateButtondebugger"]') + .scrollAndClick('button[data-id="pluginManagerComponentActivateButtonudapp"]') + .waitForElementVisible('button[data-id="pluginManagerComponentDeactivateButtonudapp"]') + .scrollAndClick('button[data-id="pluginManagerComponentActivateButtonZoKrates"]') + .waitForElementVisible('button[data-id="pluginManagerComponentDeactivateButtonZoKrates"]') + .end() + }, + + tearDown: sauce +}