robotcode
robotcode copied to clipboard
[ENHANCEMENT] Provide a way to mark test suites and tests with same long name
Describe the bug When test.robot and test_.robot are present in the same directory only the former can be executed in RobotCode.
To Reproduce Steps to reproduce the behavior:
- Add the files test.robot and test_.robot to the current workspace
- When test.robot is the active tab the test cases can be executed
- When test_.robot is the active tab the test cases cannot be executed (no green triangles in the gutter)
Both files have the same content:
*** Test Cases ***
First Test
Log To Console Hello
Expected behavior It should be possible to execute the test cases in both files.
Screenshots/ Videos If applicable, add screenshots or videos to help explain your problem.
Logs Copy the messages from VSCode "Output" view for RobotCode and RobotCode Language Server for the specific folder/workspace.
Activate RobotCode Extension.
Try to activate python extension
Python Extension is active
create Language client: RobotCode Language Server mode=pipe for folder "RF"
trying to start Language client: RobotCode Language Server mode=pipe for folder "RF"
client file:///c%3A/Users/mardukb/Desktop/RF ready.
Desktop (please complete the following information):
- VS Code Version 1.64.2
- RobotCode Version 0.6.0
- OS: Windows
- Python Version 3.8.10
- RobotFramework Version 4.1.3
- Additional tools like robocop, robotidy: None
Additional context I believe the problem is that RobotCode considers test.robot and test_.robot to be the same test suite. And the one that is read last takes precedence.
Yes, that's because Robotframework generates the same longname for both test(_).robot files. see here
Try to execute the test in test_.robot
with the -t
option like robot -t "*.test.first test"
alwas both tests are executed. You will get the same, if you put the underscore there.
So the suites are ambiguous and that results from how robotframework handles suite names.
I will try to find a way, that we can mark this as with a hint or so, thats maybe the best solution. What do you think?
The problem is, that I don't want to introduce a behaviour with RobotCode that you can't execute with robot on commandline.
I see. Thanks a lot for the detailed explanation! I agree that the ambiguity prevents the execution of the test cases individually (and the user should be notified about this). But one should still be able to execute the whole test suite (a single .robot file as well as the whole directory), just like in the CLI.
Try "Run" menu and "Start Debugging" or "Run without Debugging".
You can create a Launch config according to your wishes.
After some invesitagtion I opened these issues 4253 and 4249 on robotframework for this. And allready fixed 4249.
With this commit RobotCode shows a run/debug triangle before every testcase, also when there is another test case with the same name.
Awesome! Thanks a lot! Looking forward to the next release that includes this commit :)
Both issues on RobotFramework (4253 and 4249) are fixed and closed. Starting with version 5.0 of RobotFramework warns if there are suites with same name are executed.
Need to find a way, to show these warnings in Editor.
this is done with the new test discoverer, which displays warnings about multiple suites and tests with the same name.