You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Cognifide.PowerShell/Data/serialization/master/sitecore/system/Modules/PowerShell/Script Library/Platform/Functions/Invoke-ApiScript.item
@@ -18,7 +18,17 @@ Describe "WebAPi POST Response" {
18
18
It "Should return XML Document Object" {
19
19
$postParams=@{user="admin"; password="b"}
20
20
$html=Invoke-RestMethod-Uri "$protocolHost/-/script/v2/master/ChildrenAsHtml"-method Post -Body $postParams
21
-
$html.GetType().Name | Should Be "XmlDocument"
21
+
$html| Should BeOfType System.Xml.XmlDocument
22
+
}
23
+
}
24
+
Context "HomeAndDescendants Script" {
25
+
It "Should return JSON object with Success" {
26
+
$postParams=@{user="admin"; password="b"}
27
+
$result=Invoke-RestMethod-Uri "$protocolHost/-/script/v2/master/HomeAndDescendants?offset=0&limit=2&fields=(Name,ItemPath,Id)"-method Post -Body $postParams
28
+
$result| Should BeOfType System.Management.Automation.PSCustomObject
29
+
$result.Status| Should Be Success
30
+
$result.Results.Count| Should Be 2
31
+
$result.Results[0].Name | Should Be Home
22
32
}
23
33
}
24
34
}
@@ -33,7 +43,28 @@ Describe "WebAPi GET Response" {
0 commit comments