wisp-schema 1.0.1 → 1.0.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 908f03765ec903816a9fe1a86a89915ba2b54f437b14ad4fd26f82ab0f7d964a
4
- data.tar.gz: 74fb5b6b46d4dbbe2e937075fb3c024f82295fa4c1e291c474580641fa4afd1c
3
+ metadata.gz: 440717453e56bc6b9fdb2ac23fa5acab01e76975840a3ae9005cb82b6d876cea
4
+ data.tar.gz: bac04b791a26cea2ba3c0775794d05988ff2749c9a000a8a0d58365137cf15e7
5
5
  SHA512:
6
- metadata.gz: 016e76f2aa05757ca6baff83c8ad00423681a405675066bd164d11d545868338023a09c1aa11c59d7f923f4272f1135a7f703143ed287b58326802dae183e9b2
7
- data.tar.gz: 26c3b60bdeb6344107b9f42734d33eb672e6e33f4e801ef1b39b0313f9b33c92a87e1507048efd74ed41389e6f480aa6abb14c50063f80445130a710a24db047
6
+ metadata.gz: eba99df0496a5e3ed596015ec19b3064e3c2c12d30db13eb455922b9bd2ada9599aca1c6dc02cf331a0555e09a7fe95773c87c2d1be9c4a3a83d0d7b41bd1fd9
7
+ data.tar.gz: ad23771078a30e0921927c33b490ba603e130d2f830000a2547dc36abd45be7bdd4929ddbafdc6e718033dc5aafdb51a817ebaff1f61c9492308cf2f0ff7b625
@@ -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": {
@@ -228,10 +243,11 @@
228
243
  "tab": {"title": "Tab", "type": "string", "enum": ["current", "new", "incognito"]}
229
244
  },
230
245
  "additionalProperties": false,
231
- "required": ["action", "url"]
246
+ "required": ["action", "url", "tab"]
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,8 +336,9 @@
314
336
  },
315
337
  "tester_instruction": {
316
338
  "type": "object",
339
+ "action_type": "action",
317
340
  "title": "Tester Instruction",
318
- "description": "Allows to fallback to english",
341
+ "description": "An action for a human to complete",
319
342
  "properties": {
320
343
  "action": {
321
344
  "enum": ["tester_instruction"]
@@ -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
- "assertion": {
358
+ "action": {
335
359
  "enum": ["observe"]
336
360
  },
337
361
  "embedded_test_id": {"title": "Embedded Test ID", "type": "integer"},
@@ -339,24 +363,44 @@
339
363
  "title": "Object",
340
364
  "$ref": "#/definitions/noun"
341
365
  },
342
- "visiblity": {"title": "Is the element visible?", "type": "boolean"}
366
+ "visibility": {
367
+ "title": "Is the element visible?",
368
+ "type": "boolean",
369
+ "enum": [true, false]
370
+ }
371
+ },
372
+ "additionalProperties": false,
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"}
343
386
  },
344
387
  "additionalProperties": false,
345
- "required": ["assertion", "object"]
388
+ "required": ["action", "page"]
346
389
  },
347
390
  "tester_confirmation": {
348
391
  "type": "object",
392
+ "action_type": "assertion",
349
393
  "title": "Tester Confirmation",
350
- "description": "Allows to fallback to english",
394
+ "description": "Ask a question to confirm a behavior",
351
395
  "properties": {
352
- "assertion": {
396
+ "action": {
353
397
  "enum": ["tester_confirmation"]
354
398
  },
355
399
  "embedded_test_id": {"title": "Embedded Test ID", "type": "integer"},
356
400
  "confirmation": {"title": "confirmation", "type": "string"}
357
401
  },
358
402
  "additionalProperties": false,
359
- "required": ["assertion", "confirmation"]
403
+ "required": ["action", "confirmation"]
360
404
  }
361
405
  },
362
406
  "type": "object",
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Wisp
4
- VERSION = '1.0.1'
4
+ VERSION = '1.0.6'
5
5
  STABLE_VERSION = '0.18.1'
6
6
  end
@@ -12,10 +12,13 @@ module Wisp
12
12
 
13
13
  SEMANTIC_STABLE_VERSION = Semantic::Version.new(STABLE_VERSION)
14
14
 
15
- def wisp_schemer(raw_version)
16
- version = Semantic::Version.new(raw_version)
15
+ def is_canary?(raw_version)
16
+ Semantic::Version.new(raw_version) > SEMANTIC_STABLE_VERSION
17
+ end
18
+ module_function :is_canary?
17
19
 
18
- if version > SEMANTIC_STABLE_VERSION
20
+ def wisp_schemer(raw_version)
21
+ if is_canary?(raw_version)
19
22
  JSONSchemer.schema(Pathname.new(Wisp::CANARY_SCHEMA_PATH))
20
23
  else
21
24
  JSONSchemer.schema(Pathname.new(Wisp::SCHEMA_PATH))
@@ -24,9 +27,7 @@ module Wisp
24
27
  module_function :wisp_schemer
25
28
 
26
29
  def nouns_schemer(raw_version)
27
- version = Semantic::Version.new(raw_version)
28
-
29
- if version > SEMANTIC_STABLE_VERSION
30
+ if is_canary?(raw_version)
30
31
  JSONSchemer.schema(Pathname.new(Wisp::CANARY_NOUNS_PATH))
31
32
  else
32
33
  JSONSchemer.schema(Pathname.new(Wisp::NOUNS_PATH))
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wisp-schema
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jan Grodowski