wisp-schema 1.0.3 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/canary-wisp.json +51 -11
- data/lib/version.rb +3 -2
- data/lib/wisp-schema.rb +41 -6
- data/stable/actions/click.json +25 -0
- data/stable/actions/close_tab.json +18 -0
- data/stable/actions/double_click.json +22 -0
- data/stable/actions/drag_and_drop.json +26 -0
- data/stable/actions/fill.json +23 -0
- data/stable/actions/hover.json +22 -0
- data/stable/actions/loaded.json +19 -0
- data/stable/actions/navigate.json +20 -0
- data/stable/actions/observe.json +27 -0
- data/stable/actions/refresh.json +18 -0
- data/stable/actions/scroll.json +23 -0
- data/stable/actions/select.json +26 -0
- data/stable/actions/send_key.json +20 -0
- data/stable/actions/tester_confirmation.json +19 -0
- data/stable/actions/tester_instruction.json +19 -0
- data/stable/actions/type.json +19 -0
- data/stable/actions/ui_element_reference.json +14 -0
- data/stable/actions/wait.json +20 -0
- data/wisp.json +97 -169
- metadata +19 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '0393e542d263fda472a83d68da7e3eb8d4fa88e35f64cd3b9d54ffcbc3148c14'
|
4
|
+
data.tar.gz: 6fa9e976819a9c3c32a5c30778a91a7469c588348e97a87379907bf9071acfc5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ea5c4f4514e592bc001ab0794881a1a2e9d8e9fcb231b1f518b4ad422ce380f94bd956c3d3140efd1ef156397d8ba43a3a56129a22ce9299cf0f5e7ecec7b51c
|
7
|
+
data.tar.gz: 8c5d7d7091bdabc71ec16a57a0a5fdb3c9e208baa26377b108bdf9145eaad63671493950ff48888de8db48bc412ff5214ec6def17ad7b602a913be2af325d218
|
data/canary-wisp.json
CHANGED
@@ -77,11 +77,13 @@
|
|
77
77
|
{"$ref": "#/definitions/tester_instruction"},
|
78
78
|
{"$ref": "#/definitions/embedded_test"},
|
79
79
|
{"$ref": "#/definitions/observe"},
|
80
|
+
{"$ref": "#/definitions/loaded"},
|
80
81
|
{"$ref": "#/definitions/tester_confirmation"}
|
81
82
|
]
|
82
83
|
},
|
83
84
|
"click": {
|
84
85
|
"type": "object",
|
86
|
+
"action_type": "action",
|
85
87
|
"title": "Click",
|
86
88
|
"description": "Clicks on the UI element",
|
87
89
|
"properties": {
|
@@ -91,7 +93,8 @@
|
|
91
93
|
"embedded_test_id": {"title": "Embedded Test ID", "type": "integer"},
|
92
94
|
"target": {
|
93
95
|
"title": "Target",
|
94
|
-
"$ref": "#/definitions/noun"
|
96
|
+
"$ref": "#/definitions/noun",
|
97
|
+
"type": "ui_element_reference"
|
95
98
|
},
|
96
99
|
"button": {"title": "Mouse Button", "type": "string", "enum": ["left", "middle", "right"]},
|
97
100
|
"hold": {"title": "And Hold", "type": "boolean"},
|
@@ -102,6 +105,7 @@
|
|
102
105
|
},
|
103
106
|
"double_click": {
|
104
107
|
"type": "object",
|
108
|
+
"action_type": "action",
|
105
109
|
"title": "Double Click",
|
106
110
|
"description": "Double-clicks on the UI element",
|
107
111
|
"properties": {
|
@@ -111,7 +115,8 @@
|
|
111
115
|
"embedded_test_id": {"title": "Embedded Test ID", "type": "integer"},
|
112
116
|
"target": {
|
113
117
|
"title": "Target",
|
114
|
-
"$ref": "#/definitions/noun"
|
118
|
+
"$ref": "#/definitions/noun",
|
119
|
+
"type": "ui_element_reference"
|
115
120
|
}
|
116
121
|
},
|
117
122
|
"additionalProperties": false,
|
@@ -119,6 +124,7 @@
|
|
119
124
|
},
|
120
125
|
"fill": {
|
121
126
|
"type": "object",
|
127
|
+
"action_type": "action",
|
122
128
|
"title": "Fill",
|
123
129
|
"description": "Fills the text field with specified content",
|
124
130
|
"properties": {
|
@@ -128,7 +134,8 @@
|
|
128
134
|
"embedded_test_id": {"title": "Embedded Test ID", "type": "integer"},
|
129
135
|
"target": {
|
130
136
|
"title": "Target",
|
131
|
-
"$ref": "#/definitions/noun"
|
137
|
+
"$ref": "#/definitions/noun",
|
138
|
+
"type": "ui_element_reference"
|
132
139
|
},
|
133
140
|
"text": {"title": "Text", "type": "string"}
|
134
141
|
},
|
@@ -137,6 +144,7 @@
|
|
137
144
|
},
|
138
145
|
"type": {
|
139
146
|
"type": "object",
|
147
|
+
"action_type": "action",
|
140
148
|
"title": "Type",
|
141
149
|
"description": "Types in specified text",
|
142
150
|
"properties": {
|
@@ -151,6 +159,7 @@
|
|
151
159
|
},
|
152
160
|
"send_key": {
|
153
161
|
"type": "object",
|
162
|
+
"action_type": "action",
|
154
163
|
"title": "Press Key",
|
155
164
|
"description": "Press specified key or key combination.",
|
156
165
|
"properties": {
|
@@ -166,6 +175,7 @@
|
|
166
175
|
},
|
167
176
|
"hover": {
|
168
177
|
"type": "object",
|
178
|
+
"action_type": "action",
|
169
179
|
"title": "Hover",
|
170
180
|
"description": "Hovers over specified element",
|
171
181
|
"properties": {
|
@@ -175,7 +185,8 @@
|
|
175
185
|
"embedded_test_id": {"title": "Embedded Test ID", "type": "integer"},
|
176
186
|
"target": {
|
177
187
|
"title": "Target",
|
178
|
-
"$ref": "#/definitions/noun"
|
188
|
+
"$ref": "#/definitions/noun",
|
189
|
+
"type": "ui_element_reference"
|
179
190
|
}
|
180
191
|
},
|
181
192
|
"additionalProperties": false,
|
@@ -183,6 +194,7 @@
|
|
183
194
|
},
|
184
195
|
"select": {
|
185
196
|
"type": "object",
|
197
|
+
"action_type": "action",
|
186
198
|
"title": "Select",
|
187
199
|
"description": "Selects specified item from the dropdown",
|
188
200
|
"properties": {
|
@@ -192,7 +204,8 @@
|
|
192
204
|
"embedded_test_id": {"title": "Embedded Test ID", "type": "integer"},
|
193
205
|
"target": {
|
194
206
|
"title": "Target",
|
195
|
-
"$ref": "#/definitions/noun"
|
207
|
+
"$ref": "#/definitions/noun",
|
208
|
+
"type": "ui_element_reference"
|
196
209
|
},
|
197
210
|
"option": {
|
198
211
|
"title": "Option",
|
@@ -204,6 +217,7 @@
|
|
204
217
|
},
|
205
218
|
"refresh": {
|
206
219
|
"type": "object",
|
220
|
+
"action_type": "action",
|
207
221
|
"title": "Refresh",
|
208
222
|
"description": "Refreshes the webpage",
|
209
223
|
"properties": {
|
@@ -217,6 +231,7 @@
|
|
217
231
|
},
|
218
232
|
"navigate": {
|
219
233
|
"type": "object",
|
234
|
+
"action_type": "action",
|
220
235
|
"title": "Navigate",
|
221
236
|
"description": "Navigates to specified URL",
|
222
237
|
"properties": {
|
@@ -232,6 +247,7 @@
|
|
232
247
|
},
|
233
248
|
"close_tab": {
|
234
249
|
"type": "object",
|
250
|
+
"action_type": "action",
|
235
251
|
"title": "Close Tab",
|
236
252
|
"description": "Closes current browser tab",
|
237
253
|
"properties": {
|
@@ -245,6 +261,7 @@
|
|
245
261
|
},
|
246
262
|
"scroll": {
|
247
263
|
"type": "object",
|
264
|
+
"action_type": "action",
|
248
265
|
"title": "Scroll",
|
249
266
|
"description": "Scrolls the page into specified direction until target is reached",
|
250
267
|
"properties": {
|
@@ -255,7 +272,8 @@
|
|
255
272
|
"direction": {"title": "Direction", "type": "string", "enum": ["up", "down", "left", "right"]},
|
256
273
|
"target": {
|
257
274
|
"title": "Target",
|
258
|
-
"$ref": "#/definitions/noun"
|
275
|
+
"$ref": "#/definitions/noun",
|
276
|
+
"type": "ui_element_reference"
|
259
277
|
}
|
260
278
|
},
|
261
279
|
"additionalProperties": false,
|
@@ -263,6 +281,7 @@
|
|
263
281
|
},
|
264
282
|
"wait": {
|
265
283
|
"type": "object",
|
284
|
+
"action_type": "action",
|
266
285
|
"title": "Wait",
|
267
286
|
"description": "Waits for a number of seconds",
|
268
287
|
"properties": {
|
@@ -277,6 +296,7 @@
|
|
277
296
|
},
|
278
297
|
"drag_and_drop": {
|
279
298
|
"type": "object",
|
299
|
+
"action_type": "action",
|
280
300
|
"title": "Drag and drop",
|
281
301
|
"description": "Drag and drop",
|
282
302
|
"properties": {
|
@@ -290,7 +310,8 @@
|
|
290
310
|
},
|
291
311
|
"target": {
|
292
312
|
"title": "Target",
|
293
|
-
"$ref": "#/definitions/noun"
|
313
|
+
"$ref": "#/definitions/noun",
|
314
|
+
"type": "ui_element_reference"
|
294
315
|
}
|
295
316
|
},
|
296
317
|
"additionalProperties": false,
|
@@ -298,6 +319,7 @@
|
|
298
319
|
},
|
299
320
|
"embedded_test": {
|
300
321
|
"type": "object",
|
322
|
+
"action_type": "embedded_test",
|
301
323
|
"title": "Embedded Test",
|
302
324
|
"description": "Embeds a Test",
|
303
325
|
"properties": {
|
@@ -314,6 +336,7 @@
|
|
314
336
|
},
|
315
337
|
"tester_instruction": {
|
316
338
|
"type": "object",
|
339
|
+
"action_type": "action",
|
317
340
|
"title": "Tester Instruction",
|
318
341
|
"description": "An action for a human to complete",
|
319
342
|
"properties": {
|
@@ -328,10 +351,11 @@
|
|
328
351
|
},
|
329
352
|
"observe": {
|
330
353
|
"type": "object",
|
354
|
+
"action_type": "assertion",
|
331
355
|
"title": "Observe",
|
332
356
|
"description": "Checks if element of the UI is visible or not",
|
333
357
|
"properties": {
|
334
|
-
"
|
358
|
+
"action": {
|
335
359
|
"enum": ["observe"]
|
336
360
|
},
|
337
361
|
"embedded_test_id": {"title": "Embedded Test ID", "type": "integer"},
|
@@ -346,21 +370,37 @@
|
|
346
370
|
}
|
347
371
|
},
|
348
372
|
"additionalProperties": false,
|
349
|
-
"required": ["
|
373
|
+
"required": ["action", "object", "visibility"]
|
374
|
+
},
|
375
|
+
"loaded": {
|
376
|
+
"type": "object",
|
377
|
+
"action_type": "assertion",
|
378
|
+
"title": "Loaded",
|
379
|
+
"description": "Checks if specified page has loaded",
|
380
|
+
"properties": {
|
381
|
+
"action": {
|
382
|
+
"enum": ["loaded"]
|
383
|
+
},
|
384
|
+
"embedded_test_id": {"title": "Embedded Test ID", "type": "integer"},
|
385
|
+
"page": {"title": "Page", "type": "string"}
|
386
|
+
},
|
387
|
+
"additionalProperties": false,
|
388
|
+
"required": ["action", "page"]
|
350
389
|
},
|
351
390
|
"tester_confirmation": {
|
352
391
|
"type": "object",
|
392
|
+
"action_type": "assertion",
|
353
393
|
"title": "Tester Confirmation",
|
354
394
|
"description": "Ask a question to confirm a behavior",
|
355
395
|
"properties": {
|
356
|
-
"
|
396
|
+
"action": {
|
357
397
|
"enum": ["tester_confirmation"]
|
358
398
|
},
|
359
399
|
"embedded_test_id": {"title": "Embedded Test ID", "type": "integer"},
|
360
400
|
"confirmation": {"title": "confirmation", "type": "string"}
|
361
401
|
},
|
362
402
|
"additionalProperties": false,
|
363
|
-
"required": ["
|
403
|
+
"required": ["action", "confirmation"]
|
364
404
|
}
|
365
405
|
},
|
366
406
|
"type": "object",
|
data/lib/version.rb
CHANGED
data/lib/wisp-schema.rb
CHANGED
@@ -4,18 +4,44 @@ require 'semantic'
|
|
4
4
|
require_relative 'version'
|
5
5
|
|
6
6
|
module Wisp
|
7
|
+
class NotSupportedAction < StandardError
|
8
|
+
end
|
9
|
+
|
7
10
|
SCHEMA_PATH = File.expand_path('../wisp.json', __dir__)
|
8
11
|
NOUNS_PATH = File.expand_path('../nouns.json', __dir__)
|
9
12
|
|
10
13
|
CANARY_SCHEMA_PATH = File.expand_path('../canary-wisp.json', __dir__)
|
11
14
|
CANARY_NOUNS_PATH = File.expand_path('../canary-nouns.json', __dir__)
|
12
15
|
|
16
|
+
ACTIONS = [
|
17
|
+
"click",
|
18
|
+
"close_tab",
|
19
|
+
"double_click",
|
20
|
+
"drag_and_drop",
|
21
|
+
"fill",
|
22
|
+
"hover",
|
23
|
+
"loaded",
|
24
|
+
"navigate",
|
25
|
+
"observe",
|
26
|
+
"refresh",
|
27
|
+
"scroll",
|
28
|
+
"select",
|
29
|
+
"send_key",
|
30
|
+
"tester_confirmation",
|
31
|
+
"tester_instruction",
|
32
|
+
"type",
|
33
|
+
"wait",
|
34
|
+
].freeze
|
35
|
+
|
13
36
|
SEMANTIC_STABLE_VERSION = Semantic::Version.new(STABLE_VERSION)
|
14
37
|
|
15
|
-
def
|
16
|
-
|
38
|
+
def is_canary?(raw_version)
|
39
|
+
Semantic::Version.new(raw_version) > SEMANTIC_STABLE_VERSION
|
40
|
+
end
|
41
|
+
module_function :is_canary?
|
17
42
|
|
18
|
-
|
43
|
+
def wisp_schemer(raw_version)
|
44
|
+
if is_canary?(raw_version)
|
19
45
|
JSONSchemer.schema(Pathname.new(Wisp::CANARY_SCHEMA_PATH))
|
20
46
|
else
|
21
47
|
JSONSchemer.schema(Pathname.new(Wisp::SCHEMA_PATH))
|
@@ -24,13 +50,22 @@ module Wisp
|
|
24
50
|
module_function :wisp_schemer
|
25
51
|
|
26
52
|
def nouns_schemer(raw_version)
|
27
|
-
|
28
|
-
|
29
|
-
if version > SEMANTIC_STABLE_VERSION
|
53
|
+
if is_canary?(raw_version)
|
30
54
|
JSONSchemer.schema(Pathname.new(Wisp::CANARY_NOUNS_PATH))
|
31
55
|
else
|
32
56
|
JSONSchemer.schema(Pathname.new(Wisp::NOUNS_PATH))
|
33
57
|
end
|
34
58
|
end
|
35
59
|
module_function :nouns_schemer
|
60
|
+
|
61
|
+
def action_schemer(raw_version, action)
|
62
|
+
raise NotSupportedAction unless ACTIONS.include?(action)
|
63
|
+
|
64
|
+
if is_canary?(raw_version)
|
65
|
+
JSONSchemer.schema(Pathname.new(File.expand_path("../canary/actions/#{action}.json", __dir__)))
|
66
|
+
else
|
67
|
+
JSONSchemer.schema(Pathname.new(File.expand_path("../stable/actions/#{action}.json", __dir__)))
|
68
|
+
end
|
69
|
+
end
|
70
|
+
module_function :action_schemer
|
36
71
|
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
{
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
3
|
+
"type": "object",
|
4
|
+
"action_type": "action",
|
5
|
+
"title": "Click",
|
6
|
+
"description": "Clicks on the UI element",
|
7
|
+
"properties": {
|
8
|
+
"action": {
|
9
|
+
"enum": ["click"]
|
10
|
+
},
|
11
|
+
"target": {
|
12
|
+
"title": "Target",
|
13
|
+
"$ref": "ui_element_reference.json"
|
14
|
+
},
|
15
|
+
"button": {"title": "Mouse Button", "type": "string", "enum": ["left", "middle", "right"]},
|
16
|
+
"hold": {"title": "And Hold", "type": "boolean"},
|
17
|
+
"hold_seconds": {"title": "Hold seconds", "type": "integer"},
|
18
|
+
"version": {
|
19
|
+
"type": "string",
|
20
|
+
"title": "Version"
|
21
|
+
}
|
22
|
+
},
|
23
|
+
"additionalProperties": false,
|
24
|
+
"required": ["action", "target", "button", "hold", "version"]
|
25
|
+
}
|
@@ -0,0 +1,18 @@
|
|
1
|
+
{
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
3
|
+
"type": "object",
|
4
|
+
"action_type": "action",
|
5
|
+
"title": "Close Tab",
|
6
|
+
"description": "Closes current browser tab",
|
7
|
+
"properties": {
|
8
|
+
"action": {
|
9
|
+
"enum": ["close_tab"]
|
10
|
+
},
|
11
|
+
"version": {
|
12
|
+
"type": "string",
|
13
|
+
"title": "Version"
|
14
|
+
}
|
15
|
+
},
|
16
|
+
"additionalProperties": false,
|
17
|
+
"required": ["action", "version"]
|
18
|
+
}
|
@@ -0,0 +1,22 @@
|
|
1
|
+
{
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
3
|
+
"type": "object",
|
4
|
+
"action_type": "action",
|
5
|
+
"title": "Double Click",
|
6
|
+
"description": "Double-clicks on the UI element",
|
7
|
+
"properties": {
|
8
|
+
"action": {
|
9
|
+
"enum": ["double_click"]
|
10
|
+
},
|
11
|
+
"target": {
|
12
|
+
"title": "Target",
|
13
|
+
"$ref": "ui_element_reference.json"
|
14
|
+
},
|
15
|
+
"version": {
|
16
|
+
"type": "string",
|
17
|
+
"title": "Version"
|
18
|
+
}
|
19
|
+
},
|
20
|
+
"additionalProperties": false,
|
21
|
+
"required": ["action", "target", "version"]
|
22
|
+
}
|
@@ -0,0 +1,26 @@
|
|
1
|
+
{
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
3
|
+
"type": "object",
|
4
|
+
"action_type": "action",
|
5
|
+
"title": "Drag and drop",
|
6
|
+
"description": "Drag and drop",
|
7
|
+
"properties": {
|
8
|
+
"action": {
|
9
|
+
"enum": ["drag_and_drop"]
|
10
|
+
},
|
11
|
+
"object": {
|
12
|
+
"title": "Object",
|
13
|
+
"$ref": "ui_element_reference.json"
|
14
|
+
},
|
15
|
+
"target": {
|
16
|
+
"title": "Target",
|
17
|
+
"$ref": "ui_element_reference.json"
|
18
|
+
},
|
19
|
+
"version": {
|
20
|
+
"type": "string",
|
21
|
+
"title": "Version"
|
22
|
+
}
|
23
|
+
},
|
24
|
+
"additionalProperties": false,
|
25
|
+
"required": ["action", "target", "object", "version"]
|
26
|
+
}
|
@@ -0,0 +1,23 @@
|
|
1
|
+
{
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
3
|
+
"type": "object",
|
4
|
+
"action_type": "action",
|
5
|
+
"title": "Fill",
|
6
|
+
"description": "Fills the text field with specified content",
|
7
|
+
"properties": {
|
8
|
+
"action": {
|
9
|
+
"enum": ["fill"]
|
10
|
+
},
|
11
|
+
"target": {
|
12
|
+
"title": "Target",
|
13
|
+
"$ref": "ui_element_reference.json"
|
14
|
+
},
|
15
|
+
"text": {"title": "Text", "type": "string"},
|
16
|
+
"version": {
|
17
|
+
"type": "string",
|
18
|
+
"title": "Version"
|
19
|
+
}
|
20
|
+
},
|
21
|
+
"additionalProperties": false,
|
22
|
+
"required": ["action", "target", "text", "version"]
|
23
|
+
}
|