Dalek.Unit Class
Generates an test instance
Item Index
Methods
- _emitAssertionStatus
- _emitConcreteTestFinished
- _emitTestFinished
- _inheritAssertions
- _inheritAssertions
- _inheritAssertions
- _onDriverMessage
- _reportTestStarted
- _testFin
- _testFinished
- _testStatus
- andThen
- checkAssertions
- checkExpectations
- data
- done
- expect
- incrementExpectations
- incrementFailedAssertions
- node
- promise
- start
Methods
_emitAssertionStatus
()
private
chainable
Emits an event that describes the current state of all assertions
_emitConcreteTestFinished
()
private
chainable
Emits an event, that the current test run has been finished
_emitTestFinished
()
private
chainable
Emits an event that describes the current state of all assertions. The event should be fired when a test is finished
_inheritAssertions
-
test
Copies assertion helper methods
Parameters:
-
test
TestInstacne of test
_inheritAssertions
-
test
-
opts
Set up the instance
Parameters:
-
test
TestInstacne of test
-
opts
ObjectOptions
_inheritAssertions
-
test
Copies assertion methods
Parameters:
-
test
TestInstacne of test
_onDriverMessage
-
data
Checks if the test run is complete & emits/resolves all the needed events/promises when the run is complete
Parameters:
-
data
ObjectData that is returned by the driver:message event
_reportTestStarted
-
name
Emits the test started event
Parameters:
-
name
StringName of the test
_testFin
()
Object
private
Kicks off the test & binds all promises/events
Returns:
promise A promise
_testFinished
-
result
Emits the test finished events & resolves all promises when its done
Parameters:
-
result
ObjectPromised result var
Returns:
result Promised result var
_testStatus
()
Bool
private
chainable
Get the overall test status (assertions & expectation)
Returns:
status The test status
andThen
-
a
Allow to use custom functions in order to embrace code reuse across multiple files (for example for use in Page Objects).
Parameters:
-
a
Functionfunction, where 'this' references the test
checkAssertions
()
Bool
Checks if all runned assertions passed
Returns:
assertionFailed Any expectation failed
checkExpectations
()
Bool
Checks if the runned tests fullfill the set expectations or if no expectations were raised
Returns:
checkedExpectations Expectations match
data
-
key
-
value
Global data store (works between the node & browser envs)
Parameters:
-
key
String | NumberKey to store or fetch data
-
value
Mixedoptional Data that should be stored
Returns:
Data that has been stored
done
()
Object
private
Sets up all the bindings needed for a test to run
Returns:
result A promise
expect
-
expecatation
Specify how many assertions are expected to run within a test. Very useful for ensuring that all your callbacks and assertions are run.
Parameters:
-
expecatation
IntegerNumber of assertions that should be run
incrementExpectations
()
chainable
Increment the number of executed assertions
incrementFailedAssertions
()
chainable
Increment the number of failed assertions
node
-
a
Adds a node style function (with node err callback) style to the test.
Parameters:
-
a
Functionnode function that is executed in the context of the test.
promise
-
a
Adds a promise to the chain of tests.
Parameters:
-
a
Promiseq promise
start
()
chainable
Alias for 'andThen'; use if it is the first function called in the test case.