2017-04-28 07:49:57 +00:00
|
|
|
import * as plugins from './tapbundle.plugins'
|
|
|
|
import { TapTest } from './tapbundle.classes.taptest'
|
|
|
|
|
|
|
|
export class TapTools {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* the referenced TapTest
|
|
|
|
*/
|
|
|
|
private _tapTest: TapTest
|
|
|
|
|
|
|
|
constructor(TapTestArg) {
|
|
|
|
this._tapTest = TapTestArg
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* allow failure
|
|
|
|
*/
|
2017-06-04 17:08:36 +00:00
|
|
|
allowFailure () {
|
2017-04-28 07:49:57 +00:00
|
|
|
this._tapTest.failureAllowed = true
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* async/await delay method
|
|
|
|
*/
|
2017-06-04 17:08:36 +00:00
|
|
|
async delayFor (timeMilliArg) {
|
2017-04-28 07:49:57 +00:00
|
|
|
await plugins.smartdelay.delayFor(timeMilliArg)
|
|
|
|
}
|
|
|
|
|
|
|
|
async timeout (timeMilliArg: number) {
|
|
|
|
await plugins.smartdelay.delayFor(timeMilliArg)
|
|
|
|
if (this._tapTest.status === 'pending') {
|
|
|
|
this._tapTest.status = 'timeout'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|