Skip to content

Instantly share code, notes, and snippets.

View zachlayman-applitools's full-sized avatar

Zach Layman zachlayman-applitools

View GitHub Profile
add-type @"
using System.Net;
using System.Security.Cryptography.X509Certificates;
public class TrustAllCertsPolicy : ICertificatePolicy {
public bool CheckValidationResult(
ServicePoint srvPoint, X509Certificate certificate,
WebRequest request, int certificateProblem) {
return true;
}
}
SERVER_URL=$1
API_KEY=$2
DATE_STR=$(date "+%Y%m%d%H%M%S")
DATE_HEADER="Date: $(date "+%a, %d %b %Y %T %Z")"
RESULTS_URL=$(curl "https://$SERVER_URL.applitools.com/api/sessions/renderinfo?apiKey=$API_KEY" | jq -r ".resultsUrl")
PUT_URL=$(echo $RESULTS_URL | sed "s/\_\_random\_\_/$DATE_STR/g")
echo "Testing PUT to:" $PUT_URL