Ubuntu下Postman集成方案
一 桌面环境集成
[Desktop Entry]
Encoding=UTF-8
Name=Postman
Exec=/opt/Postman/Postman
Icon=/opt/Postman/app/resources/app/assets/icon.png
Terminal=false
Type=Application
Categories=Development;
二 与CI/CD集成
name: Run Postman Tests
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
- name: Install Newman
run: npm install -g newman
- name: Run Newman
run: newman run collection.json --reporters cli,junit --reporter-junit-export report.xml
- name: Upload JUnit Report
uses: actions/upload-artifact@v4
with:
name: postman-report
path: report.xml
name: Run Postman Collection
on:
push:
branches: [ main ]
jobs:
postman-cli:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Postman CLI
run: curl -o- "https://dl-cli.pstmn.io/install/linux64.sh" | sh
- name: Login
run: postman login --with-api-key ${{ secrets.POSTMAN_API_KEY }}
- name: Run Collection
run: postman collection run "<collection-id>" --environment "<env-id>"
三 与开发工具及团队协作
四 常见问题与优化