fastret-framework

1.0.3 • Public • Published

fastret-framework

Build Github Repo Size LICENSE NPM Downloads NPM Version Contributors Commit

Fastest rest api test suite builder

Give us a ⭐️ if you like our work ❤️

Install

$ npm install fastret-framework --save

Usage

const FastRet = require('fastret-framework');
 
const TEST_API = [
  {
    'name': 'GET API TEST',
    'url': 'https://jsonplaceholder.typicode.com/todos/1',
    'headers': {},
    'body': {},
    'method': 'GET',
    'skip_keys': ['title'],
    'response': {
      'userId': 1,
      'id': 1,
      'title': 'delectus aut aute',
      'completed': false
    }
  },
  {
    'name': 'GET API WRONG TEST',
    'url': 'https://jsonplaceholder.typicode.com/todos/2',
    'headers': {},
    'body': {},
    'method': 'GET',
    'skip_keys': ['title'],
    'response': {
      'userId': 1,
      'id': 1,
      'title': 'delectus aut aute',
      'completed': false
    }
  }
];
 
const fastRetSuite = new FastRet(TEST_API);
 
// Executes all the tests
fastRetSuite.execute();
 
// Output
// ✔ Passed: GET API TEST
// ✖ Failed: GET API WRONG TEST
 

API

execute()

Executes all the tests, shows test results in console. Also stores all the test results in results

isValid()

Validates if the input json contains all the required parameters

this.data

Contains the complete input test json

this.results

Contains all the tests results of execute() api

Data Structure
{
  "name": "NAME_OF_THE_API",
  "isPassed": "PASSED_STATUS",
  "errorMessage": "ERROR_MESSAGE" // if api failed with some error message
}

This gets updated once execute api is completed.

Contributing

Interested in contributing to this project? You can log any issues or suggestion related to this library here

Read our contributing guide on getting started with contributing to the codebase

Contributors

Thank you to all the contributors who have helped us in making this project better 🙌

Package Sidebar

Install

npm i fastret-framework

Weekly Downloads

4

Version

1.0.3

License

MIT

Unpacked Size

11.9 kB

Total Files

9

Last publish

Collaborators

  • arshadkazmi42