Base class for all CodeceptJS helpers. This class has been moved into a separate package to allow other helpers to be extended from it, without requiring main codeceptjs package.
npm i @codeceptjs/helper --save
Create CodeceptJS helper as described in documentation.
const Helper = require('@codeceptjs/helper');
class MyHelper extends Helper {
// implement custom helper here
}
- Helper
Abstract class. Helpers abstracts test execution backends.
Methods of Helper class will be available in tests in I
object.
They provide user-friendly abstracted actions over NodeJS libraries.
Hooks (methods starting with _
) can be used to setup/teardown,
or handle execution flow.
Methods are expected to return a value in order to be wrapped in promise.
config
any
Abstract method to validate config
config
any
Returns any
Sets config for current test
opts
any
Hook executed before all tests
Hook executed before each test.
test
Mocha.Test
Hook executed after each test
Hook provides a test details Executed in the very beginning of a test
test
Mocha.Test
Hook executed after each passed test
test
Mocha.Test
Hook executed after each failed test
test
Mocha.Test
Hook executed before each step
step
CodeceptJS.Step
Hook executed after each step
step
CodeceptJS.Step
Hook executed before each suite
suite
Mocha.Suite
Hook executed after each suite
suite
Mocha.Suite
Hook executed after all tests are executed
suite
Mocha.Suite
Abstract method to provide common interface to accessing helpers internals inside a test.
description
fn
Access another configured helper: this.helpers['AnotherHelper']
Type: any
Print debug message to console (outputs only in debug mode)
msg
string
Abstract method to provide required config options
Returns any