doh/runner (version 1.10)

Summary

Functions for registering and running automated tests.

Property Summary

Method Summary

Event Summary

Properties

_currentGroup
Defined by: doh/runner
_currentTest
Defined by: doh/runner
_errorCount
Defined by: doh/runner
_failureCount
Defined by: doh/runner
_groupCount
Defined by: doh/runner
_groups
Defined by: doh/runner
_init
Defined by: doh/_browserRunner
_initRobotCalled
Defined by: doh/robot
_line
Defined by: doh/runner
_paused
Defined by: doh/runner
_registerUrl
_setupGroupForRun
Defined by: doh/_browserRunner
_testCount
Defined by: doh/runner
_testTypes
Defined by: doh/runner
debug
Defined by: doh/_rhinoRunner
error
Defined by: doh/_rhinoRunner
isBrowser
Defined by: doh/_browserRunner
registerUrl
Defined by: doh/_browserRunner
robot
Defined by: doh/robot

Methods

_arrayEq(expected,actual)
Defined by doh/runner
Parameter Type Description
expected undefined
actual undefined
_AssertFailure(msg,hint)
Defined by doh/runner
Parameter Type Description
msg undefined
hint undefined
_calcTrialIterations(groupName,fixture)
Defined by doh/runner

This function determines the rough number of iterations to use to reach a particular MS threshold. This returns a deferred since tests can theoretically by async. Async tests aren't going to give great perf #s, though. The callback is passed the # of iterations to hit the requested threshold.

Parameter Type Description
groupName String
fixture Object

The test fixture we want to calculate iterations for.

_fixHeight()
Defined by doh/_browserRunner
_groupFinished(group,success)
Defined by doh/_browserRunner
Parameter Type Description
group undefined
success undefined
_groupStarted()
Defined by doh/_browserRunner
_handleFailure(groupName,fixture,e)
Defined by doh/runner
Parameter Type Description
groupName undefined
fixture undefined
e undefined
_jumpToLog(e)
Defined by doh/_browserRunner
Parameter Type Description
e undefined
_jumpToSuite(e)
Defined by doh/_browserRunner
Parameter Type Description
e undefined
_objPropEq(expected,actual)
Defined by doh/runner
Parameter Type Description
expected undefined
actual undefined
_registerTest(group,test,type)
Defined by doh/runner

add the provided test function or fixture object to the specified test group.

Parameter Type Description
group String

string name of the group to add the test to

test Function | String | Object

TODOC

type String
Optional

An identifier denoting the type of testing that the test performs, such as a performance test. If falsy, defaults to test.type.

_registerTestAndCheck(groupId,test,type,testArgPosition,args,setUp,tearDown)
Defined by doh/runner
Parameter Type Description
groupId undefined
test undefined
type undefined
testArgPosition undefined
args undefined
setUp undefined
tearDown undefined
_report()
Defined by doh/_rhinoRunner
_runFixture(groupName,fixture)
Defined by doh/runner
Parameter Type Description
groupName undefined
fixture undefined
_runPerfFixture(groupName,fixture)
Defined by doh/runner

This function handles how to execute a 'performance' test which is different from a straight UT style test. These will often do numerous iterations of the same operation and gather execution statistics about it, like max, min, average, etc. It makes use of the already in place DOH deferred test handling since it is a good idea to put a pause in between each iteration to allow for GC cleanup and the like.

Parameter Type Description
groupName String

The test group that contains this performance test.

fixture Object

The performance test fixture.

_runRegFixture(groupName,fixture)
Defined by doh/runner

Function to help run a generic doh test. Called from _runFixture(). These are not specialized tests, like performance groups and such.

Parameter Type Description
groupName String

The groupName of the test.

fixture Object

The test fixture to execute.

_testFinished(g,f,s)
Defined by doh/_browserRunner
Parameter Type Description
g undefined
f undefined
s undefined
_testRegistered(group,fixture)
Defined by doh/_browserRunner
Parameter Type Description
group undefined
fixture undefined
_testStarted(group,fixture)
Defined by doh/_browserRunner
Parameter Type Description
group undefined
fixture undefined
_updateGlobalProgressBar(p,success,group)
Defined by doh/_browserRunner
Parameter Type Description
p undefined
success undefined
group undefined
_updateTestList(group,fixture,unwindingBacklog)
Defined by doh/_browserRunner
Parameter Type Description
group undefined
fixture undefined
unwindingBacklog undefined
assertEqual(expected,actual,hint,doNotThrow)
Defined by doh/runner

are the passed expected and actual objects/values deeply equivalent?

Parameter Type Description
expected Object
actual Object
hint String
Optional
doNotThrow undefined
assertError(expectedError,scope,functionName,args,hint)
Defined by doh/runner

Test for a certain error to be thrown by the given function.

Parameter Type Description
expectedError Error object
scope Object
functionName String
args Array
hint String
Optional

Examples

Example 1

t.assertError(dojox.data.QueryReadStore.InvalidAttributeError, store, "getValue", [item, "NOT THERE"]); t.assertError(dojox.data.QueryReadStore.InvalidItemError, store, "getValue", ["not an item", "NOT THERE"]);

assertFalse(condition,hint)
Defined by doh/runner

is the passed item "falsey"?

Parameter Type Description
condition Object
hint String
Optional
assertNotEqual(notExpected,actual,hint)
Defined by doh/runner

are the passed notexpected and actual objects/values deeply not equivalent?

Parameter Type Description
notExpected Object
actual Object
hint String
Optional
assertTrue(condition,hint)
Defined by doh/runner

is the passed item "truthy"?

Parameter Type Description
condition Object
hint String
Optional
Deferred(canceller)
Defined by doh/runner
Parameter Type Description
canceller undefined
e(expectedError,scope,functionName,args,hint)
Defined by doh/runner

Test for a certain error to be thrown by the given function.

Parameter Type Description
expectedError Error object
scope Object
functionName String
args Array
hint String
Optional

Examples

Example 1

t.assertError(dojox.data.QueryReadStore.InvalidAttributeError, store, "getValue", [item, "NOT THERE"]); t.assertError(dojox.data.QueryReadStore.InvalidItemError, store, "getValue", ["not an item", "NOT THERE"]);

f(condition,hint)
Defined by doh/runner

is the passed item "falsey"?

Parameter Type Description
condition Object
hint String
Optional
is(expected,actual,hint,doNotThrow)
Defined by doh/runner

are the passed expected and actual objects/values deeply equivalent?

Parameter Type Description
expected Object
actual Object
hint String
Optional
doNotThrow undefined
isNot(notExpected,actual,hint)
Defined by doh/runner

are the passed notexpected and actual objects/values deeply not equivalent?

Parameter Type Description
notExpected Object
actual Object
hint String
Optional
pause()
Defined by doh/runner

halt test run. Can be resumed.

register(a1,a2,a3,a4,a5)
Defined by doh/runner
Parameter Type Description
a1 undefined
a2 undefined
a3 undefined
a4 undefined
a5 undefined
registerDocTests(module)
Defined by doh/runner

Deprecated. Won't work unless you manually load dojox.testing.DocTest, and likely not even then. Gets all the doctests from the given module and register each of them as a single test case here.

Parameter Type Description
module undefined

dojox/dgauges/components/utils

registerGroup(group,tests,setUp,tearDown,type)
Defined by doh/runner

Deprecated. Use doh.register(group/type, tests, setUp, tearDown) instead

Parameter Type Description
group String
tests Array | Function | Object
setUp Function
tearDown Function
type String
registerTest(group,test,type)
Defined by doh/runner

Deprecated. Use doh.register(group/type, test) instead

Parameter Type Description
group String
test Array | Function | Object
type String
registerTestNs(group,ns)
Defined by doh/runner

Deprecated. Use doh.register(group, ns) instead

Parameter Type Description
group String
ns Object
registerTests(group,testArr,type)
Defined by doh/runner

Deprecated. Use doh.register(group/type, testArr) instead

Parameter Type Description
group String
testArr Array
type String
registerTestType(name,initProc)
Defined by doh/runner

Adds a test type and associates a function used to initialize each test of the given type

Parameter Type Description
name String

The name of the type.

initProc Function

Type specific test initializer; called after the test object is created.

run()
Defined by doh/plugins/hello
runGroup(groupName,idx)
Defined by doh/runner

runs the specified test group

Parameter Type Description
groupName String
idx Integer
runOnLoad()
Defined by doh/runner
showLogPage()
Defined by doh/_browserRunner
showPerfTestsPage()
Defined by doh/_browserRunner
showTestPage()
Defined by doh/_browserRunner
t(condition,hint)
Defined by doh/runner

is the passed item "truthy"?

Parameter Type Description
condition Object
hint String
Optional
togglePaused()
Defined by doh/runner
toggleRunAll()
Defined by doh/_browserRunner

Events

_onEnd()
Defined by: doh/_browserRunner

Examples

Example 1

t.assertError(dojox.data.QueryReadStore.InvalidAttributeError, store, "getValue", [item, "NOT THERE"]); t.assertError(dojox.data.QueryReadStore.InvalidItemError, store, "getValue", ["not an item", "NOT THERE"]);

Error in the documentation? Can’t find what you are looking for? Let us know!