From 140d578e348be966f2c1debfe1fa1810b3c720f6 Mon Sep 17 00:00:00 2001 From: ioedeveloper Date: Thu, 29 Apr 2021 14:16:52 +0100 Subject: [PATCH] Fixed library deployment test --- .../remix-ide-e2e/src/commands/getAddressAtPosition.ts | 2 +- .../remix-ide-e2e/src/commands/testConstantFunction.ts | 2 +- apps/remix-ide-e2e/src/tests/libraryDeployment.test.ts | 10 +++++----- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/apps/remix-ide-e2e/src/commands/getAddressAtPosition.ts b/apps/remix-ide-e2e/src/commands/getAddressAtPosition.ts index a1ea787335..4db10565fa 100644 --- a/apps/remix-ide-e2e/src/commands/getAddressAtPosition.ts +++ b/apps/remix-ide-e2e/src/commands/getAddressAtPosition.ts @@ -15,7 +15,7 @@ class GetAddressAtPosition extends EventEmitter { } function getAddressAtPosition (browser: NightwatchBrowser, index: number, callback: (pos: string) => void) { - browser.waitForElementPresent('*[data-shared="universalDappUiInstance"]') + browser.waitForElementPresent('*[data-shared="universalDappUiInstance"]', 60000) .execute(function (index) { const deployedContracts = document.querySelectorAll('*[data-shared="universalDappUiInstance"]') const id = deployedContracts[index].getAttribute('id') diff --git a/apps/remix-ide-e2e/src/commands/testConstantFunction.ts b/apps/remix-ide-e2e/src/commands/testConstantFunction.ts index db0d3b0946..064391220a 100644 --- a/apps/remix-ide-e2e/src/commands/testConstantFunction.ts +++ b/apps/remix-ide-e2e/src/commands/testConstantFunction.ts @@ -27,7 +27,7 @@ function testConstantFunction (browser: NightwatchBrowser, address: string, fnFu }) .click('.instance button[title="' + fnFullName + '"]') .pause(1000) - .waitForElementPresent('#instance' + address + ' div[class^="contractActionsContainer"] div[class^="value"]') + .waitForElementPresent('#instance' + address + ' div[class^="contractActionsContainer"] div[class^="value"]', 60000) .scrollInto('#instance' + address + ' div[class^="contractActionsContainer"] div[class^="value"]') .assert.containsText('#instance' + address + ' div[class^="contractActionsContainer"] div[class^="value"]', expectedOutput).perform(() => { cb() diff --git a/apps/remix-ide-e2e/src/tests/libraryDeployment.test.ts b/apps/remix-ide-e2e/src/tests/libraryDeployment.test.ts index 0a759aa332..555fdcc372 100644 --- a/apps/remix-ide-e2e/src/tests/libraryDeployment.test.ts +++ b/apps/remix-ide-e2e/src/tests/libraryDeployment.test.ts @@ -80,7 +80,7 @@ function checkDeployShouldFail (browser: NightwatchBrowser, callback: VoidFuncti .getText('div[class^="terminal"]', (value) => { console.log('value: ', value) }) - .assert.containsText('div[class^="terminal"]', '
is not a valid address') + .waitForElementContainsText('div[class^="terminal"]', '
is not a valid address', 60000) .perform(() => { callback() }) } @@ -100,14 +100,14 @@ function checkDeployShouldSucceed (browser: NightwatchBrowser, address: string, .clickLaunchIcon('udapp') .selectContract('test') // deploy lib .createContract('') - .getAddressAtPosition(1, (address) => { + .getAddressAtPosition(0, (address) => { addressRef = address }) - .waitForElementPresent('.instance:nth-of-type(3)') - .click('.instance:nth-of-type(3) > div > button') + .waitForElementPresent('.instance') + .click('.instance > div > button') .perform(() => { browser - .testConstantFunction(addressRef, 'get - call', null, '0:\nuint256: 45') + .testConstantFunction(addressRef, 'getInt - call', null, '0:\nuint256: 45') .perform(() => { callback() }) }) }