In the index.js or the root file of your cypress/support folder,
This file contains hidden or 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
| // generating random data | |
| var randomData = Math.random(); | |
| // getting Auth tokens from other Auth services | |
| pm.sendRequest({ | |
| url:"https://postman-echo.com/basic-auth", | |
| method: "GET", | |
| header: { | |
| 'Authorization': 'Basic ' + btoa('postman:password') | |
| } |
This file contains hidden or 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
| // Postman pre-request script for Joyent Signature Authentication | |
| // (https://github.com/joyent/node-http-signature/blob/master/http_signing.md) | |
| // | |
| // Set the following vars in your Postman environment: | |
| // apiHost | |
| // apiKey | |
| // apiSecret | |
| // | |
| // Set the following headers in Postman (copy/paste): | |
| // Authorization: Signature keyId="{{apiKey}}",algorithm="hmac-sha256",headers="host date",signature="{{signature}}" |
This file contains hidden or 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
| // JavaScript function for converting simple XPath to CSS selector. | |
| // Ported by Dither from [cssify](https://github.com/santiycr/cssify) | |
| // Example: `cssify('//div[@id="girl"][2]/span[@class="body"]//a[contains(@class, "sexy")]//img[1]')` | |
| var sub_regexes = { | |
| "tag": "([a-zA-Z][a-zA-Z0-9]{0,10}|\\*)", | |
| "attribute": "[.a-zA-Z_:][-\\w:.]*(\\(\\))?)", | |
| "value": "\\s*[\\w/:][-/\\w\\s,:;.]*" | |
| }; |