GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - codeceptjs/helper: Base class for CodeceptJS helpers

BranchesTags
Open more actions menu

Latest commit

 

History

26 Commits
26 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
src
src
 
 
tests
tests
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
jest.config.js
jest.config.js
 
 
package.json
package.json
 
 
tsconfig.json
tsconfig.json
 
 

Repository files navigation

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 --save

Usage

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
    • Parameters
    • _validateConfig
      • Parameters
    • _setConfig
      • Parameters
    • _init
    • _before
      • Parameters
    • _after
    • _test
      • Parameters
    • _passed
      • Parameters
    • _failed
      • Parameters
    • _beforeStep
      • Parameters
    • _afterStep
      • Parameters
    • _beforeSuite
      • Parameters
    • _afterSuite
      • Parameters
    • _finishTest
      • Parameters
    • _useTo
      • Parameters
    • helpers
    • debug
      • Parameters
    • debugSection
      • Parameters
    • _config

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

  • config any

_validateConfig

Abstract method to validate config

Parameters
  • config any

Returns any

_setConfig

Sets config for current test

Parameters
  • opts any

_init

Hook executed before all tests

_before

Hook executed before each test.

Parameters
  • test Mocha.Test

_after

Hook executed after each test

_test

Hook provides a test details Executed in the very beginning of a test

Parameters
  • test Mocha.Test

_passed

Hook executed after each passed test

Parameters
  • test Mocha.Test

_failed

Hook executed after each failed test

Parameters
  • test Mocha.Test

_beforeStep

Hook executed before each step

Parameters
  • step CodeceptJS.Step

_afterStep

Hook executed after each step

Parameters
  • step CodeceptJS.Step

_beforeSuite

Hook executed before each suite

Parameters
  • suite Mocha.Suite

_afterSuite

Hook executed after each suite

Parameters
  • suite Mocha.Suite

_finishTest

Hook executed after all tests are executed

Parameters
  • suite Mocha.Suite

_useTo

Abstract method to provide common interface to accessing helpers internals inside a test.

Parameters
  • description
  • fn

helpers

Access another configured helper: this.helpers['AnotherHelper']

Type: any

debug

Print debug message to console (outputs only in debug mode)

Parameters
  • msg string

debugSection

Parameters
  • section string
  • msg string

_config

Abstract method to provide required config options

Returns any

About

Base class for CodeceptJS helpers

Resources

Readme
MIT license
Activity
Custom properties

Stars

1 star

Watchers

3 watching

Forks

4 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.