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) => {