From 4c49207f7d2d0bbbe9dd43b2a0d722bc3ecbe51f Mon Sep 17 00:00:00 2001 From: yann300 Date: Thu, 4 Aug 2022 11:55:32 +0200 Subject: [PATCH] add e2e for calls --- apps/remix-ide-e2e/src/tests/url.test.ts | 11 ++++++++++- apps/remix-ide/src/app.js | 4 ++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/apps/remix-ide-e2e/src/tests/url.test.ts b/apps/remix-ide-e2e/src/tests/url.test.ts index 832dca69d0..2bc6fe778f 100644 --- a/apps/remix-ide-e2e/src/tests/url.test.ts +++ b/apps/remix-ide-e2e/src/tests/url.test.ts @@ -246,6 +246,15 @@ module.exports = { .openFile('contracts') .openFile('contracts/governance') .openFile('contracts/governance/UnionGovernor.sol') - .end() + }, + + 'Should execute function call from URL parameters #group2': function (browser: NightwatchBrowser) { + browser + .switchWorkspace('default_workspace') + .url('http://127.0.0.1:8080?calls=fileManager//open//contracts/3_Ballot.sol///terminal//log//log') + .refresh() + .waitForElementVisible('*[data-shared="tooltipPopup"]') + .waitForElementContainsText('*[data-shared="tooltipPopup"]', 'initiating fileManager and calling "open" ...') + .waitForElementContainsText('*[data-shared="tooltipPopup"]', 'initiating terminal and calling "log" ...') } } diff --git a/apps/remix-ide/src/app.js b/apps/remix-ide/src/app.js index de6d2ba470..a05934ea18 100644 --- a/apps/remix-ide/src/app.js +++ b/apps/remix-ide/src/app.js @@ -410,7 +410,7 @@ class AppComponent { if (params.call) { const callDetails = params.call.split('//') if (callDetails.length > 1) { - this.appManager.call('notification', 'toast', `initiating ${callDetails[0]} ...`) + this.appManager.call('notification', 'toast', `initiating ${callDetails[0]} and calling "${callDetails[1]}" ...`) // @todo(remove the timeout when activatePlugin is on 0.3.0) this.appManager.call(...callDetails).catch(console.error) } @@ -426,7 +426,7 @@ class AppComponent { this.appManager.call( "notification", "toast", - `initiating ${callDetails[0]} ...` + `initiating ${callDetails[0]} and calling "${callDetails[1]}" ...` ); // @todo(remove the timeout when activatePlugin is on 0.3.0)