Skip to content

Cloudbuild configuration to use newman to run a postman collection against Salesforce API as part of CI/CD pipeline

Notifications You must be signed in to change notification settings

nhall97/sfdx-newman-cicd

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

salesforce-newman

Want to be able to use newman to run a postman collection against Salesforce API

Because Salesforce cannot be run locally - we need to run our integration tests against an actual environment.

Dir Structure /postman /collections #Postman Test Collections /environments #Postman Environments /sfdx-newman /force-app #Force-app metadata for Salesforce apps package.json #For Salesforce package.json

Target State

Part of a CI build that can do the following:

  1. Install NPM
  2. Git checkout an sfdx repo
  3. Run static code analysis (sfdx-cli)
  4. 2/ Authorise against a target org (using sfdx-cli)
  5. 3/ Run checkdeploy against org
  6. 4/ If checkdeploy passes, then deploy
  7. 5/ Run Newman Collection against Salesforce org to validate they are working as expected

Create a scratch org

You can use ./sfdx-newman to create a scratch org that contains the metadata for the newman test app

  • Connected App called 'Newman API'
  • //TODO add a script to create newman API user

Use the Cloudbuild yaml + package.json to run your cloudbuild

Package.json contains dependencies and tests to run example newman builds Cloudbuild.yaml can setup your CI and execute the tests

Adding a commit to trigger new CI configuration

About

Cloudbuild configuration to use newman to run a postman collection against Salesforce API as part of CI/CD pipeline

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published