본문으로 건너뛰기
Skillpedia
배포 및 클라우드 (DevOps)48k · #5477

postman-newman-automation

하는 일

이 도구는 API 테스트를 자동으로 실행하는 명령과 스크립트를 만듭니다. Postman 테스트 컬렉션을 개발 환경이나 Jenkins 같은 CI/CD(지속적 통합/지속적 배포) 시스템에서 실행하도록 돕습니다.

사용하는 경우

  • ✓그래픽 인터페이스 밖에서 Postman API 테스트를 실행해야 할 때.
  • ✓CI/CD 파이프라인에서 API 테스트 실행을 자동화할 때.
  • ✓HTML이나 XML 같은 형식으로 API 테스트 보고서를 만들 때.

스킬 링크

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/postman-newman-automation/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/postman-newman-automation/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“‘api_tests.json’ 컬렉션을 ‘prod.json’ 환경으로 실행하는 명령을 만들어 주세요. 실패한 테스트가 있으면 중단하고, ‘report.html’이라는 HTML 보고서를 만들어 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

이 도구는 Postman의 명령줄 프로그램인 Newman을 사용합니다. 컬렉션 파일, 환경, 보고서 형식을 지정하는 옵션을 포함해 필요한 명령을 구성합니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

Postman Newman Automation

When to Use

Use this skill when you need generate Newman CLI commands, configuration files, Jenkins pipeline scripts, and shell automation for running Postman collections in CI/CD or local environments. Use this skill whenever the user wants to run Postman collections from the command line, automate API tests, integrate...

Generates Newman CLI commands, shell scripts, and Jenkins pipeline configs for running Postman collections in automated environments.


Newman Basics

Newman is Postman's CLI runner. Install with:

npm install -g newman
# Optional HTML reporter:
npm install -g newman-reporter-htmlextra

Core Command Structure

newman run <collection> \
  --environment <env-file> \
  --globals <globals-file> \
  --iteration-count <n> \
  --iteration-data <csv-or-json> \
  --reporters <reporter-list> \
  --reporter-htmlextra-export <output.html> \
  --reporter-junit-export <results.xml> \
  --timeout-request <ms> \
  --delay-request <ms> \
  --bail \
  --color on

Step 1 — Gather Requirements

Ask or infer from context:

Parameter Question
Collection source File path, URL, or Postman API UID?
Environment File path or inline variables?
Reporter(s) CLI only, HTML report, JUnit XML?
Fail behavior Stop on first failure (--bail) or run all?
Iterations Single run or data-driven (CSV/JSON)?
Target Local shell, Jenkins, or both?

Step 2 — Generate Newman Command

Basic run (local)

newman run collection.json \
  --environment environment.json \
  --reporters cli,htmlextra \
  --reporter-htmlextra-export reports/report.html \
  --bail

Run from Postman API (by UID)

newman run "https://api.getpostman.com/collections/<UID>?apikey={{POSTMAN_API_KEY}}" \
  --environment environment.json \
  --reporters cli,junit \
  --reporter-junit-export results/junit.xml

Data-driven run (CSV)

newman run collection.json \
  --iteration-data test-data.csv \
  --iteration-count 5 \
  --reporters cli,htmlextra \
  --reporter-htmlextra-export reports/data-driven-report.html

With environment variable overrides (no file needed)

newman run collection.json \
  --env-var "base_url=https://staging.api.example.com" \
  --env-var "token=abc123" \
  --reporters cli

Step 3 — Shell Script

Generate a reusable shell script:

#!/bin/bash
set -e

# Configuration
COLLECTION="./collection.json"
ENVIRONMENT="./environment.json"
REPORT_DIR="./reports"
TIMESTAMP=$(date +"%Y%m%d_%H%M%S")

# Ensure report directory exists
mkdir -p "$REPORT_DIR"

echo "Running Newman collection: $COLLECTION"

newman run "$COLLECTION" \
  --environment "$ENVIRONMENT" \
  --reporters cli,htmlextra,junit \
  --reporter-htmlextra-export "$REPORT_DIR/report_$TIMESTAMP.html" \
  --reporter-junit-export "$REPORT_DIR/junit_$TIMESTAMP.xml" \
  --timeout-request 10000 \
  --bail

EXIT_CODE=$?

if [ $EXIT_CODE -eq 0 ]; then
  echo "✅ All tests passed."
else
  echo "❌ Tests failed. Check report: $REPORT_DIR/report_$TIMESTAMP.html"
  exit $EXIT_CODE
fi

Step 4 — Jenkins Pipeline

Declarative Jenkinsfile (preferred)

pipeline {
  agent any

  environment {
    POSTMAN_ENV = credentials('postman-environment-file') // Jenkins credential ID
  }

  stages {
    stage('Install Newman') {
      steps {
        sh 'npm install -g newman newman-reporter-htmlextra'
      }
    }

    stage('Run API Tests') {
      steps {
        sh """
          newman run collection.json \\
            --environment ${POSTMAN_ENV} \\
            --reporters cli,htmlextra,junit \\
            --reporter-htmlextra-export reports/report.html \\
            --reporter-junit-export reports/junit.xml \\
            --timeout-request 10000 \\
            --bail
        """
      }
    }
  }

  post {
    always {
      // Archive HTML report
      publishHTML(target: [
        allowMissing: false,
        alwaysLinkToLastBuild: true,
        keepAll: true,
        reportDir: 'reports',
        reportFiles: 'report.html',
        reportName: 'Newman API Test Report'
      ])
      // Archive JUnit results
      junit 'reports/junit.xml'
    }
    failure {
      echo 'API tests failed! Check the Newman report.'
    }
  }
}

Scripted Jenkinsfile (if declarative not available)

node {
  stage('Install Newman') {

…
자주 묻는 질문

Newman이란 무엇인가요?

Postman의 명령줄 버전으로, Postman 그래픽 인터페이스를 열지 않고 터미널에서 API 테스트를 바로 실행하게 해 줍니다.

Postman의 ‘컬렉션’과 ‘환경’은 무엇인가요?

컬렉션은 API 요청과 테스트를 묶습니다. 환경은 테스트하는 장소(개발, 운영 등)에 따라 바뀌는 변수(URL이나 토큰 등)를 저장합니다.

CI/CD란 무엇인가요?

테스트와 배포를 자동화하는 소프트웨어 개발 방식입니다. Jenkins 같은 도구가 이를 위해 쓰입니다.

상세 정보

작성자의 원본 설명

Generate Newman CLI commands, configuration files, Jenkins pipeline scripts, and shell automation for running Postman collections in CI/CD or local environments.

repo: sickn33/agentic-awesome-skills

인기도

GitHub 스타
48k
순위
#5477
라이선스
MIT
업데이트
2026. 10. 15.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬