A QA API Test on the Platzi Fake Store API with an Automated Script and a Mock Server for Practicing API Testing and Parallel Development.
This repository contains a Postman Collection for automated QA testing of a RESTful API simulating real-world e-commerce operations.
It tests core CRUD functionalities, API data validations, pagination, and related product queries — useful for banking, financial, and retail-style APIs.
This project includes a Postman Mock Server to simulate API responses when the real API is unavailable or for isolated testing.
The collection is designed with:
- Dynamic Variables for flexible testing between live and mock environments.
- Pre-request Scripts for environment setup.
- Postman Tests for automated response validation.
- Chained Requests to simulate realistic API workflows.
- Environment Switching: Automatically falls back to a Mock Server if the main API is unavailable.
- Data Validation: Checks for required keys, correct data types, ISO 8601 date formats, and valid URLs.
- CRUD Operations:
- GET all products, by ID, by Slug
- POST create a product
- PUT update a product
- DELETE a product
- Pagination Tests
- Related Product Endpoints Testing
- Custom HTML Visualizations for better test reporting inside Postman.
REST_API_QATesting.postman_collection.json # Postman Collection File
REST_API_QATesting_ENV.postman_environment.json # Postman Enviroment File
Mocking_Platzi.postman_collection.json # Mock Server Configuration
- Open Postman
- Click Import
- Select Folder And Find
REST_API_QATesting
- BaseURL → https://api.escuelajs.co
- MockURL → https://.mock.pstmn.io
- OrginalURL → https://api.escuelajs.co
- In Postman, open and Select the environment linked to this collection.
- Change BaseURL Value To MockURL
- Run the collection normally — all requests will be served from the mock server instead of the live API.
- Offline Testing – Run tests without internet or backend availability.
- Stable Responses – Consistent API responses for regression testing.
- Faster Development – Frontend and QA teams can work without waiting for backend readiness.
- Select the environment.
- Click Runner and execute the collection.
- View detailed test results and HTML visualizations.
- GetAllProducts → Validates product list & saves IDs/Slugs.
- GetProductsById → Verifies product details match saved variables.
- GetProductsBySlug → Confirms slug-based product retrieval.
- CreateProducts → Adds a sample product (PlayStation 5).
- UpdateProductWithId → Updates the created product Price.
- DeleteProductWithId → Deletes the product and verifies deletion.
- GetProductRelatedById / Slug → Tests related products.
- PaginationProduct → Ensures pagination works as expected.
-
Required Keys Check:
pm.test("Each product has required keys", function () { const jsonData = pm.response.json(); jsonData.forEach(product => { pm.expect(product).to.have.all.keys( 'id', 'title', 'slug', 'price', 'description', 'category', 'images', 'creationAt', 'updatedAt' ); }); });
-
Valid URL Check:
pm.test("Images contain valid URLs", function () { const jsonData = pm.response.json(); jsonData.forEach(product => { product.images.forEach(image => { pm.expect(image).to.be.a('string').that.matches(/^https?:\/\/.+/); }); }); });
- Postman (v10+ recommended)
- Internet access to call the public API or Postman Mock Server.
This project is licensed under the MIT License — feel free to use and adapt.
- This project will be updated and expanded over time.