This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Automated API tests using Postman CLI | |
run-name: The Collection run was started by ${{ github.actor }} | |
on: | |
workflow_dispatch: | |
inputs: | |
collection-uid: | |
required: true | |
type: string | |
description: 'The Collection UID for the run' | |
iterations: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Create a random string length between the speficied min / max values | |
* @param {Number} minValue - The min value of the string length | |
* @param {Number} maxValue - The max value of the string length | |
*/ | |
const randomString = function (minValue, maxValue, dataSet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz') { | |
const lodash = require('lodash'); | |
if (!minValue) { | |
minValue = 10; | |
maxValue = 10; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let myPDFData = { | |
contract: Buffer.from(pm.response.json().contract, 'base64'), | |
reference: pm.response.json().reference | |
} | |
let template = ` | |
<script src="https://unpkg.com/jspdf@latest/dist/jspdf.min.js"></script> | |
<button onclick="savePDF()">Save To PDF</button> | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"naughtyValue": "" | |
}, | |
{ | |
"naughtyValue": "undefined" | |
}, | |
{ | |
"naughtyValue": "undef" | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>My Awesome Template</title> | |
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css"> | |
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js"></script> | |
</head> | |
<body> | |
<div class="container"> | |
<div class="table-responsive"> | |
<table class="table table-striped table-bordered"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"cursor": { | |
"position": 0, | |
"iteration": 0, | |
"length": 1, | |
"cycles": 1, | |
"empty": false, | |
"eof": false, | |
"bof": true, | |
"cr": false, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This can be placed in the Pre-requests on the collection level. | |
// It will check to see if certain valid variables are present in an environment file. | |
// If these are not present, it be go and get another valid token | |
// The 'AuthData' variable is a Base64 encoded client_id and client_secret | |
// This my need to be tweaked for your needs but the mechanism will work. | |
const moment = require('moment') | |
const getJWT = { | |
url: `${pm.environment.get('tokenBaseURL')}/Auth/connect/token`, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function cleanup() { | |
const clean = _.keys(pm.environment.toObject()) | |
_.each(clean, (arrItem) => { | |
if (arrItem.startsWith("some_prefix")) { | |
pm.environment.unset(arrItem) | |
} | |
}) | |
} | |
cleanup() |
NewerOlder