Commit 73115fd3 authored by ioedeveloper's avatar ioedeveloper

Added transactionExecution tests

parent a0621db3
import EventEmitter from "events"
import EventEmitter from 'events'
import { NightwatchBrowser } from 'nightwatch'
class checkElementStyle extends EventEmitter {
......
import EventEmitter from 'events'
import { NightwatchBrowser } from 'nightwatch'
class CheckTerminalFilter extends EventEmitter {
command (this: NightwatchBrowser, filter: string, test: string): NightwatchBrowser {
this.api.perform((done) => {
checkFilter(this.api, filter, test, () => {
done()
this.emit('complete')
})
})
return this
}
}
function checkFilter (browser: NightwatchBrowser, filter: string, test: string, done: VoidFunction) {
if (browser.options.desiredCapabilities.browserName === 'chrome') { // nightwatch deos not handle well that part.... works locally
done()
return
}
const filterClass = '[data-id="terminalInputSearch"]'
browser.setValue(filterClass, filter, function () {
browser.execute(function () {
return document.querySelector('[data-id="terminalJournal"]').innerHTML === test
}, [], function (result) {
browser.clearValue(filterClass).setValue(filterClass, '', function () {
if (!result.value) {
browser.assert.fail('useFilter on ' + filter + ' ' + test, 'info about error', '')
}
done()
})
})
})
}
module.exports = CheckTerminalFilter
This diff is collapsed.
......@@ -49,7 +49,8 @@ declare module "nightwatch" {
clickElementAtPosition(cssSelector: string, index: number): NightwatchBrowser,
notContainsText(cssSelector: string, text: string): NightwatchBrowser,
sendLowLevelTx(address: string, value: string, callData: string): NightwatchBrowser,
journalLastChild(val: string): NightwatchBrowser
journalLastChild(val: string): NightwatchBrowser,
checkTerminalFilter(filter: string, test: string): NightwatchBrowser
}
export interface NightwatchBrowser {
......
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