From 6f60ef608c9ed4f2cc6854aa288f52c947b15777 Mon Sep 17 00:00:00 2001 From: ioedeveloper Date: Wed, 15 Sep 2021 16:41:28 +0100 Subject: [PATCH] Added local plugin test --- apps/remix-ide-e2e/nightwatch.ts | 2 +- .../src/tests/pluginManager.spec.ts | 34 +++++++++++++++++++ 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/apps/remix-ide-e2e/nightwatch.ts b/apps/remix-ide-e2e/nightwatch.ts index 1473cbaf2b..cab596db23 100644 --- a/apps/remix-ide-e2e/nightwatch.ts +++ b/apps/remix-ide-e2e/nightwatch.ts @@ -30,7 +30,7 @@ module.exports = { javascriptEnabled: true, acceptSslCerts: true }, - exclude: ['dist/apps/remix-ide-e2e/src/tests/runAndDeploy.js'] + exclude: ['dist/apps/remix-ide-e2e/src/tests/runAndDeploy.js', 'dist/apps/remix-ide-e2e/src/tests/pluginManager.spec.ts'] }, chrome: { diff --git a/apps/remix-ide-e2e/src/tests/pluginManager.spec.ts b/apps/remix-ide-e2e/src/tests/pluginManager.spec.ts index 6f6758795c..69e6684b3b 100644 --- a/apps/remix-ide-e2e/src/tests/pluginManager.spec.ts +++ b/apps/remix-ide-e2e/src/tests/pluginManager.spec.ts @@ -12,6 +12,13 @@ const testData = { pluginUrl: 'https://zokrates.github.io/zokrates-remix-plugin/' } +const localPluginData = { + pluginName: 'localPlugin', + pluginDisplayName: 'Local Plugin', + pluginCanActivate: 'LearnEth', + pluginUrl: 'http://localhost:2020' +} + module.exports = { before: function (browser: NightwatchBrowser, done: VoidFunction) { init(browser, done, 'http://127.0.0.1:8080', false) @@ -147,6 +154,33 @@ module.exports = { .assert.containsText('*[data-shared="tooltipPopup"]', 'Cannot create Plugin : This name has already been used') }, + 'Local plugin should activate LearnEth plugin': function (browser: NightwatchBrowser) { + browser + .waitForElementVisible('*[data-id="pluginManagerComponentPluginManager"]') + .click('*[data-id="pluginManagerComponentPluginSearchButton"]') + .waitForElementVisible('*[data-id="pluginManagerLocalPluginModalDialogModalDialogContainer-react"]') + .click('*[data-id="pluginManagerLocalPluginModalDialogModalDialogModalBody-react"]') + .waitForElementVisible('*[data-id="localPluginName"]') + .clearValue('*[data-id="localPluginName"]').setValue('*[data-id="localPluginName"]', localPluginData.pluginName) + .clearValue('*[data-id="localPluginDisplayName"]').setValue('*[data-id="localPluginDisplayName"]', localPluginData.pluginDisplayName) + .clearValue('*[data-id="localPluginCanActivate"]').setValue('*[data-id="localPluginCanActivate"]', localPluginData.pluginCanActivate) + .clearValue('*[data-id="localPluginUrl"]').setValue('*[data-id="localPluginUrl"]', localPluginData.pluginUrl) + .click('*[data-id="localPluginRadioButtoniframe"]') + .click('*[data-id="localPluginRadioButtonsidePanel"]') + .click('*[data-id="pluginManagerLocalPluginModalDialogModalDialogModalFooter-react"]') + .click('*[data-id="pluginManagerLocalPluginModalDialog-modal-footer-ok-react') + .waitForElementVisible('[data-id="verticalIconsKindlocalPlugin"]') + .click('[data-id="verticalIconsKindlocalPlugin"]') + .waitForElementNotPresent('[data-id="verticalIconsKindLearnEth"]') + .pause(2000) + // @ts-ignore + .frame('plugin-localPlugin') + .useXpath().click("//button[text()='Activate Learneth']") + .pause(2000) + .frameParent() + .useCss().waitForElementPresent('[data-id="verticalIconsKindLearnEth"]') + }, + 'Should load back installed plugins after reload': function (browser: NightwatchBrowser) { browser.waitForElementVisible('*[data-id="pluginManagerComponentPluginManager"]') .getInstalledPlugins((plugins) => {