Skip to content

API Test and Status Update #4564

API Test and Status Update

API Test and Status Update #4564

name: API Test and Status Update
on:
schedule:
- cron: "*/15 * * * *"
workflow_dispatch:
jobs:
run-newman-tests:
if: github.event.repository.fork == false
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install Newman
run: npm install -g newman
- name: Run Newman Tests here
run: newman run qa_tests/regression/Spartacus_Java_Boilerplate_Copy.postman_collection.json -r json --reporter-json-export=result.json --suppress-exit-code
continue-on-error: true
- name: Copy newman-report.html to server
uses: appleboy/scp-action@v0.1.7
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
password: ${{ secrets.PASSWORD }}
# source: "newman-report.html"
source: "result.json"
target: "/home/${{ secrets.USERNAME }}/hng_boilerplate_java_web/"
# target: "/home/${{ secrets.USERNAME }}/hng_boilerplate_java_web/staging-result/"
# - name: Set up Java
# uses: actions/setup-java@v3
# with:
# distribution: 'adopt'
# java-version: '17'
# - name: Send parsed result to Hosted Application
# run: |
# export APP_URL=${{ secrets.APP_URL }}
# java -jar sendPostmanApiTestResults.jar newman-report.html result.json
# - name: Deploy to Server
# uses: appleboy/ssh-action@master
# with:
# host: ${{ secrets.HOST }}
# username: ${{ secrets.USERNAME }}
# password: ${{ secrets.PASSWORD }}
# script: |
# cd hng_boilerplate_java_web/staging-result
# java -jar sendPostmanApiTestResults.jar