Namespace: utils

hobs. utils

Hobbes.js utilities

Namespaces

dom
hapi

Methods


<static> elementsFromPoint(x, y [, document])

https://gist.github.com/7265412 Get stack of DOM elements present at x,y coordinates

Parameters:
Name Type Argument Default Description
x int

the x coordinate, in pixels

y int

the y coordinate, in pixels

document DOMElement <optional>
hobs.context().document

the document in which elements are looking for

Returns:

An array of all the DOM elements found at given coordinates

Type
Array.<DOMElement>

<static> metadataFilter(testsuite, withMetadata)

Remove all steps (TestCase and TestSuite) from the given TestSuite that are not matching the given metadata object

Parameters:
Name Type Description
testsuite hobs.TestSuite

to be filtered

withMetadata object

the object containing the metadata properties and values that should match

Returns:

void, nothing is returned as the given testsuite is directly modified.


<static> resumeFilter(allSteps, resumePath)

Remove all steps (TestCase and TestSuite) that appear before the targeted TestCase path provided as array of names. if the path is not found , then allSteps should be cleared. if the path is found, all the remaining steps to execute should be still part of the allSteps.

Parameters:
Name Type Description
allSteps array

the array of steps to be filtered

resumePath array

the array of name representing the path (i.e path = /a/b/c = [ "a", "b", "c"] = "c" as testcase in testsuite "b", which is itself in testsuite "a"

Returns:

true if the path was found and it removed the steps that are not relevant to execute.

Type
boolean

<static> safeApplyFn(fn [, context] [, params])

Safely executes a function (function execution wrapped in a try catch block)

Parameters:
Name Type Argument Default Description
fn function

the function to execute

context * <optional>
this

the execution context of the function

params Array <optional>

The array of parameters to pass to the function

Returns:

A promise

Type
Promise