Skip to content

Instantly share code, notes, and snippets.

@rgr2k
rgr2k / README.md
Created May 24, 2020 15:52 — forked from egucciar/README.md
Shadow Dom Commands

ShadowDom

Quick Start

In the index.js or the root file of your cypress/support folder,

@rgr2k
rgr2k / 01-index.md
Created May 17, 2020 21:36 — forked from alexandramartinez/01-Postman-Scripts.md
Postman scripts cheatsheet

Postman Scripts Cheatsheet

Here you can find some of the most used scripts for Postman testing.

At least some of the most used by me :-)

Postman Objects

(pm-objects.js)

  • Global variables
  • Environment variables
// 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')
}
@rgr2k
rgr2k / prerequest.js
Created May 17, 2020 21:27 — forked from compwright/prerequest.js
Postman pre-request script for Joyent Signature Authentication Scheme
// 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}}"
@rgr2k
rgr2k / cssify.js
Created October 21, 2012 23:37 — forked from Dither/cssify.js
Convert XPath to CSS selector
// 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,:;.]*"
};