CircleCI postman API automate testing not working

Why cirlceci converting version 2.1 to version 2.0?

Hello @dhavalsoni2001,

A 2.1 config will be “processed” into a 2.0 config. 2.1 allows you to use features like Orbs, which are fetched and then “expanded” into your final version 2 config.

What error are you running into?

I have set up postman with circle ci by following this article: https://circleci.com/blog/set-up-a-circleci-pipeline-to-run-a-postman-collection-using-the-newman-orb/

So when config 2.1 processed into a 2.0 at that time code for postman has been comment out and not executing.

# Orb 'postman/newman@0.0.2' resolved to 'postman/newman@0.0.2'
version: 2
jobs:
  build:
    docker:
    - image: circleci/node:6.11.4
    steps:
    - checkout
    - run:
        command: sudo npm install -g cordova@6.5.0
        name: add-cordova
    - run:
        command: sudo npm install -g ionic@1
        name: add-ionic
    - run:
        command: sudo npm install gulp-cli -g
        name: add-gulp-cli
    - run:
        command: sudo npm install -g gulp -D
        name: add-gulp
    - run:
        command: sudo npm -g install bower
        name: add-bower
    - run:
        command: npm install
        name: add-node-modules
    - run:
        command: bower install
        name: add-bower
    - run:
        command: gulp staging
        name: build-staging
    - run:
        command: ionic state reset
        name: ionic-state-reset
    - run:
        command: npm test
        name: test
workflows:
  version: 2
  workflow:
    jobs:
    - build

# Original config.yml file:
# version: 2.1
# orbs: 
#   newman: postman/newman@0.0.2
# jobs: 
#   build: 
#     docker: 
#       - 
#         image: \"circleci/node:6.11.4\"
#     steps: 
#       - checkout
#       - run: 
#           command: \"sudo npm install -g cordova@6.5.0\"
#           name: add-cordova
#       - run: 
#           command: \"sudo npm install -g ionic@1\"
#           name: add-ionic
#       - run: 
#           command: \"sudo npm install gulp-cli -g\"
#           name: add-gulp-cli
#       - run: 
#           command: \"sudo npm install -g gulp -D\"
#           name: add-gulp
#       - run: 
#           command: \"sudo npm -g install bower\"
#           name: add-bower
#       - run: 
#           command: \"npm install\"
#           name: add-node-modules
#       - run: 
#           command: \"bower install\"
#           name: add-bower
#       - run: 
#           command: \"gulp staging\"
#           name: build-staging
#       - run: 
#           command: \"ionic state reset\"
#           name: ionic-state-reset
#       - run: 
#           command: \"npm test\"
#           name: test

Hello @dhavalsoni2001,

I see you are importing the orb but it does not appear you are using it in your config.

The commented out line you mention is only there to tell you what version of the orb was fetched. This states you did fetch postman/newman@0.0.2 correctly.

In order to use the orb, try invoking one of its commands or jobs.

https://circleci.com/orbs/registry/orb/postman/newman#commands-newman-run

Take a look at the usage exampels at hte top of the registry page for the orb.

version: 2.1
orbs:
  newman: postman/newman@1.0.0
jobs:
  newman-collection-run:
    executor: newman/postman-newman-docker
    steps:
      - checkout
      - newman/newman-run:
          collection: ./collection.json

This snippet imports the orb:

orbs:
  newman: postman/newman@1.0.0

But on it’s own this will do nothing.

This is the piece that makes use of the imported orb:

 - newman/newman-run:
          collection: ./collection.json

Thanks for response @KyleTryon. I have also tried with adding that in jobs but facing the same issue.

# Orb 'postman/newman@0.0.2' resolved to 'postman/newman@0.0.2'
version: 2
jobs:
  build:
    docker:
    - image: circleci/node:6.11.4
    steps:
    - checkout
    - run:
        command: sudo npm install -g cordova@6.5.0
        name: add-cordova
    - run:
        command: sudo npm install -g ionic@1
        name: add-ionic
    - run:
        command: sudo npm install gulp-cli -g
        name: add-gulp-cli
    - run:
        command: sudo npm install -g gulp -D
        name: add-gulp
    - run:
        command: sudo npm -g install bower
        name: add-bower
    - run:
        command: npm install
        name: add-node-modules
    - run:
        command: bower install
        name: add-bower
    - run:
        command: gulp staging
        name: build-staging
    - run:
        command: ionic state reset
        name: ionic-state-reset
    - run:
        command: npm test
        name: test
workflows:
  version: 2
  workflow:
    jobs:
    - build

# Original config.yml file:
# version: 2.1
# orbs: 
#   newman: postman/newman@0.0.2
# jobs: 
#   newman-collection-run: 
#     executor: newman/postman-newman-docker
#     steps: 
#       - checkout
#       - 
#         newman/newman-run: 
#           collection: ./postman_collection.json
#   build: 
#     docker: 
#       - 
#         image: \"circleci/node:6.11.4\"
#     steps: 
#       - checkout
#       - 
#         run: 
#           command: \"sudo npm install -g cordova@6.5.0\"
#           name: add-cordova
#       - 
#         run: 
#           command: \"sudo npm install -g ionic@1\"
#           name: add-ionic
#       - 
#         run: 
#           command: \"sudo npm install gulp-cli -g\"
#           name: add-gulp-cli
#       - 
#         run: 
#           command: \"sudo npm install -g gulp -D\"
#           name: add-gulp
#       - 
#         run: 
#           command: \"sudo npm -g install bower\"
#           name: add-bower
#       - 
#         run: 
#           command: \"npm install\"
#           name: add-node-modules
#       - 
#         run: 
#           command: \"bower install\"
#           name: add-bower
#       - 
#         run: 
#           command: \"gulp staging\"
#           name: build-staging
#       - 
#         run: 
#           command: \"ionic state reset\"
#           name: ionic-state-reset
#       - 
#         run: 
#           command: \"npm test\"
#           name: test

Hello @dhavalsoni2001

You have now defined a second job but never defined how it should run in a workflow. Please take a look at our workflow configuration documentation here:

https://circleci.com/docs/2.0/workflows/