Namespace: tester

PFT. tester

Source:

Namespaces

assert

Members

<static> timeOutAfter

Properties:
Name Type Argument Default Description
timeOutAfter number <optional>
PFT.DEFAULT_TIMEOUT the default max amount of time allowed for tests to run before they are marked as a fail. this can be overridden for a specific test by passing a 'maxDuration' option to the PFT.tester.test function
Source:

Methods

<static> closeTest()

function will close out the currently running test objects, but any async tasks will continue running.
Source:

<static> currentSuite()

function will get the current suite in use. this is primarily used for associating a suite with a test
Source:

<static> currentTest()

function will get the currently executing test
Source:

<static> onAssertionFailure(details)

function hook that is called when an assertion fails
Parameters:
Name Type Description
details Object an object containing a 'test' property for the currently started test object and a 'message' property for the failure message
Source:

<static> onError()

function hook that is called when there is a test error
Source:

<static> onExit()

function hook that is called when program exits
Source:

<static> onPageError()

function hook that is called when the underlying page experiences an error
Source:

<static> onTestCompleted(details)

function hook that is called when a test completes. this includes anything resulting in PFT.tester.done being called
Parameters:
Name Type Description
details Object an object containing a 'test' property for the currently started test object
Source:

<static> onTestStarted(details)

function hook that is called when a new test is started
Parameters:
Name Type Description
details Object an object containing a 'test' property for the currently started test object
Source:

<static> onTimeout()

function hook that is called when a test times out
Source:

<static> run(name, callback, timeout)

function will schedule the passed in testCallback for execution. When the test is complete it MUST call one of PFT.tester.assert.done, PFT.tester.assert.pass, PFT.tester.assert.fail or an assertion must fail to indicate that the next test should proceed.
Parameters:
Name Type Argument Default Description
name string the name of the test
callback testCallback the function to execute as a test. when executed this function will be passed two arguments, a PhantomJs.Webpage.Page, and a PFT.tester.assert object referencing the test
timeout Number <optional>
PFT.DEFAULT_TIMEOUT the maximum time in milliseconds to allow the test to execute before it is marked as a fail. this time includes any setup and teardown that is specified
Source: