Commit cbd02330 authored by ioedeveloper's avatar ioedeveloper

Fixed library deployment test

parent 9b9fa8c4
...@@ -15,7 +15,7 @@ class GetAddressAtPosition extends EventEmitter { ...@@ -15,7 +15,7 @@ class GetAddressAtPosition extends EventEmitter {
} }
function getAddressAtPosition (browser: NightwatchBrowser, index: number, callback: (pos: string) => void) { function getAddressAtPosition (browser: NightwatchBrowser, index: number, callback: (pos: string) => void) {
browser.waitForElementPresent('*[data-shared="universalDappUiInstance"]') browser.waitForElementPresent('*[data-shared="universalDappUiInstance"]', 60000)
.execute(function (index) { .execute(function (index) {
const deployedContracts = document.querySelectorAll('*[data-shared="universalDappUiInstance"]') const deployedContracts = document.querySelectorAll('*[data-shared="universalDappUiInstance"]')
const id = deployedContracts[index].getAttribute('id') const id = deployedContracts[index].getAttribute('id')
......
...@@ -27,7 +27,7 @@ function testConstantFunction (browser: NightwatchBrowser, address: string, fnFu ...@@ -27,7 +27,7 @@ function testConstantFunction (browser: NightwatchBrowser, address: string, fnFu
}) })
.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 + ' div[class^="contractActionsContainer"] div[class^="value"]', 60000)
.scrollInto('#instance' + address + ' div[class^="contractActionsContainer"] div[class^="value"]') .scrollInto('#instance' + address + ' div[class^="contractActionsContainer"] div[class^="value"]')
.assert.containsText('#instance' + address + ' div[class^="contractActionsContainer"] div[class^="value"]', expectedOutput).perform(() => { .assert.containsText('#instance' + address + ' div[class^="contractActionsContainer"] div[class^="value"]', expectedOutput).perform(() => {
cb() cb()
......
...@@ -80,7 +80,7 @@ function checkDeployShouldFail (browser: NightwatchBrowser, callback: VoidFuncti ...@@ -80,7 +80,7 @@ function checkDeployShouldFail (browser: NightwatchBrowser, callback: VoidFuncti
.getText('div[class^="terminal"]', (value) => { .getText('div[class^="terminal"]', (value) => {
console.log('value: ', value) console.log('value: ', value)
}) })
.assert.containsText('div[class^="terminal"]', '<address> is not a valid address') .waitForElementContainsText('div[class^="terminal"]', '<address> is not a valid address', 60000)
.perform(() => { callback() }) .perform(() => { callback() })
} }
...@@ -100,14 +100,14 @@ function checkDeployShouldSucceed (browser: NightwatchBrowser, address: string, ...@@ -100,14 +100,14 @@ function checkDeployShouldSucceed (browser: NightwatchBrowser, address: string,
.clickLaunchIcon('udapp') .clickLaunchIcon('udapp')
.selectContract('test') // deploy lib .selectContract('test') // deploy lib
.createContract('') .createContract('')
.getAddressAtPosition(1, (address) => { .getAddressAtPosition(0, (address) => {
addressRef = address addressRef = address
}) })
.waitForElementPresent('.instance:nth-of-type(3)') .waitForElementPresent('.instance')
.click('.instance:nth-of-type(3) > div > button') .click('.instance > div > button')
.perform(() => { .perform(() => {
browser browser
.testConstantFunction(addressRef, 'get - call', null, '0:\nuint256: 45') .testConstantFunction(addressRef, 'getInt - call', null, '0:\nuint256: 45')
.perform(() => { callback() }) .perform(() => { callback() })
}) })
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment