npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

sumo-api-automation

v2.0.13

Published

A package to automate the integation testing requiring minimal coding and setup.

Downloads

27

Readme

sumo-api-automation

A package to automate the integation testing requiring minimal coding and setup.

Installation

Install sumo-api-automation package with npm globally, run with sudo if access denied

  npm install -g sumo-api-automation

After installation, "sumotest" command will be available in your terminal to use.

Usage

sumotest init <some_path>

This will initialize a sample demo app and sample tests in the <some_path> directory.

If no path is passed, then it will be initialized in the current directory.

Running demo-app and sample-tests

  • Inside demo-app, install npm packages and run it
  cd demo_app
  npm install
  npm run start
  • In order to run the test cases run below command from another terminal window.
  sumotest run <path_where_tests_repo_clonned>

e.g.

  sumotest run ~/Documents/sumotestdemo/sample_tests
  • For generating test cases and env variables postman collection files, run below command to get the json files that can be imported in postman
  sumotest export -tr <path_where_tests_repo_clonned> -tdr <target_path>

e.g.

  sumotest export -tr ~/Documents/sumotestdemo/sample_tests -tdr ~/Documents/sumotestdemo/

Documentation

Prereq:- install node version 14 or above

How to use:-
1. make your entries in .env file
2. create directory with proper test name
3.create following files
    config.json (for api , expected status , type (get, post,put), context management)
    headers.json (for your rest api headers)
    request.json (for request body json)
    response.json (expected response)
4. run npm test
5. It will do a deep assert and present the result

Running integration tests in the DEV environment

kubectl port-forward -n dal-msk service/elasticsearch 9200:9200 &
API_BASE_PATH="SET YOUR PATH HERE" npm test
Single Test Execution
1. make sure TEST_NAME= "" in .env
2. run npm test , It will create and persist Context
3. set your test name TEST_NAME= "002_login_super_admin,001_Test" in .env
4. now run npm test , it will use previous context


```Features
1. Local Context

 {{RANDOM_EMAIL}} , {{RANDOM_NAME}},{{RANDOM_GUID}}
  --Use above anywhere , url , headers, request, response
  for multiple you can use like
  {{RANDOM_EMAIL1}} , {{RANDOM_NAME1}},{{RANDOM_GUID1}}
  {{RANDOM_EMAIL2}} , {{RANDOM_NAME2}},{{RANDOM_GUID2}}

2. Global Context (BDD)
   --in cofig-->responseConfig set values in gloabal conext like below

        "context_actions":[{"type":"set","to_key":"userId","from_key":"userId","scope":"global"}

   --in any subsiquent  request use like below in anywhere , url , headers, request, response

        {{__global_context.userId}}

3.How to debug
  For every test execution (pass , failed , errored), there is log file with name output.log
  Check this file for testing data

4.responseConfig
  This is most imporant featuer to understand
  -- Once response is recived it tells what needs to be done with it
  -- if you want to check Id is generated use like below

         "idField":"merchantId",
        "checkIdGeneration":true,

  --There always be some fields in response which you don't want to validate
    for this set following

         "skipFieldsInDeepAssert":["merchantId"],

  --For DeepAssertions set following

          "deepAssert":true,

Added "doNotValidateResponse":true in config. If this is set, no response will be validated, status will also not be validated. This is used to mostly create master data

added skip:true, in config.json. incase we want to skip that test case