Skip to content

Commit 8eff1da

Browse files
authored
Update README.md
1 parent d89a63d commit 8eff1da

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

README.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ Once you are familiar with Karate and have created a few tests, you may want to
5555
<tr>
5656
<tr>
5757
<td><a href="#inline-reports">Inline Reports</a></td>
58+
<td><a href="#launch-configurations">Launch Configurations</a></td>
5859
</tr>
5960
</table>
6061

@@ -164,6 +165,42 @@ You can also see all HTTP calls made during a test.
164165

165166
<img height="350" src="https://user-images.githubusercontent.com/915480/214325821-96d480c5-6dba-4459-9f93-0685caea60a2.gif">
166167

168+
## Launch Configurations
169+
In "Pro" mode, the plugin supports VS Code launch configurations in the `.vscode/launch.json` file. Here is an example configuration:
170+
171+
```json
172+
{
173+
"version": "0.2.0",
174+
"configurations": [
175+
{
176+
"type": "karate",
177+
"name": "env-test",
178+
"request": "launch",
179+
"feature": "${file}",
180+
"karateArgs": [
181+
"-e",
182+
"test"
183+
]
184+
}
185+
]
186+
}
187+
```
188+
189+
The advantage is that you can set up any combination of [Karate runtime options](https://github.com/karatelabs/karate#karateoptions) via `karateArgs`. For example you can:
190+
* [run tests in parallel](https://github.com/karatelabs/karate/tree/master/karate-netty#parallel-execution)
191+
* [set the environment](https://github.com/karatelabs/karate/tree/master/karate-netty#karateenv)
192+
* or [choose tags](https://github.com/karatelabs/karate/tree/master/karate-netty#tags) to include or exclude.
193+
194+
Now you can run tests from the [Run and Debug](https://code.visualstudio.com/docs/editor/debugging#_launch-configurations) view in VS Code and keyboard short-cuts such as `F5` will work for the currently focused file in the editor. Note that you can even Run without Debugging: `Ctrl + F5`.
195+
196+
<img height="350" src="https://github.com/karatelabs/karate-vscode-extension/assets/915480/d324e0d9-24a0-4250-9704-13e907494330">
197+
198+
You can have multiple configurations and easily switch between them.
199+
200+
You can add `"noDebug": true` to the run-configuration JSON to force "Run without Debugging" for convenience.
201+
202+
Instead of `${file}` as the value for `feature`, you can use any valid folder path or even multiple feature files.
203+
167204
# Coming Soon
168205
* Better IntelliSense & Auto-complete
169206
* Improved syntax validation

0 commit comments

Comments
 (0)