nhall97 / sfdx-newman-cicd

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

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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


Languages

Language:JavaScript 100.0%