-
Why I am not able to configure the suite name with snake_case in VSCODE: {
"python.analysis.typeCheckingMode": "basic",
"[python]": {
"editor.defaultFormatter": "ms-python.black-formatter",
"editor.formatOnSave": true
},
"black-formatter.args": ["--line-length", "120"],
"[robotframework]": {
"editor.defaultFormatter": "ms-python.black-formatter"
},
"robotcode.robot.pythonPath": [
"./configs",
"./resources"
],
"robotcode.robot.args": [
"-e", "WIP",
"-V", "./configs/settings.yaml",
"--outputdir", "./test_results",
"--consolecolors", "on",
"--suite", "filename",
]
} Here there is a problem it is "filename" for --suite because if I use snake_case folder hierarchy the code will fail due to /usr/bin/env /bin/python3 ...username/.vscode/extensions/d-biehl.robotcode-0.90.0/bundled/tool/robotcode --default-path . debug --no-debug --tcp 54855 -- -P ./configs -P ./resources -e WIP -V ./configs/settings.yaml --outputdir ./test_results --consolecolors on --parse-include test_suit/pre_analysis/triaging.robot --name Frpa-Tools --suite Frpa-Tools.Test\ Suit.Pre\ Analysis.Triaging --by-longname Frpa-Tools.Test\ Suit.Pre\ Analysis.Triaging.Test\ Diagnostic\ Connection And my folder structure was : frpa_tools/test_suit/pre_analysis/triaging.robot But it failed because every folder was called a test execution going 5 test exec like sub-test execution. But My Configuration for launch.json is correct : For Example {
"version": "0.2.0",
"configurations": [
{
"name": "RobotCode: Run Current",
"type": "robotcode",
"request": "launch",
"cwd": "${workspaceFolder}",
"target": "${file}",
"attachPython": true,
}
],
"robotcode.robot.args": [
"-e", "WIP",
"-V", "./configs/settings.yaml",
"--outputdir", "./test_results",
"--consolecolors", "on"
],
} And it is executing like this : /usr/bin/env PYTHONPATH=/lhome/username/.vscode/extensions/ms-python.debugpy-2024.10.0-linux-x64/bundled/libs /bin/python3 /lhome/alperdo/.vscode/extensions/d-biehl.robotcode-0.90.0/bundled/tool/robotcode debug --debugpy -- -P ./configs -P ./resources -e WIP -V ./configs/settings.yaml --outputdir ./test_results --consolecolors on --suite ...username/Works/Projects/frpa-tools/test_suit/pre_analysis/triaging.robot This is the correct way of calling the suite!!! How can I call it this way with settings.json or into robotcode extension or into the vscode? |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments
-
Why do you want to write all the arguments in the settings You don't have to activate the The Normally you should be able to execute the test cases individually via the Run button next to the test case name, furthermore there is the test explorer in VSCode in which you can also explicitly select, filter, execute, debug etc. test cases. a launch config to exclude WIP's can look like this: {
"version": "0.2.0",
"configurations": [
{
"name": "RobotCode: Run Current",
"type": "robotcode",
"request": "launch",
"cwd": "${workspaceFolder}",
"target": "${file}",
"exclude": ["WIP"],
"outputDir": "output",
},
{
"name": "RobotCode: Run All",
"type": "robotcode",
"request": "launch",
"cwd": "${workspaceFolder}",
"target": ".",
"exclude": ["WIP"],
"outputDir": "output",
}
]
} But I don't think it's the answer to your question yet, so what exactly do you want to achieve and why? |
Beta Was this translation helpful? Give feedback.
-
@d-biehl this is also Fine for launch and for debugging the code. What I wanted to see is when I executed the code I was expecting instead of the folder hierarchy for text execution, see the name of the test file and the logo of that file and the test results, not folders. Is it possible for robotcode to add this kind of option as an argument ? Also thank you for the argument configuration you shared. After I wrote to you, I also noticed it and edited it. Can we add this feature with a checkbox? When I come to the test and click the execute button, I want to run and see only that test and its output on vscode. I didn't want to see each of the folders as if they were part of that test. |
Beta Was this translation helpful? Give feedback.
-
No this is not possible and robotcode has no influence of that what robot prints out. Depending of how and what you start, the name of the top level suite becomes different, if you execute a folder then the name of the suite is the capitalized folder name, if you execute a robot file then the name of the suite is the capitalized name of the file without the extension. But this is not all, also the internal id's of the suites and test becomes different, the builtin variables changes. This makes it later hard to compare different test runs and also to find bugs and so on. In Robot Framework also a folder is a suite and that folder can contain subfolders that are also suites and files. Under normal circumstances you should run your test starting from the same top level folder/suite to get the same ID and also the same internal behavior and filter the test cases via the --suite, --test or --tags arguments, as robotcode it does. But:
|
Beta Was this translation helpful? Give feedback.
-
@d-biehl Thank you for your quick response, I saw your message. Here is my final launch.json {
"version": "0.2.0",
"configurations": [
{
"name": "RobotCode: Run Current",
"type": "robotcode",
"request": "launch",
"cwd": "${workspaceFolder}",
"target": "${file}",
"attachPython": true,
"exclude": ["WIP"],
"variableFiles": ["./configs/settings.yaml"],
"outputDir": "./test_results"
},
{
"name": "RobotCode: Run All",
"type": "robotcode",
"request": "launch",
"cwd": "${workspaceFolder}",
"target": ".",
"attachPython": true,
"exclude": ["WIP"],
"variableFiles": ["./configs/settings.yaml"],
"outputDir": "./test_results"
}
],
} And here is the settings.json: {
"[robotframework]": {
"editor.defaultFormatter": "d-biehl.robotcode"
},
"robotcode.robot.pythonPath": [
"./resources"
],
"robotcode.robot.args": [
"-e", "WIP",
],
"robotcode.completion.filterDefaultLanguage": false,
"robotcode.robot.mode": "default",
"robotcode.robot.outputDir": "./test_results",
"robotcode.robot.paths": ["./test_suit/"],
"robotcode.robot.variableFiles": ["./configs/settings.yaml",],
} I hope this can help the others who need the support. But for me when I change the robot.paths it is starting execution where I define the folder. That is great and solved for a single execution but again it is good for the structure you designed to show which structure and what call is handled. Thank you very much, Daniel. Best Regards |
Beta Was this translation helpful? Give feedback.
-
@rephila Thanks ;-) |
Beta Was this translation helpful? Give feedback.
No this is not possible and robotcode has no influence of that what robot prints out.
Depending of how and what you start, the name of the top level suite becomes different, if you execute a folder then the name of the suite is the capitalized folder name, if you execute a robot file then the name of the suite is the capitalized name of the file without the extension.
But this is not all, also the internal id's of the suites and test becomes different, the builtin variables changes. This makes it later hard to compare different test runs and also to find bugs and so on.
In Robot Framework also a folder is a suite and that folder can contain subfolders that are also suites and files.
Under…