Fixed library deployment test

yann300-patch-36
David Disu 3 years ago committed by yann300
parent 8311eab887
commit a2ddbed742
  1. 9
      apps/remix-ide-e2e/src/commands/testConstantFunction.ts
  2. 7
      apps/remix-ide-e2e/src/tests/libraryDeployment.test.ts

@ -20,16 +20,17 @@ function testConstantFunction (browser: NightwatchBrowser, address: string, fnFu
document.querySelector('#runTabView').scrollTop = document.querySelector('#runTabView').scrollHeight document.querySelector('#runTabView').scrollTop = document.querySelector('#runTabView').scrollHeight
}, [], function () { }, [], function () {
if (expectedInput) { if (expectedInput) {
client.setValue('#runTabView input[title="' + expectedInput.types + '"]', expectedInput.values) client.waitForElementPresent('#runTabView input[title="' + expectedInput.types + '"]')
.setValue('#runTabView input[title="' + expectedInput.types + '"]', expectedInput.values)
} }
done() done()
}) })
}) })
.click('.instance button[title="' + fnFullName + '"]') .click('.instance button[title="' + fnFullName + '"]')
.pause(1000) .pause(1000)
.waitForElementPresent('#instance' + address + ' div[class^="contractActionsContainer"] div[class^="value"]') .waitForElementPresent('#instance' + address + ' .udapp_contractActionsContainer .udapp_value')
.scrollInto('#instance' + address + ' div[class^="contractActionsContainer"] div[class^="value"]') .scrollInto('#instance' + address + ' .udapp_contractActionsContainer .udapp_value')
.assert.containsText('#instance' + address + ' div[class^="contractActionsContainer"] div[class^="value"]', expectedOutput).perform(() => { .assert.containsText('#instance' + address + ' .udapp_contractActionsContainer .udapp_value', expectedOutput).perform(() => {
cb() cb()
}) })
} }

@ -27,8 +27,7 @@ module.exports = {
console.log('testAutoDeployLib ' + address) console.log('testAutoDeployLib ' + address)
addressRef = address addressRef = address
}) })
.waitForElementPresent('.instance:nth-of-type(2)') .clickInstance(0)
.click('.instance:nth-of-type(2) > div > button')
.perform((done) => { .perform((done) => {
browser.testConstantFunction(addressRef, 'get - call', null, '0:\nuint256: 45').perform(() => { browser.testConstantFunction(addressRef, 'get - call', null, '0:\nuint256: 45').perform(() => {
done() done()
@ -37,7 +36,6 @@ module.exports = {
}, },
'Test Manual Deploy Lib': function (browser: NightwatchBrowser) { 'Test Manual Deploy Lib': function (browser: NightwatchBrowser) {
console.log('testManualDeployLib')
browser.click('*[data-id="deployAndRunClearInstances"]') browser.click('*[data-id="deployAndRunClearInstances"]')
.pause(5000) .pause(5000)
.clickLaunchIcon('settings') .clickLaunchIcon('settings')
@ -104,8 +102,7 @@ function checkDeployShouldSucceed (browser: NightwatchBrowser, address: string,
.getAddressAtPosition(1, (address) => { .getAddressAtPosition(1, (address) => {
addressRef = address addressRef = address
}) })
.waitForElementPresent('.instance:nth-of-type(3)') .clickInstance(1)
.click('.instance:nth-of-type(3) > div > button')
.perform(() => { .perform(() => {
browser browser
.testConstantFunction(addressRef, 'get - call', null, '0:\nuint256: 45') .testConstantFunction(addressRef, 'get - call', null, '0:\nuint256: 45')

Loading…
Cancel
Save