Merge pull request #4260 from ethereum/fix_using_web3_checkers_2
fix using checkRevertBeforeSending and ignoreGasPricingpull/5370/head
commit
6b8bb26dc7
@ -0,0 +1,28 @@ |
||||
import { NightwatchBrowser } from 'nightwatch' |
||||
import EventEmitter from 'events' |
||||
|
||||
class waitForElementNotContainsText extends EventEmitter { |
||||
command (this: NightwatchBrowser, id: string, value: string, timeout = 10000): NightwatchBrowser { |
||||
let waitId // eslint-disable-line
|
||||
let currentValue |
||||
const runid = setInterval(() => { |
||||
this.api.getText(id, (result) => { |
||||
currentValue = result.value |
||||
if (typeof result.value === 'string' && result.value.indexOf(value) !== -1) { |
||||
clearInterval(runid) |
||||
clearTimeout(waitId) |
||||
this.api.assert.ok(false, `WaitForElementContainsText ${id} contains ${value} . It should not`) |
||||
this.emit('complete') |
||||
} |
||||
}) |
||||
}, 200) |
||||
|
||||
waitId = setTimeout(() => { |
||||
clearInterval(runid) |
||||
this.api.assert.ok(true, `"${value}" wasn't found.`) |
||||
}, timeout) |
||||
return this |
||||
} |
||||
} |
||||
|
||||
module.exports = waitForElementNotContainsText |
Loading…
Reference in new issue