Chuyển đến nội dung
Skillpedia
Tự động hóa48k · #5295

newman-cicd-integration

Skill này làm gì

Công cụ này tạo các cấu hình sẵn sàng dùng để tự động hóa kiểm thử API. Nó cài Newman, một công cụ chạy kiểm thử API, và thiết lập cách công cụ này hoạt động trong pipeline CI/CD.

Khi nào nên dùng

  • ✓Khi bạn muốn tự động hóa kiểm thử API trong các dự án.
  • ✓Khi muốn tích hợp kiểm thử API vào quá trình build tự động.
  • ✓Khi thiết lập kiểm thử API trên các nền tảng như GitHub Actions, GitLab CI hoặc Jenkins.

Liên kết skill

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

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/newman-cicd-integration/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Tôi cần thiết lập kiểm thử API cho GitHub Actions, dùng file bộ sưu tập cục bộ và file môi trường. Tôi muốn báo cáo JUnit và HTML, và build phải thất bại nếu kiểm thử không đạt.”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Công cụ hỏi bạn dùng nền tảng CI/CD nào, các kiểm thử nằm ở đâu và bạn muốn kết quả ra sao. Từ những thông tin này, nó tạo mã để bạn sao chép và dán vào dự án.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

Newman CI/CD Integration Generator

When to Use

Use this skill when you need generate ready-to-use CI/CD pipeline configurations that install and run Newman for automated API testing. Use this skill whenever the user wants to run Newman in a CI pipeline, integrate Postman collections into automated builds, set up API tests in GitHub Actions, GitLab CI, Jenkins,...

Generate complete, copy-paste-ready CI/CD pipeline configs that install Newman and run Postman collections as part of automated builds.


What to Collect From the User

Before generating a config, determine:

  1. CI platform — GitHub Actions, GitLab CI, Jenkins, Azure DevOps, CircleCI, Bitbucket?
  2. Collection source — local file in repo, or Postman API URL?
  3. Environment — local env file in repo, or env vars injected by CI secrets?
  4. Reporters needed — JUnit XML (for CI test results panel), HTML report, or both?
  5. Node.js version preference (default: 18)
  6. Trigger — on every push, pull request, schedule, or after deploy?
  7. Fail build on test failure? — almost always yes; confirm

Platform Templates

GitHub Actions

name: API Tests

on:
  push:
    branches: [main, develop]
  pull_request:

jobs:
  api-tests:
    runs-on: ubuntu-latest

    steps:
      - name: Checkout repository
        uses: actions/checkout@v4

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

      - name: Install Newman
        run: |
          npm install -g newman
          npm install -g newman-reporter-htmlextra

      - name: Run API tests
        run: |
          newman run ./collections/my-api.json \
            -e ./environments/staging.json \
            -r cli,junit,htmlextra \
            --reporter-junit-export ./results/junit.xml \
            --reporter-htmlextra-export ./results/report.html \
            --reporter-htmlextra-title "API Test Results"
        env:
          BASE_URL: ${{ secrets.BASE_URL }}
          API_KEY: ${{ secrets.API_KEY }}

      - name: Publish test results
        uses: dorny/test-reporter@v1
        if: always()
        with:
          name: Newman API Tests
          path: results/junit.xml
          reporter: java-junit

      - name: Upload HTML report
        uses: actions/upload-artifact@v4
        if: always()
        with:
          name: api-test-report
          path: results/report.html

GitLab CI

stages:
  - test

api-tests:
  stage: test
  image: node:18-alpine
  before_script:
    - npm install -g newman newman-reporter-htmlextra
  script:
    - |
      newman run ./collections/my-api.json \
        -e ./environments/staging.json \
        --env-var "BASE_URL=$BASE_URL" \
        --env-var "API_KEY=$API_KEY" \
        -r cli,junit,htmlextra \
        --reporter-junit-export results/junit.xml \
        --reporter-htmlextra-export results/report.html
  artifacts:
    when: always
    reports:
      junit: results/junit.xml
    paths:
      - results/report.html
    expire_in: 7 days
  variables:
    BASE_URL: $BASE_URL   # Set in GitLab CI/CD > Variables
    API_KEY: $API_KEY

Jenkins (Declarative Pipeline)

pipeline {
  agent any

  tools {
    nodejs 'NodeJS-18'   // Configure in Global Tool Configuration
  }

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

    stage('Run API Tests') {
      steps {
        sh '''
          newman run ./collections/my-api.json \
            -e ./environments/staging.json \
            -r cli,junit,htmlextra \
            --reporter-junit-export results/junit.xml \
            --reporter-htmlextra-export results/report.html \
            --reporter-htmlextra-title "API Tests - ${BUILD_NUMBER}"
        '''
      }
    }
  }

  post {
    always {
      junit 'results/junit.xml'
      publishHTML([
        allowMissing: false,
        alwaysLinkToLastBuild: true,
        keepAll: true,
        reportDir: 'results',
        reportFiles: 'report.html',
        reportName: 'Newman API Test Report'
      ])
    }
  }
}

Azure DevOps

trigger:
  branches:
    include:
      - main

pool:
  vmImage: 'ubuntu-latest'

steps:
  - task: NodeTool@0
    inputs:
      versionSpec: '18.x'
    displayName: 'Set up Node.js'

  - script: |
      npm install -g newman newman-reporter-htmlextra
    displayName: 'Install Newman'

  - script: |

…
Câu hỏi thường gặp

CI/CD là gì?

CI/CD là viết tắt của Continuous Integration và Continuous Delivery/Deployment. Đây là các thực hành giúp tự động hóa quy trình phát triển và kiểm thử phần mềm, làm nó nhanh hơn và đáng tin cậy hơn.

Newman là gì?

Newman là công cụ dòng lệnh cho phép chạy các bộ sưu tập kiểm thử API được tạo trong Postman trực tiếp trong môi trường tự động hóa.

“Collections” và “environments” trong Postman là gì?

Collections là nhóm các yêu cầu API và kiểm thử. Environments lưu các biến (như URL hoặc khóa xác thực) có thể dùng trong yêu cầu và kiểm thử của bạn.

Chi tiết

Mô tả gốc của tác giả

Generate ready-to-use CI/CD pipeline configurations that install and run Newman for automated API testing.

repo: sickn33/agentic-awesome-skills

Độ phổ biến

Sao GitHub
48k
Vị trí xếp hạng
#5295
Giấy phép
MIT
Cập nhật
15/10/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự