Newly written test case can be lost
There is some weird behaviour in creating a new test case that cascades to make things worse. Eventually causing all work done on a new test case to be lost when saving.
Consider this scenario:
With the Text edit tab open and the first test suite selected in the tree view, right click the second test suite to create a new test case.
Applogies, I accidentally typed 'New suite' as the name for a test case. Sorry for the confusion, but I already included all the screenshots before I noticed.
New suite is now created in the selected test suite, instead of where I right clicked
Switching to the grid editor shows an error
Clicking Yes switches to the grid editor and the test is still there. I can edit it just fine, so what was the error about?
Now when I drag and drop the test case to the second test suite as intended, the new test case also stays in the first test suite. I would expect a drag and drop to be a move-action. And maybe it is, because now I can't delete 'New suite' from the first test suite.
(The menu item is there, but doesn't do anything)
The test case is removed when checking the text editor, but now it is also gone from the second test suite, even though it is still visible in the tree view and editable from the grid editor.
When saving all files and reloading the project in RIDE, all precious work on the new test case is lost.
@JFoederer The problem started with the active Test Suite. When you right-click and see the long menu list, that allows to Create a New Test Case, you are in the context of the current selected Test Suite (the one in Text Editor or the parent of the Test Case or Keyword in Grid Editor). Even when created and replying Yes to revert changes, the Text Editor still shows the New Test Case because still exists in Tree. If you click Apply, you will see again the blank test case error. The same if you move to Grid Editor. Then you add the No Operation step, which allows to save the Test Suite.
Indeed we can end in the situation where we have two Test Cases with the same name in different Test Suites, but the navigation and content is only in one of them. When you Delete the actual one with content you lost all. The refreshing of the Tree is happening when we click Apply in Text Editor.
To complicate things, when we Drag-and-Drop a Test Case (and probably a Keyword too), between different Test Suites, it actually makes a copy of the item.
I did experiment, without saving the files to disk
Has a safeguard, always try to save the files.
There are a few oddities going here, but let's not make it more difficult than needed. I think there are two issues that need addressing:
- Right clicking on an item should act on the item you click on. That is common behaviour. Just try it in Windows Explorer or Slack, or basically any main stream tool. For instance in Slack. Select one channel, then right-click on another and copy its name. See which one you have on the clipboard. I feel this one is important, because this single step would have prevented the other steps from being needed.
- If it is intended behaviour to make a copy with drag and drop, then the copy is not a proper copy. I don't know exactly what is going on, but they somehow stay connected. Actions, like the delete from the example, but also typing new keywords can actually carry over from one test case to the other. I can type a new line in one of the two test cases, switch to the other one and see that change there as well.
This issue will be closed, but the fix is only for item 1. Maybe the item 2, gets fixed by itself :crossed_fingers: