From 22dac4d75878e71aa3ccd1d3ad40bb4654881212 Mon Sep 17 00:00:00 2001 From: bunsenstraat Date: Mon, 28 Oct 2024 17:22:28 +0100 Subject: [PATCH] provider test --- apps/remix-ide-e2e/src/tests/providers.test.ts | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/apps/remix-ide-e2e/src/tests/providers.test.ts b/apps/remix-ide-e2e/src/tests/providers.test.ts index 7fb52593e2..03495b79ac 100644 --- a/apps/remix-ide-e2e/src/tests/providers.test.ts +++ b/apps/remix-ide-e2e/src/tests/providers.test.ts @@ -12,15 +12,15 @@ module.exports = { .clickLaunchIcon('udapp') .switchEnvironment('ganache-provider') .waitForElementVisible('*[data-id="ganache-providerModalDialogModalBody-react"]') + .execute(() => { (document.querySelector('*[data-id="ganache-providerModalDialogModalBody-react"] input') as any).focus() }, [], () => {}) .clearValue('*[data-id="ganache-providerModalDialogModalBody-react"] input') .setValue('*[data-id="ganache-providerModalDialogModalBody-react"] input', 'http://127.0.0.1:8084') .modalFooterOKClick('ganache-provider') - .waitForElementContainsText('*[data-id="ganache-providerModalDialogModalBody-react"]', 'Error while connecting to the provider') - .modalFooterOKClick('ganache-provider') - .waitForElementNotVisible('*[data-id="ganache-providerModalDialogModalBody-react"]') + .pause(2000) + .waitForElementNotPresent({ selector: `[data-id="selected-provider-ganache-provider"]`, timeout: 5000}) .pause(1000) }, @@ -29,6 +29,8 @@ module.exports = { .waitForElementVisible('*[data-id="ganache-providerModalDialogModalBody-react"]') .modalFooterOKClick('ganache-provider') .waitForElementContainsText('*[data-id="settingsNetworkEnv"]', 'Custom (') + .waitForElementVisible({ selector: `[data-id="selected-provider-ganache-provider"]`, timeout: 5000}) + }, 'Should switch to foundry provider, set a custom URL and fail to connect': function (browser: NightwatchBrowser) { @@ -41,9 +43,6 @@ module.exports = { .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) },