Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 70 additions & 0 deletions docs/Guides/vscode.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
---
sidebar_position: 7
---
# Visual Studio Code

https://github.com/qavajs/vscode/releases

https://marketplace.visualstudio.com/items?itemName=qavajs.qavajs

## Features

- VSCode Test Explorer
- Template Autocomplete
- Constants Autocomplete
- Page Object Autocomplete
- Page Object Explorer

## Extension Settings

This extension contributes the following settings:

* `cucumber.features`: gherkin files paths (array)
* `cucumber.glue`: step definition file paths (array)
* `qavajs.templates`: templates files paths (array)
* `qavajs.pageObject`: page object root file path (string)
* `qavajs.memory`: memory root file path (string)
* `qavajs.launchCommand`: qavajs launch command (default: `npx qavajs run`) (string)

```json
{
"files.associations": {
"*.feature": "cucumber"
},
"cucumber.features": [
"features/**/*.feature"
],
"cucumber.glue": [
"node_modules/@qavajs/**/src/*.ts",
"step_definition/*.ts"
],
"qavajs.templates": [
"templates/*.feature"
],
"qavajs.pageObject": "page_object/index.ts",
"qavajs.memory": "memory/index.ts",
"qavajs.launchCommand": "npx qavajs run --config config.ts",
}
```

## How To Use

### Test Explorer
![](../../static/img/test_explorer.png)

### Page Object Explorer
Click the copy icon to copy qavajs path
![](../../static/img/po_explorer.png)

### Page Object Autocomplete
Type ?
![](../../static/img/po_autocomplete.png)

### Constants Autocomplete
Type $
![](../../static/img/memory_autocomplete.png)

## Known Issues and Limitation

* typescript projects require installed `ts-node`
* @qavajs/cli > 0.34.2
147 changes: 143 additions & 4 deletions docs/Steps/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -203,11 +203,12 @@ Then I verify response "$response.payload.data.items[0].title" equals to "TEST"
---
### I create \{string} request \{string}

Create request template and save it to memory
Create request and save it to memory

| param | type | description |
|:------:|:------:|:-----------:|
| method | string | API method |
| param | type | description |
|:----------:|:------:|:-------------------:|
| method | string | API method |
| requestKey | string | key to save request |

```gherkin
When I create 'GET' request 'request'
Expand Down Expand Up @@ -309,3 +310,141 @@ When I create 'GET' request 'request'
And I add 'https://qavajs.github.io/' url to '$request'
And I send '$request' request and save response as 'response'
```

---
### I create GraphQL request \{string}

Create GraphQL request and save it to memory

| param | type | description |
|:----------:|:------:|:-------------------:|
| requestKey | string | key to save request |

```gherkin
When I create GraphQL request 'request'
```

---
### I add \{gqlRequestProperty} to GraphQL \{string}: [Multiline]

Add GraphQL property

| param | type | description |
|:----------:|:------:|:----------------------:|
| property | string | query or variables |
| requestKey | string | memory key of request |
| value | string | value multiline string |

```gherkin
When I create GraphQL request 'request'
And I add query to GraphQL '$request':
"""
query {
characters(page: 2, filter: { name: "rick" }) {
results {
name
}
}
}
"""
And I add variables to GraphQL '$request':
"""
{
"value": 42
}
"""
```

## Websocket Steps

---
### I connect to \{string} ws endpoint \{string}

Connect to websocket endpoint and save connection to memory

| param | type | description |
|:----------:|:------:|:-------------------:|
| url | string | websocket endpoint |
| requestKey | string | key to save request |

```gherkin
When I connect to 'ws://localhost:3000' ws endpoint 'ws'
```

---
### I save message from \{string} ws endpoint as \{string}

Save message from websocket connection to memory

| param | type | description |
|:-------------:|:------:|:------------------------------:|
| connectionKey | string | memory key of saved connection |
| memoryKey | string | memory key to save message |

```gherkin
When I connect to 'ws://localhost:3000' ws endpoint 'ws'
And I save message from '$ws' ws endpoint as 'message'
```

---
### I save message matching \{string} from \{string} ws endpoint as \{string}'

Save message matching regexp from websocket connection to memory

| param | type | description |
|:-------------:|:------:|:------------------------------:|
| regexp | string | regexp to filter messages |
| connectionKey | string | memory key of saved connection |
| memoryKey | string | memory key to save message |

```gherkin
When I connect to 'ws://localhost:3000' ws endpoint 'ws'
And I save message matching 'qavajs test' from '$ws' ws endpoint as 'message'
```

---
### I send \{string} message to \{string} ws endpoint

Send message to websocket

| param | type | description |
|:-------------:|:------:|:------------------------------:|
| message | string | message to send |
| connectionKey | string | memory key of saved connection |

```gherkin
When I connect to 'ws://localhost:3000' ws endpoint 'ws'
And I send 'qavajs' message to '$ws' ws endpoint
```

---
### I send message to \{string} ws endpoint: [Multiline]

Send message to websocket

| param | type | description |
|:-------------:|:------:|:------------------------------:|
| connectionKey | string | memory key of saved connection |
| message | string | message to send |

```gherkin
When I connect to 'ws://localhost:3000' ws endpoint 'ws'
And I send message to '$ws' ws endpoint:
"""
qavajs
"""
```

---
### I close \{string} ws connection

Close websocket connection

| param | type | description |
|:-------------:|:------:|:------------------------------:|
| connectionKey | string | memory key of saved connection |

```gherkin
When I connect to 'ws://localhost:3000' ws endpoint 'ws'
And I close '$ws' ws connection
```
3 changes: 1 addition & 2 deletions docs/intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,4 @@ Config file extends Cucumber [config file](https://github.com/cucumber/cucumber-
| `services` | `[]` | list of services to run before/after tests (setup/teardown selenium, appium etc.) | [] |
| `memory` | `object` | instance of memory object with loaded constants and computed | {} |

### VSCode Extension
https://github.com/qavajs/vscode/releases

2 changes: 1 addition & 1 deletion docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const config = {
baseUrl: '/',
onBrokenLinks: 'throw',
onBrokenMarkdownLinks: 'warn',
favicon: 'img/favicon.ico',
favicon: 'img/icon.png',

// GitHub pages deployment config.
// If you aren't using GitHub pages, you don't need these.
Expand Down
Loading