Piotr Wcisło
Piotr Wcisło

Reputation: 25

Postman - newman html report cannot be found in github actions

Im trying to generate a html report while running newman command for my postman collection. But the upload artifact step cannot find the file and I'm getting Warning: No files were found with the provided path: ./newman_report.html. No artifacts will be uploaded.. In fact, this file is nowhere to be found in the directory where this command is executed, I tried with many different paths but report is never there. Report is generated in the correct path when I execute the command locally.

Heres my latest version of the workflow:

name: Automated API tests using Newman

on: 
  workflow_dispatch:

jobs:
  automated-api-tests:
     runs-on: ubuntu-latest
     steps:
       - uses: actions/checkout@v4

  - name: Create dir
    run: |
      mkdir testArtifact

  - name: Set up Node.js
    uses: actions/setup-node@v4
    with:
      node-version: '22.x'

  - name: Install packages
    run: |
      npm install
                
  - name: List directory contents for debugging
    run: |
      ls -R
      
  - name: Run API tests with Newman and generate HTML report
    run: |
      newman run postman_collection.json -e environments/test/postman_environment.json -r htmlextra --reporter-htmlextra-export ./newman_report.html

  - name: List files for debugging
    run: |
      find . -type f

  - name: Upload HTML report artifact
    uses: actions/upload-artifact@v4
    with:
      name: Report
      path: ./newman_report.html

Upvotes: 0

Views: 57

Answers (0)

Related Questions