Code Monkey home page Code Monkey logo

postman-reporter's Introduction

Postman testing standalone HTML generator and newman reports parser


The intention of this simple PHP scripts is to generate a Standalone HTML for your Postman tests that you can send to the client without the need to upload all the tests in the open internet.

We find Postman a great tool for testing APIs and any web content in general.

How to use

Simply export your Collection with Postman to the directory where you cloned this repo. Update the collection name in postman-collection-documentor.php

$jsonFilename = 'Your.postman_collection.json';

And execute postman-collection-documentor anywhere in your intranet to see it on a browser.

If you want to save the html to send per Email, then simply run:

php postman-collection-documentor.php >example/skygate-documentation.html

There is in the examples folder the resultant html and also a screenshot.

Now there is another feature if you need to automatize this tests and save the results in a DB that is: postman-run-importer.php

This requires to create 2 Tables and a database. Put this DB credentials directly in the file. When executed it will read the /newman generated files when you set the report output to json and import them in the DB.

newman run Your.postman_collection.json -e env.json -r json

Imports the file in 2 tables, report-resume and report (contains a row per test) At the moment is a simple example that supports only saving the same test one time per hour, but is a good start to make something more powerful.

How to customize the HTML

There are 3 templates, one includes the other :

1 - MAIN:  postman-collection-template
2 - Folder postman-folder-loop
3 - Item   postman-item-loop (Every test)

Editing the HTML there you can easily customize this to any other layout.

NOTE: This parser expects that test are organized in Folders. If they are not, then the postman-collection-documentor.php should be modified accordingly.

Please share your own corrections and reporting to contribute in the mission. Thanks for your interest,

Martin Fasani

postman-reporter's People

Contributors

martinberlin avatar

Watchers

James Cloos avatar Patrick Groot avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.