From a0ad00821442d3ab823b68fe5ddb4537c7e8ae03 Mon Sep 17 00:00:00 2001 From: 8times4 <46720448+8times4@users.noreply.github.com> Date: Wed, 8 Jun 2022 14:56:03 +0200 Subject: [PATCH] add provider test for foundry --- .../remix-ide-e2e/src/tests/providers.test.ts | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/apps/remix-ide-e2e/src/tests/providers.test.ts b/apps/remix-ide-e2e/src/tests/providers.test.ts index 8bbfa7636b..83f69d699b 100644 --- a/apps/remix-ide-e2e/src/tests/providers.test.ts +++ b/apps/remix-ide-e2e/src/tests/providers.test.ts @@ -29,5 +29,26 @@ module.exports = { .waitForElementVisible('*[data-id="ganache-providerModalDialogModalBody-react"]') .modalFooterOKClick('ganache-provider') .waitForElementContainsText('*[data-id="settingsNetworkEnv"]', 'Custom (') + }, + 'Should switch to foundry provider, set a custom URL and fail to connect': function (browser: NightwatchBrowser) { + browser.click('*[data-id="Foundry Provider"]') + .waitForElementVisible('*[data-id="foundry-providerModalDialogModalBody-react"]') + .execute(() => { + (document.querySelector('*[data-id="foundry-providerModalDialogModalBody-react"] input') as any).focus() + }, [], () => {}) + .clearValue('*[data-id="foundry-providerModalDialogModalBody-react"] input') + .setValue('*[data-id="foundry-providerModalDialogModalBody-react"] input', 'http://127.0.0.1:8084') + .modalFooterOKClick('foundry-provider') + .waitForElementContainsText('*[data-id="foundry-providerModalDialogModalBody-react"]', 'Error while connecting to the provider') + .modalFooterOKClick('foundry-provider') + .waitForElementNotVisible('*[data-id="foundry-providerModalDialogModalBody-react"]') + .pause(1000) + +}, + 'Should switch to foundry provider, use the default foundry URL and succeed to connect': function (browser: NightwatchBrowser) { + browser.click('*[data-id="Foundry Provider"]') + .waitForElementVisible('*[data-id="foundry-providerModalDialogModalBody-react"]') + .modalFooterOKClick('foundry-provider') + .waitForElementContainsText('*[data-id="settingsNetworkEnv"]', 'Custom (') } }