Skip to content

Commit d9f8d14

Browse files
added graphql steps (#74)
added vscode extension docs added favicon
1 parent 30b70f5 commit d9f8d14

File tree

11 files changed

+505
-296
lines changed

11 files changed

+505
-296
lines changed

docs/Guides/vscode.md

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
---
2+
sidebar_position: 7
3+
---
4+
# Visual Studio Code
5+
6+
https://github.com/qavajs/vscode/releases
7+
8+
https://marketplace.visualstudio.com/items?itemName=qavajs.qavajs
9+
10+
## Features
11+
12+
- VSCode Test Explorer
13+
- Template Autocomplete
14+
- Constants Autocomplete
15+
- Page Object Autocomplete
16+
- Page Object Explorer
17+
18+
## Extension Settings
19+
20+
This extension contributes the following settings:
21+
22+
* `cucumber.features`: gherkin files paths (array)
23+
* `cucumber.glue`: step definition file paths (array)
24+
* `qavajs.templates`: templates files paths (array)
25+
* `qavajs.pageObject`: page object root file path (string)
26+
* `qavajs.memory`: memory root file path (string)
27+
* `qavajs.launchCommand`: qavajs launch command (default: `npx qavajs run`) (string)
28+
29+
```json
30+
{
31+
"files.associations": {
32+
"*.feature": "cucumber"
33+
},
34+
"cucumber.features": [
35+
"features/**/*.feature"
36+
],
37+
"cucumber.glue": [
38+
"node_modules/@qavajs/**/src/*.ts",
39+
"step_definition/*.ts"
40+
],
41+
"qavajs.templates": [
42+
"templates/*.feature"
43+
],
44+
"qavajs.pageObject": "page_object/index.ts",
45+
"qavajs.memory": "memory/index.ts",
46+
"qavajs.launchCommand": "npx qavajs run --config config.ts",
47+
}
48+
```
49+
50+
## How To Use
51+
52+
### Test Explorer
53+
![](../../static/img/test_explorer.png)
54+
55+
### Page Object Explorer
56+
Click the copy icon to copy qavajs path
57+
![](../../static/img/po_explorer.png)
58+
59+
### Page Object Autocomplete
60+
Type ?
61+
![](../../static/img/po_autocomplete.png)
62+
63+
### Constants Autocomplete
64+
Type $
65+
![](../../static/img/memory_autocomplete.png)
66+
67+
## Known Issues and Limitation
68+
69+
* typescript projects require installed `ts-node`
70+
* @qavajs/cli > 0.34.2

docs/Steps/api.md

Lines changed: 143 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -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
213214
When I create 'GET' request 'request'
@@ -309,3 +310,141 @@ When I create 'GET' request 'request'
309310
And I add 'https://qavajs.github.io/' url to '$request'
310311
And 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+
```

docs/intro.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,5 +50,4 @@ Config file extends Cucumber [config file](https://github.com/cucumber/cucumber-
5050
| `services` | `[]` | list of services to run before/after tests (setup/teardown selenium, appium etc.) | [] |
5151
| `memory` | `object` | instance of memory object with loaded constants and computed | {} |
5252

53-
### VSCode Extension
54-
https://github.com/qavajs/vscode/releases
53+

docusaurus.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const config = {
1313
baseUrl: '/',
1414
onBrokenLinks: 'throw',
1515
onBrokenMarkdownLinks: 'warn',
16-
favicon: 'img/favicon.ico',
16+
favicon: 'img/icon.png',
1717

1818
// GitHub pages deployment config.
1919
// If you aren't using GitHub pages, you don't need these.

0 commit comments

Comments
 (0)