new Steps()
Creates new instance of Steps
class.
- Mixes In:
- Source:
Properties:
Name | Type | Description |
---|---|---|
ctx |
object | Storage to share some data between steps. |
Methods
-
<static> getInstance( [cls])
-
Helper to get steps instance.
It wraps steps class with proxy object. Proxy observes steps call and in debug mode if steps is failed it entered test to interactive debug mode.
Parameters:
Name Type Argument Description cls
function <optional>
Class with steps. By default original glace
Steps
will be used.- Source:
Returns:
Wrapped steps instance.
- Type
- Proxy
-
<static> register(steps)
-
Registers steps (mixes them).
Parameters:
Name Type Argument Description steps
object <repeatable>
Sequence of steps to register.
- Source:
Example
var MyStepsMixin = require("./my-steps-mixin"); var AnotherStepsMixin = require("./another-steps-mixin"); Steps.register(MyStepsMixin, AnotherStepsMixin);
-
<async> debug()
-
Step to enter to interactive debugging mode. May be used inside test if you need to debug test in runtime.
- Source:
Returns:
- Type
- Promise.<void>
Example
test("my test", () => { chunk(async () => { await $.debug(); }); });
-
isTestFailed()
-
Helper to check whether test was failed before current step.
- Source:
Returns:
undefined
if test is absent,true
if test was failed,false
otherwise.- Type
- undefined | boolean
-
listSteps(filter [, namesOnly])
-
Step to list available steps [debug mode].
Parameters:
Name Type Argument Default Description filter
string Steps filter.
namesOnly
boolean <optional>
false Search among step names only. By default full-text search is used.
- Source:
-
resetCtx()
-
Helper to reset steps context.
- Source: