@@ -203,11 +203,12 @@ Then I verify response "$response.payload.data.items[0].title" equals to "TEST"
203203---
204204### I create \{ string} request \{ string}
205205
206- Create request template and save it to memory
206+ Create request and save it to memory
207207
208- | param | type | description |
209- | :------:| :------:| :-----------:|
210- | method | string | API method |
208+ | param | type | description |
209+ | :----------:| :------:| :-------------------:|
210+ | method | string | API method |
211+ | requestKey | string | key to save request |
211212
212213``` gherkin
213214When I create 'GET' request 'request'
@@ -309,3 +310,141 @@ When I create 'GET' request 'request'
309310And I add 'https://qavajs.github.io/' url to '$request'
310311And I send '$request' request and save response as 'response'
311312```
313+
314+ ---
315+ ### I create GraphQL request \{ string}
316+
317+ Create GraphQL request and save it to memory
318+
319+ | param | type | description |
320+ | :----------:| :------:| :-------------------:|
321+ | requestKey | string | key to save request |
322+
323+ ``` gherkin
324+ When I create GraphQL request 'request'
325+ ```
326+
327+ ---
328+ ### I add \{ gqlRequestProperty} to GraphQL \{ string}: [ Multiline]
329+
330+ Add GraphQL property
331+
332+ | param | type | description |
333+ | :----------:| :------:| :----------------------:|
334+ | property | string | query or variables |
335+ | requestKey | string | memory key of request |
336+ | value | string | value multiline string |
337+
338+ ``` gherkin
339+ When I create GraphQL request 'request'
340+ And I add query to GraphQL '$request':
341+ """
342+ query {
343+ characters(page: 2, filter: { name: "rick" }) {
344+ results {
345+ name
346+ }
347+ }
348+ }
349+ """
350+ And I add variables to GraphQL '$request':
351+ """
352+ {
353+ "value": 42
354+ }
355+ """
356+ ```
357+
358+ ## Websocket Steps
359+
360+ ---
361+ ### I connect to \{ string} ws endpoint \{ string}
362+
363+ Connect to websocket endpoint and save connection to memory
364+
365+ | param | type | description |
366+ | :----------:| :------:| :-------------------:|
367+ | url | string | websocket endpoint |
368+ | requestKey | string | key to save request |
369+
370+ ``` gherkin
371+ When I connect to 'ws://localhost:3000' ws endpoint 'ws'
372+ ```
373+
374+ ---
375+ ### I save message from \{ string} ws endpoint as \{ string}
376+
377+ Save message from websocket connection to memory
378+
379+ | param | type | description |
380+ | :-------------:| :------:| :------------------------------:|
381+ | connectionKey | string | memory key of saved connection |
382+ | memoryKey | string | memory key to save message |
383+
384+ ``` gherkin
385+ When I connect to 'ws://localhost:3000' ws endpoint 'ws'
386+ And I save message from '$ws' ws endpoint as 'message'
387+ ```
388+
389+ ---
390+ ### I save message matching \{ string} from \{ string} ws endpoint as \{ string}'
391+
392+ Save message matching regexp from websocket connection to memory
393+
394+ | param | type | description |
395+ | :-------------:| :------:| :------------------------------:|
396+ | regexp | string | regexp to filter messages |
397+ | connectionKey | string | memory key of saved connection |
398+ | memoryKey | string | memory key to save message |
399+
400+ ``` gherkin
401+ When I connect to 'ws://localhost:3000' ws endpoint 'ws'
402+ And I save message matching 'qavajs test' from '$ws' ws endpoint as 'message'
403+ ```
404+
405+ ---
406+ ### I send \{ string} message to \{ string} ws endpoint
407+
408+ Send message to websocket
409+
410+ | param | type | description |
411+ | :-------------:| :------:| :------------------------------:|
412+ | message | string | message to send |
413+ | connectionKey | string | memory key of saved connection |
414+
415+ ``` gherkin
416+ When I connect to 'ws://localhost:3000' ws endpoint 'ws'
417+ And I send 'qavajs' message to '$ws' ws endpoint
418+ ```
419+
420+ ---
421+ ### I send message to \{ string} ws endpoint: [ Multiline]
422+
423+ Send message to websocket
424+
425+ | param | type | description |
426+ | :-------------:| :------:| :------------------------------:|
427+ | connectionKey | string | memory key of saved connection |
428+ | message | string | message to send |
429+
430+ ``` gherkin
431+ When I connect to 'ws://localhost:3000' ws endpoint 'ws'
432+ And I send message to '$ws' ws endpoint:
433+ """
434+ qavajs
435+ """
436+ ```
437+
438+ ---
439+ ### I close \{ string} ws connection
440+
441+ Close websocket connection
442+
443+ | param | type | description |
444+ | :-------------:| :------:| :------------------------------:|
445+ | connectionKey | string | memory key of saved connection |
446+
447+ ``` gherkin
448+ When I connect to 'ws://localhost:3000' ws endpoint 'ws'
449+ And I close '$ws' ws connection
450+ ```
0 commit comments