Skip to content

StefRuseva88/postman-collections

Repository files navigation

Postman API Tests

JavaScript Postman Swagger Trello Newman

This is a test project for Back-End Test Automation March 2024 Course @ SoftUni


Overview

This repository contains Postman collections and reports generated by Newman for the Postman collections. These reports provide detailed information about the test runs and can be useful for debugging and analysis.

Prerequisites

Installation and Usage

Postman for API Testing

Postman is a powerful tool used to test APIs by sending HTTP requests to various endpoints. It provides an intuitive interface where you can specify the URL, choose an HTTP method (like GET or POST), and add headers, parameters, or body data as needed. After setting up the request, simply hit the "Send" button to get an immediate response from the API. Postman allows you to easily check if APIs are functioning correctly, making it a great tool for debugging and ensuring reliable performance.

  1. Download and install Postman from the official website.
  2. Open Postman and create a new request by selecting the HTTP method and entering the endpoint URL.
  3. Add necessary headers, parameters, and body data.
  4. Click on the "Send" button to make the request and view the response.

Automation Scripts

Within Postman, you can enhance your API tests by writing automation scripts. These scripts run either before a request is sent (pre-request scripts) or after receiving a response (test scripts). For example, you can automate tasks like setting up dynamic data or validating specific responses. This makes your testing more efficient and accurate, reducing manual effort. Postman’s scripting feature helps you automate repetitive tasks and manage complex testing scenarios with ease.

  1. Open Postman and navigate to the collection or request where you want to add the script.
  2. Go to the Pre-request Script or Tests tab.
  3. Write or paste the automation script.
  4. Save and run the collection or request to see the script in action.

Newman for Command-Line Testing

Newman is a command-line tool that extends Postman’s capabilities by allowing you to run collections of API tests directly from the terminal. This is particularly useful for automating tests in a continuous integration or deployment (CI/CD) pipeline. After installing Newman, you can run your Postman collections from the command line with a single command, even generating detailed reports to analyze the results. Newman allows you to scale and automate your API testing for large projects or teams.

  1. Install Node.js from the official website.

  2. Install Newman using npm:

    npm install -g newman
  3. Run a Postman collection using Newman:

    newman run path/to/your/collection.json
  • You can also generate HTML reports:

    newman run path/to/your/collection.json -r htmlextra

Exploring APIs with Swagger

Swagger provides a user-friendly interface for exploring and interacting with APIs. It offers detailed documentation, helping you understand each endpoint, the required parameters, and the expected response formats. By simply visiting the Swagger UI of an API, you can easily test different API endpoints and see how they work, making it a valuable tool for developers who are learning about or working with new APIs.

  • Access the Swagger UI by navigating to the Swagger endpoint URL, typically provided by the API you are testing.
  • Use the Swagger UI to explore and interact with the API endpoints.
  • View the detailed API documentation, including the available endpoints, request parameters, and response formats.

Trello API Integration

The Trello API allows you to interact with your Trello boards programmatically. Using Postman, you can send requests to create cards, update lists, or manage your boards directly from your API tests. This functionality is ideal for automating project management tasks, and with Postman collections, you can run these operations repeatedly in different test environments.

Content

  • Trello API Postman Collection & Newman Report
  • IdeaCenter API Postman Collection
  • Story Spoil API Postman Collection
  • Foody API Postman Collection
  • Revue Crafters API Postman Collection

Contributing

Contributions are welcome! If you have any improvements or bug fixes, feel free to open a pull request.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Contact

For any questions or suggestions, please reach out to me or open an issue in the repository.