Update newman.yml #2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Postman API Tests | |
on: [push, pull_request] | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Install Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '20.11.1' | |
- name: Install dependencies | |
run: npm install | |
- name: Start API server | |
run: npm start & # Start your API server here | |
env: | |
NODE_ENV: test | |
- name: Wait for API server to be ready | |
run: | | |
echo "Checking if API server is up..." | |
until $(curl --output /dev/null --silent --head --fail http://localhost:60805/swagger/index.html); do | |
printf '.' | |
sleep 5 | |
done | |
- name: Install Newman | |
run: npm install -g newman | |
- name: Run Postman Tests | |
run: newman run ./Postman/app-11.2.0/WebAPI.postman_collection.json -e ./Postman/app-11.2.0/LibraryEnv.postman_environment.json |