|
|
|
@ -5,18 +5,13 @@ const selector = '.udapp_contractNames' |
|
|
|
|
|
|
|
|
|
class SelectContract extends EventEmitter { |
|
|
|
|
command(this: NightwatchBrowser, contractName: string): NightwatchBrowser { |
|
|
|
|
this.api.waitForElementVisible(selector).perform((done) => { |
|
|
|
|
selectContract(this.api, contractName, () => { |
|
|
|
|
done() |
|
|
|
|
this.emit('complete') |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
this.api |
|
|
|
|
.waitForElementVisible(selector) |
|
|
|
|
.waitForElementPresent(`${selector} option[value="${contractName}"]`) |
|
|
|
|
.click(`${selector} option[value="${contractName}"]`) |
|
|
|
|
.perform(() => this.emit('complete')) |
|
|
|
|
return this |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function selectContract (browser: NightwatchBrowser, contractName: string, callback: VoidFunction) { |
|
|
|
|
browser.click(`${selector} option[value="${contractName}"]`).perform(() => callback()) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
module.exports = SelectContract |
|
|
|
|