This repository contains the configuration and scripts for running API tests using Postman CLI and Newman within GitHub Actions. As part of my capstone project, I aimed to integrate automated API testing into the CI/CD pipeline, showcasing the capabilities of Postman CLI and Newman. I forked the main development repo to ensure topic integrity.
Capstone Project: Automated API Testing
Miray Sönmez
This project demonstrates how to set up and run automated API tests using Postman CLI and Newman in a continuous integration (CI) pipeline via GitHub Actions. The tests are configured to run against API endpoints to ensure their functionality and reliability.
- Integrate Postman CLI and Newman for automated API testing.
- Configure GitHub Actions to run the tests as part of the CI pipeline.
- Demonstrate the process and configuration through a well-documented README.
- Postman CLI: Command-line tool to interact with Postman APIs.
- Newman: Command-line collection runner for Postman.
- GitHub Actions: CI/CD platform for automating workflows.
- Node.js: JavaScript runtime for executing Newman.
The GitHub Actions workflow is defined in the .github/workflows/newman.yml
file. Below is the configuration:
yaml
Copy code
name: Run Newman Tests
on: [push, pull_request]
jobs:
newman-test:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '14'
- name: Install Newman
run: npm install -g newman
- name: Run Newman tests
run: |
newman run ./postman/WebAPI.postman_collection.json -e ./postman/LibraryEnv.postman_environment.json --insecure
- Checkout Repository: Checks out the repository to the runner.
- Set up Node.js: Sets up the Node.js environment required to run Newman.
- Install Newman: Installs Newman globally using npm.
- Run Newman Tests: Executes the Postman collection tests using Newman. The
--insecure
flag is used to bypass self-signed certificate issues.
To run the tests locally using Postman CLI and Newman, follow these steps:
-
Install Newman:
npm install -g newman
-
Run Newman Tests:
newman run "C:\Users\Miray\AppData\Local\Postman\app-11.2.0\WebAPI.postman_collection.json" -e "C:\Users\Miray\AppData\Local\Postman\app-11.2.0\LibraryEnv.postman_environment.json" --insecure
Due to the limitations of running tests on localhost, the above GitHub Actions configuration is demonstrated without an actual deployment of the backend service. In a real-world scenario, the backend would need to be deployed to a public environment accessible by GitHub Actions.
The current configuration and tests are designed to run against a local instance of the API. Since the API is not deployed to a public environment, the GitHub Actions workflow will not be able to execute the tests successfully. The configuration files and scripts serve as a demonstration of the setup process.
.github/workflows/newman.yml
: GitHub Actions workflow configuration.postman/WebAPI.postman_collection.json
: Postman collection file.postman/LibraryEnv.postman_environment.json
: Postman environment file.
This capstone project showcases the integration of Postman CLI and Newman in a CI pipeline using GitHub Actions. Despite the limitation of not having access to a deployed API, the configuration and scripts demonstrate the ability to set up and automate API tests effectively.
For any inquiries or further information, please reach out through my GitHub profile: chiturca.
Miray Sönmez
Software Tester
Bu proje, kitap ödünç alma, iade etme ve envanter yönetimi gibi fonksiyonları sağlayan bir kütüphane yönetim sistemi tasarlamak amacıyla geliştirilmiştir.
- Programlama Dili: C#
- Geliştirme Platformu: .NET 8.0
- Mimari: Narchitecture
- Framework: Angular
- Mimari: Feature-Based Architecture
- Teknolojiler:
- Bootstrap
- JavaScript
- TypeScript
- SCSS
- Veri Tabanı: Microsoft SQL Server
- Platform: Amazon Web Services (AWS)
- 📩 Mail Hizmeti: Papercut SMTP
- 📸 Medya Yönetimi: Cloudinary
Önerilen özellikler ve bilinen sorunlar için open issues inceleyebilirsiniz.
Açık kaynak topluluğunu bu kadar harika bir yer yapan şey, öğrenme, ilham alma ve yaratma sürecine katkıda bulunmaktır. Yaptığınız her türlü katkı çok takdir edilmektedir.
Katkıda bulunmak için:
- Projeyi Fork'layın
- Kendi Özellik Dalınızı Oluşturun (git checkout -b feature/)
- Yaptığınız Değişiklikleri Commit Edin (git commit -m '')
- Dalınıza Push Edin (git push origin feature/)
- Bir Pull Request Açın
MIT Lisansı altında dağıtılmaktadır. Daha fazla bilgi için LICENSE
dosyasına bakın.
Proje Linki: https://github.com/Tobeto-dotNet2A-Pair2/LibraryManagementSystem
Bu projeye katkıda bulunan herkese teşekkür ederiz:
- Ayşe KARDAŞ - GitHub Profili
- Cihan YÜKSEL - GitHub Profili
- Zeynep YAŞAR - GitHub Profili
- Güven ÇABAT - GitHub Profili
- Ebru Zeynep ADIGÜZEL - GitHub Profili