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.
configany
Abstract method to validate config
configany
Returns any
Sets config for current test
optsany
Hook executed before all tests
Hook executed before each test.
testMocha.Test
Hook executed after each test
Hook provides a test details Executed in the very beginning of a test
testMocha.Test
Hook executed after each passed test
testMocha.Test
Hook executed after each failed test
testMocha.Test
Hook executed before each step
stepCodeceptJS.Step
Hook executed after each step
stepCodeceptJS.Step
Hook executed before each suite
suiteMocha.Suite
Hook executed after each suite
suiteMocha.Suite
Hook executed after all tests are executed
suiteMocha.Suite
Abstract method to provide common interface to accessing helpers internals inside a test.
descriptionfn
Access another configured helper: this.helpers['AnotherHelper']
Type: any
Print debug message to console (outputs only in debug mode)
msgstring
Abstract method to provide required config options
Returns any