1.0.3 • Published 3 years ago

codeceptjs-expectwrapper v1.0.3

Weekly downloads
102
License
ISC
Repository
github
Last release
3 years ago

Introduction

This is an expect-wrapper that you can use with CodeceptJS. This is done using CodeceptJS https://codecept.io/

Installation

This requires Node.js v8+ to run.

cd codeceptjs-project
npm i codeceptjs-expectwrapper

How to use

Open your step_file.ts

const { actor } = require('codeceptjs');
const faker = require('faker');
import ex from 'codeceptjs-expectwrapper'; // import it here

export = function () {
    return actor({
        async createNewUser(userData:object) {
            let payload = userData || {
                name: faker.name.firstName(),
                job: 'leader'
            };

            return this.sendPostRequest('/api/users', payload);
        }
    , ...ex}); // add it to actor object so that it can be used and showed when typing I (auto complete for actor I).
}

Here is the image showing how it is in action:

auto complete for I actor