|
|
@ -4,7 +4,7 @@ import EventEmitter from "events" |
|
|
|
class GetAddressAtPosition extends EventEmitter { |
|
|
|
class GetAddressAtPosition extends EventEmitter { |
|
|
|
command (this: NightwatchBrowser, index: number, cb: (pos: string) => void): NightwatchBrowser { |
|
|
|
command (this: NightwatchBrowser, index: number, cb: (pos: string) => void): NightwatchBrowser { |
|
|
|
this.api.perform((done) => { |
|
|
|
this.api.perform((done) => { |
|
|
|
getAddressAtPosition(this.api, index, (pos: string) => { |
|
|
|
getAddressAtPosition(this.api, index, (pos) => { |
|
|
|
done() |
|
|
|
done() |
|
|
|
cb(pos) |
|
|
|
cb(pos) |
|
|
|
this.emit('complete') |
|
|
|
this.emit('complete') |
|
|
@ -14,7 +14,7 @@ class GetAddressAtPosition extends EventEmitter { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function getAddressAtPosition (browser: NightwatchBrowser, index: number, callback: (pos: any) => void) { |
|
|
|
function getAddressAtPosition (browser: NightwatchBrowser, index: number, callback: (pos: string) => void) { |
|
|
|
browser.waitForElementPresent('*[data-shared="universalDappUiInstance"]') |
|
|
|
browser.waitForElementPresent('*[data-shared="universalDappUiInstance"]') |
|
|
|
.execute(function (index) { |
|
|
|
.execute(function (index) { |
|
|
|
const deployedContracts = document.querySelectorAll('*[data-shared="universalDappUiInstance"]') |
|
|
|
const deployedContracts = document.querySelectorAll('*[data-shared="universalDappUiInstance"]') |
|
|
@ -22,7 +22,9 @@ function getAddressAtPosition (browser: NightwatchBrowser, index: number, callba |
|
|
|
|
|
|
|
|
|
|
|
return id.replace('instance', '') |
|
|
|
return id.replace('instance', '') |
|
|
|
}, [index], function (result) { |
|
|
|
}, [index], function (result) { |
|
|
|
callback(result.value) |
|
|
|
const pos = typeof result.value === 'string' ? result.value : null |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
callback(pos) |
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|