1.0.2 • Published 3 years ago

nashak v1.0.2

Weekly downloads
-
License
ISC
Repository
-
Last release
3 years ago

alt text

nashak

nashak is someone or something that destroys. In the true spirit of software testing, a tester or a test program must destroy or annihilate the software to a great extent such that the developer shall have a tough time and uphill task to make it up again.

Introduction

nashak is a test automation software by the developers, for the developers. nashak allows you to define your testcases in an excel file using a Behavior Driven Testing paradigm. You define your test cases using the popular "given", "when", "then" format along with a few additional columns, which define the input payload, expected response, and a module.function name that executes the test case.

That's it. You are ready to go...

Philosophy

This tool assumes that you know behavior-driven testing concept, a.k.a Given-When-Then. If you are new to given-when-then, see these links:

Below is a sample of how to write test cases in excel using g-w-t format. npm.io

You essentially need to have these mandatory columns and contents as explained below:

  • id => identifies the test case number. This should be a running serial number without overlaps or breaks
  • given => The test case scenario (part of the given-when-then trio).
  • when => the event or 'when' part of the gwt
  • then => the 'then' part of gwt
  • input payload => The test case input (currently supported is json format) for this test case
  • expected result => the expected output from test case execution
  • executor => the javascript /nodejs module file and the exported function therein.

Quick Start

Install

npm install --save nashak

Basic Usage

const nashak = require('nashak');
const opts = Object.assign({}, args, {
    startRow: 1,            // start execution from row 1
    endRow: 100,            // execute test cases until row 100
    
    // Columns layout
    givenColumnNo: 2,         // our given column is 2nd
    whenColumnNo: 3,          // when is 3rd
    thenColumnNo: 4,          // then is 4th
    inputColumnNo: 5,         // input payload is at 5th
    expectedColumnNo: 6,      // expected result at 6th; and
    executorColumnNo: 7       // executor at 7th
});

var excelFile = "./test-cases.xlsx";
nashak.run(excelFile, opts)
    .then(() => {
        console.log("Successfully finished execution.");
    })
    .catch((e) => {
        console.error("Some failure while executing test cases:", e);
    })

Features

nashak is a test runner that executes any number of test cases defined in a Microsft xlsx file. 1. Run all test cases in the defined order in the excel file. 2. Run a specific test case by row number. 3. Run a range of test cases by providing start and end rows