From c10378c93769c7d5c68141715f5a12435b8ceb11 Mon Sep 17 00:00:00 2001 From: Sudo Bro <112646122+sudobro-creator@users.noreply.github.com> Date: Sun, 25 Aug 2024 19:01:15 +0100 Subject: [PATCH] Update postman-api-tests.yml --- .github/workflows/postman-api-tests.yml | 32 +++++++++++++++---------- 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/.github/workflows/postman-api-tests.yml b/.github/workflows/postman-api-tests.yml index b05ec7b2..cf5cf1b5 100644 --- a/.github/workflows/postman-api-tests.yml +++ b/.github/workflows/postman-api-tests.yml @@ -2,7 +2,7 @@ name: API Test and Status Update on: schedule: - - cron: "*/15 * * * *" + - cron: "*/15 * * * *" workflow_dispatch: jobs: @@ -10,10 +10,10 @@ jobs: runs-on: ubuntu-latest steps: - - name: Checkout code + - name: Checkout Code uses: actions/checkout@v3 - - name: Install Node.js + - name: Set up Node.js uses: actions/setup-node@v3 with: node-version: '20' @@ -21,22 +21,30 @@ jobs: - name: Install Newman run: npm install -g newman - - name: Run Newman Collection + - name: Run Postman Collection with HTML Reporter run: | - newman run "$NEW_COLLECTION_PATH" \ - --environment "$NEW_ENVIRONMENT_PATH" \ - --reporters json \ + newman run "hg_boilerplate_java_web/qa_tests/regression/Spartacus_Java_Boilerplate_copy-postman_collection.json" \ + --reporter htmlextra \ + --reporter-htmlextra-export "newman-report.html" \ --reporter-json-export "result.json" - env: - NEW_COLLECTION_PATH: ${{ secrets.NEWMAN_COLLECTION_PATH }} - NEW_ENVIRONMENT_PATH: ${{ secrets.NEWMAN_ENVIRONMENT_PATH }} + - 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: Copy result.json to server + - 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: "result.json" + source: "newman-report.html" target: "/home/${{ secrets.USERNAME }}/hng_boilerplate_java_web" +