Package Exports
- @codeceptjs/helper
- @codeceptjs/helper/dist/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@codeceptjs/helper) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
CodeceptJS Helper
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.
Installation
npm i @codeceptjs/helper --saveUsage
Create CodeceptJS helper as described in documentation.
const Helper = require('@codeceptjs/helper');
class MyHelper extends Helper {
// implement custom helper here
}API
Table of Contents
- Helper
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.
Parameters
configany
_validateConfig
Abstract method to validate config
Parameters
configany
Returns any
_setConfig
Sets config for current test
Parameters
optsany
_init
Hook executed before all tests
_before
Hook executed before each test.
Parameters
testMocha.Test
_after
Hook executed after each test
_test
Hook provides a test details Executed in the very beginning of a test
Parameters
testMocha.Test
_passed
Hook executed after each passed test
Parameters
testMocha.Test
_failed
Hook executed after each failed test
Parameters
testMocha.Test
_beforeStep
Hook executed before each step
Parameters
stepCodeceptJS.Step
_afterStep
Hook executed after each step
Parameters
stepCodeceptJS.Step
_beforeSuite
Hook executed before each suite
Parameters
suiteMocha.Suite
_afterSuite
Hook executed after each suite
Parameters
suiteMocha.Suite
_finishTest
Hook executed after all tests are executed
Parameters
suiteMocha.Suite
_useTo
Abstract method to provide common interface to accessing helpers internals inside a test.
Parameters
descriptionfn
helpers
Access another configured helper: this.helpers['AnotherHelper']
Type: any
debug
Print debug message to console (outputs only in debug mode)
Parameters
msgstring
debugSection
Parameters
_config
Abstract method to provide required config options
Returns any