Skip to content

Instantly share code, notes, and snippets.

View soutarm's full-sized avatar
⚛️
Reacting

Michael Soutar soutarm

⚛️
Reacting
  • Homely.com.au
  • Melbourne, Australia
View GitHub Profile
@soutarm
soutarm / RunGhostInspectorTest.ps
Last active May 10, 2018 17:57
AppVeyor PS function for running tests against Ghost Inspector. e.g. RunTest -suiteId '123xyz' -testName 'My Tests' -apiKey 'abc123'
Function RunTest {
Param ([string]$suiteId, [string]$testName, [string]$apiKey)
Process {
Write-Host -backgroundcolor White -foregroundcolor Black ' - Running'$testName' - '
$uri = 'https://api.ghostinspector.com/v1/suites/' + $suiteId + '/execute/?apiKey=' + $apiKey
$resp = Invoke-RestMethod -Method Get -Uri $uri
$resultUri = 'https://app.ghostinspector.com/suite-results/' + $resp.data.suiteResult[0]
if ($resp.data.passing.Contains($false)) {
# display each failed test
for($i=0; $i -lt $resp.data.passing.length; $i++) {