ok, there is a new version of robotcode, you need to update to at least 0.64.1.
Now you can create a launch.config
if you don’t already have one.
Open your launch.config
, now you can create a new “RobotCode: Test Profile” configuration.
It should look like this:
{
"name": "RobotCode: Test Profile",
"type": "robotcode",
"request": "launch",
"presentation": {
"hidden": true
},
"purpose": "test-profile"
},
The important thing is the purpose
property, which defines what this configuration is for. This must be test-profile
. If your VSCode is already set for your normal execution, you can now overwrite certain settings. For example, the robot global variables or the environment variables:
Here are a few examples:
{
"name": "No Headless",
"type": "robotcode",
"request": "launch",
"presentation": {
"hidden": true
},
"purpose": "test-profile",
"variables": {
"HEADLESS": "False"
}
},
{
"name": "Test Env",
"type": "robotcode",
"request": "launch",
"presentation": {
"hidden": true
},
"purpose": "test-profile",
"variables": {
"URL": "https://test.app.com",
"USER": "test_user"
}
},
{
"name": "Prod Env",
"type": "robotcode",
"request": "launch",
"presentation": {
"hidden": true
},
"purpose": "test-profile",
"variables": {
"URL": "https://prod.app.com",
"USER": "prod_user"
},
"exclude": ["wip"]
},
You can now select these profiles in the Test Explorer using the Run or Debug button. But also in the context menu of a test case or suite in the Explorer, but also on the Play button next to the test case in the Editor, via the “Execute Using Profile” entry,
You can also select the default profiles at the top of the Test Explorer, in the menu of the Run or Debug button. Please only select one profile at a time, otherwise the test will run 2 or 3 or 4 times at the same time. But this is a feature of VSCode, you just have to know it
Hope that fits, if you find bugs or have any suggestions, it is easiest if you put an entry on github: Issues · d-biehl/robotcode · GitHub
And thanks in advance for trying out!!!