MicroFrontends Classroomnotes 01/Apr/2022

Organizing Tests

  • To handle Multiple Environments for testing the APIs where we might have different urls where the api is hosted, we need to parametrize the base url
  • Lets Create an Environment in Postman
    Preview
    Preview
  • Now Navigate to the request select the environment and replace the hardcoded path with an environment variable created
    Preview
    Preview

  • Collection Variables:

    • We can also store variables in collection.
    • Its often a good idea to create a variables in collection with default values and make changes necessary as per environment in environments
      Preview
      Preview
      Preview
  • We now know of two different places to store variables in Postman (environments and collections), There are other places where your can store variables which we would be learning in subsequent sessions.
  • In the broadest to narrowest scope (Represents where you have store the variable) they are as follows

    • Global
    • Collection
    • Environment
    • Data
    • Local
  • Other Areas to be explored

    • Logging
    • Reporting
  • Console is an area where we can see the logs
    Preview

Exercise: Quality thought Reception wants to go paper less

  • The idea is to build a front end which is tab friendly or kiosk friendly
  • From the front end the student will enter his details
    • email id
    • phone number
    • courses interested in
  • This information should be stored in some data store
    Preview
  • Can you design/think of how the rest api for entering the above mentioned information should be and what should be response.
  • Method: POST as we need to send the information which will create a new record
  • Request structure:
    • type: json
    • body: The json structure of the request will be as shown below
      json
      {
      "name": ".......",
      "emailId": ".........",
      "mobileNumber": "..........",
      "datetime": "...........",
      "courses": ["...", "..."]
      }
  • Response:
    • type: json
    • status code: 201
    • response body:
      json
      {
      "message": "The information is recorded, thanks"
      }
  • URI: {{baseurl}}/enquiry
  • If there is some structure to document this information of API Design Specification, it can be easy for the backend developers to develop an API, Front end developers to consume an API and testers to test an API
  • The most widely adopted API Specification format is OpenAPI 3.x (which was formerly called as swagger).
    Preview
    Preview
    Preview
    Preview
    Preview

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

About continuous learner

devops & cloud enthusiastic learner