Giter Club home page Giter Club logo

requestgen's Introduction

requestGen ._.

Current In Progress feature: GUI Version

Data gen utility for da test team. Inspired by Mati's JS script to make the plans for the save req easier to use. This is half-baked python approach with some easy to maintain dictionaries for the plan data, the plan data can even be initially generated with Mati's script and update the dictionary with that.

User Interface

A simple UI made with Tkinter, should make the user of this even easier. Still requires setting up the cfg.json file before using.

The plans for 2021 and 2022 for both APTC and QHP can be stored in the script and consumed on-demand by the parameters passed to the function.

Usage

  1. Rename the environment config file from cfg_sample.json to cfg.json and complete the values in that same file.
  2. Change the Plans array and populate with the plan values you need for testing, add those into the appropriate type and year.
  3. If you don't want to generate the HHID automatically, just set the "sendSaveReq": true, to "sendSaveReq": false,.
  4. Select the parameters to create your custom request.
  5. Click Generate button and it will generate the request for you to copy and also send it to the API to get an ID back! (Might not always be convenient, will add a switch to turn it off later.)
  6. Enjoy!

For example running the function with the following values:

# Parameters: year, zip, members, months, usage, type
generate_save_req(2021, 98178, 2, 1.5, ["Low", "Medium"], "QHP")

Will produce the following JSON code ready to be used in postman:

{
    "coverageYear": 2021,
    "zipCode": 98178,cfg_sample.json
    "noOfMembers": 2,
    "coverageMonths": 1.5,
    "medicalUse": "low",
    "prescriptionsUse": "medium",
    "plans": [
        {
            "id": "QHP218CA54786",
            "netPremium": 40.69
        },
        {
            "id": "QHP218CA54786",
            "netPremium": 40.69
        },
        {
            "id": "QHP218CA54786",
            "netPremium": 530.46
        },
        {
            "id": "QHP218CA54786",
            "netPremium": 530.46
        }
    ]
}

The script also communicates directly with end endpoint and returns the ID generated for the request crafted.

[API POST Request -> SavehouseholdId Endpoint]: Sending request to the endpoint...
[API Response -> HouseholdId Generated]: {"householdId":"1dbc6b36-XXX-XXXX-95ba-12e6efff6a4b"}

Nice to have features

  • Add support for Anonymous or registered user
  • Fully configure commandline arguments support to generate batches of data
  • Export the generated req in JSON

@tzero86

requestgen's People

Contributors

tzero86 avatar

Watchers

James Cloos avatar  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.