forked from TingtingWen/wopi-validator-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
MS-WOPIFoldersTestCases.xml
100 lines (96 loc) · 4.72 KB
/
MS-WOPIFoldersTestCases.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
<?xml version="1.0" encoding="utf-8"?>
<!-- Test cases for CheckFolderInfo and EnumerateChildren in [MS-WOPI]. Command line argument -w (wopisrc) must in format of HTTP://server/<...>/wopi*/folders/<id> -->
<WopiValidation>
<Resources>
<File Id="WordSimpleDocument" Name="WordSimpleDocument.docx" FilePath="Resources\WordSimpleDocument.docx" />
</Resources>
<TestGroup Name="CheckFolderInfo">
<TestCases>
<TestCase Name="FullCheckFolderInfoSchema" Document="WordBlankDocument" Category="WopiCore">
<Description>
This tests that hosts' CheckFolderInfo responses conform to the JSON schema.
</Description>
<Requests>
<CheckFolderInfo>
<Validators>
<JsonSchemaValidator Schema="MS-WOPICheckFolderInfoSchema" />
<ResponseHeaderValidator Header="X-WOPI-ServerVersion" IsRequired="true" />
<ResponseHeaderValidator Header="X-WOPI-MachineName" IsRequired="true" />
</Validators>
</CheckFolderInfo>
</Requests>
</TestCase>
</TestCases>
</TestGroup>
<TestGroup Name="EnumerateChildren">
<TestCases>
<TestCase Name="EnumerateChildrenSchema" Document="WordBlankDocument" Category="WopiCore">
<Description>
This tests that hosts' EnumerateChildren responses conform to the JSON schema.
</Description>
<Requests>
<EnumerateChildren>
<Validators>
<JsonResponseContentValidator>
<StringProperty Name="Children[0].Name" IsRequired="true" />
<AbsoluteUrlProperty Name="Children[0].Url" IsRequired="true" MustIncludeAccessToken="true" />
<StringProperty Name="Children[0].Version" IsRequired="true" />
</JsonResponseContentValidator>
<ResponseHeaderValidator Header="X-WOPI-ServerVersion" IsRequired="true" />
<ResponseHeaderValidator Header="X-WOPI-MachineName" IsRequired="true" />
</Validators>
</EnumerateChildren>
</Requests>
</TestCase>
<TestCase Name="VersionInEnumerateChildrenResponseMatchesVersionInCheckFileInfoResponse" Document="WordBlankDocument" Category="WopiCore">
<Description>
This tests that Version in EnumerateChildren response matches the value in Version field in CheckFileInfo response.
</Description>
<Requests>
<EnumerateChildren>
<SaveState>
<State Name="VersionInEnumerateChildrenResponse" Source="Children[0].Version" />
<State Name="UrlInEnumerateChildrenResponse" Source="Children[0].Url" />
</SaveState>
<Validators>
<JsonResponseContentValidator>
<AbsoluteUrlProperty Name="Children[0].Url" IsRequired="true" MustIncludeAccessToken="true" />
<StringProperty Name="Children[0].Version" IsRequired="true" />
</JsonResponseContentValidator>
</Validators>
</EnumerateChildren>
<CheckFileInfo OverrideUrl="$State:UrlInEnumerateChildrenResponse">
<Validators>
<JsonResponseContentValidator>
<StringProperty Name="Version" IsRequired="true" ExpectedStateKey="VersionInEnumerateChildrenResponse" />
</JsonResponseContentValidator>
</Validators>
</CheckFileInfo>
</Requests>
</TestCase>
<TestCase Name="VersionInEnumerateChildrenResponseChangesWhenFileChanges" Document="WordBlankDocument" Category="WopiCore">
<Description>
This tests that Version in EnumerateChildren response changes when the file changes.
</Description>
<Requests>
<EnumerateChildren>
<SaveState>
<State Name="VersionInEnumerateChildrenResponse" Source="Children[0].Version" />
<State Name="UrlInEnumerateChildrenResponse" Source="Children[0].Url" />
<State Name="NameInEnumerateChildrenResponse" Source="Children[0].Name" />
</SaveState>
</EnumerateChildren>
<PutFile OverrideUrl="$State:UrlInEnumerateChildrenResponse" Lock="LockString" ResourceId="WordSimpleDocument" />
<EnumerateChildren>
<Validators>
<JsonResponseContentValidator>
<StringProperty Name="Children[0].Version" IsRequired="true" ExpectedStateKey="VersionInEnumerateChildrenResponse" ShouldMatch="false" />
<StringProperty Name="Children[0].Name" IsRequired="true" ExpectedStateKey="NameInEnumerateChildrenResponse" />
</JsonResponseContentValidator>
</Validators>
</EnumerateChildren>
</Requests>
</TestCase>
</TestCases>
</TestGroup>
</WopiValidation>