Namespace: hobs

hobs

Classes

TestCase
TestStep
TestSuite

Namespaces

actions
Chaining
config
reporters
teststeps
utils

Methods


<static> cancelRun()

Cancel current global test run execution

See:

<static> context()

Returns the current test context, the window/iframe used to execute the tests

Properties:
Name Type Description
hobs.context() object

The context object.

Properties
Name Type Description
window window

The test window object.

document document

The document object of the test window.

loadEl DOMElement

The DOM Element embedding the test window (should be an iframe).

See:
Returns:

An object containing context properties (window, document, loadEl)

Type
object

<static> find(selector [, context])

Look for a DOM element in the current test window. Wraps a jQuery search

Parameters:
Name Type Argument Default Description
selector string

jQuery selector of the element to look for in the DOM of the test window

context Array | HTMLElement <optional>
hobs.context().document

Array of selectors in hierarchical order determining root context where the search for the given element will take place (default hobs.context().document)

Returns:

jQuery The list of elements found


<static> getRegisteredTestSuites()

REMARK: by default, a hobs.TestSuite is automatically registered to Hobbes on instantiation

Returns:

All the registered test suites in array

Type
Array.<hobs.TestSuite>

<static> getTestSuites()

REMARK: by default, a hobs.TestSuite is automatically registered to Hobbes on instantiation

Returns:

All the test suites in array

Type
Array.<hobs.TestSuite>

<static> log()

Polyfill log function

Parameters:
Type Argument Description
string <repeatable>
See:
  • hobs.config.debug To enable/disable debug logging

<static> navigate(url [, options])

Makes the test window/iframe navigate to the given url

Parameters:
Name Type Argument Default Description
url string

target URL (absolute or relative)

options object <optional>
false

If set to true, it will only check url, otherwise it will do both, if object is an integer {hobs.NAVIGATE_CHECKONLY|hobs.NAVIGATE_SKIPCHECK} accessibility via a HTTP GET request. The test window will not navigate

Fires:

<static> param(name [, value])

Parameters:
Name Type Argument Description
name string

The name of the dynamic parameter to set/get

value * <optional>

If not null, the parameter of the given name will be set to this value. If null, The value of the given param will be returned


<static> registerCustomActions(ns, actions)

Register custom test actions under a specific namespace

Parameters:
Name Type Description
ns string

Namespace name to add in chaining process of hobs.TestCase

actions Array.<hobs.TestStep>

Array of actions to add under the given namespace


<static> result()

Returns:

The result object of the last call of hobs.runTest

Type
object

<static> runTest( [testSuite] [, testCase] [, options])

Execute registered tests.

Parameters:
Name Type Argument Description
testSuite string <optional>

Name of the test suite to execute

testCase string <optional>

Name of the test case to execute

options object <optional>

Extra options passed to the execution

Examples

Execute all test cases of all test suites

hobs.runTest()
// or
hobs.runTest(null, null)

Execute all tests of a specific test suite

hobs.runTest('testsuite name')

Execute a specific test of a specific test suite

hobs.runTest('testsuite name', 'testcase name')

<static> setContext(ctx)

Defines the test context, the window used to execute the tests.

Parameters:
Name Type Description
ctx window | iframe

The window or iframe object where the tests will be executed

See:

Events


CONTEXT_NAVIGATION_LOAD

Navigation event.

See:

CONTEXT_NAVIGATION_LOAD_ERROR

Navigation error event.

Properties:
Name Type Description
xhr Object

XML Http Request object

See: