Community
Participate
Working Groups
Build Identifier: 3.6.1 I am migrating some test plugins that use swtbot to helios. However, I noticed that parts of my tests for wizard were unexpectedly failing when calling ".click()". These tests worked consistently with older versions of eclipse. For example, the following click caused my radio to end up in a strange state: bot.radio("some button").click(); I have been able to workaround this issue by calling an extra setFocus: SWTBotRadio someRadio = bot.radio("some button."); someRadio.setFocus(); someRadio.click(); I don't mind the workaround, but it is not clear to me why this setFocus is now needed in some cases. Reproducible: Sometimes
I independently ran into this issue. The problem is that SWTBotRadio.click() does not give focus to the radio button. I'm attaching a project that proves this; it shows the problem with 100% reproducibility. See comments in SampleView.java. This problem can manifest itself in very strange ways. In my case, I had two radio buttons in an editor. My test selects the second button, does a save operation, and suddenly and unexpectedly, the first radio button becomes selected. The reason this happens is that an editor save operation gets the focus control, disables toolbars and such, does the save, then restores the UI state it mucked with. Because SWTBotRadio.click() doesn't set the focus, the save operation ends up restoring focus to the wrong button. This was painful to troubleshoot. Would be great to see this addressed.
Created attachment 226969 [details] Example project showing problem See comments in theTest() in SampleView.java
Hi John, Do you think you'd be able to turn the issue you describe as a testCase and contribute it via Gerrit? That would really help.
(In reply to comment #3) > Hi John, > > Do you think you'd be able to turn the issue you describe as a testCase and > contribute it via Gerrit? That would really help. Mickael, sorry for the delay. I get far too many bugzilla notifications and this one unfortunately got lost in the crowd. While searching through emails, I was lucky to stumble on it. I'm sorry to be blunt, but a test case is a bit much to ask of someone who is not an active participant/user of a codebase. A reasonable expectation is for the bug reporter to provide an easily reproducible scenario, and I spent a good amount of effort producing that. I hope that proves to be enough.
(In reply to comment #4) > I'm sorry to be blunt, but a test case is a bit much to ask of someone who > is not an active participant/user of a codebase. My job is to encourage users to turn into contributor (forum, bugs), contributors into code contributors (Gerrit patches) and code contributors into committers. I've asked you for providing a test case because I think the contribution you made is the most difficult part (it already contains the testCase). Just turning it into a Gerrit contribution to the org.eclipse.swtbot.eclipse.finder.test would make it way easier for me to review and merge. I'm curious to know what you call "a bit much". I'd really like to make it easier. Do you have any suggestion on how to improve documentation to make it easier to contribute testcase. > A reasonable expectation is > for the bug reporter to provide an easily reproducible scenario, and I spent > a good amount of effort producing that. I hope that proves to be enough. I'm not criticizing your contribution in any case. It's highly welcome and I thank you for that. But I don't have much time to spend on SWTBot, and when I have some time, I spend it on more critical problems than Helios support. So the process of getting this issue fixed would get faster if you could do some more additional steps. SWTBot is a community project with very low resources, so you can't expect to see a bug fixed just because you report it. The best way to get things done is to do most of it by yourself. So I keep this bug in mind for later when I have more time to spend on it, and I hope it'll make it in the future versions of SWTBot, but for the moment, I only have time to encourage you to turn the test you've written into a Gerrit contrib in order to speed up the process of getting it fixed.
@John: did you reproduce the issue only on Helios, or on a more recent version of Eclipse as well?
Please find the attached jar with the Fix for this issue
Created attachment 236749 [details] SWTBotRadio Fix
Thanks for this contribution. SWTBot contribution process requires that you use Gerrit to submit a change. Can you please provide this change as a Gerrit patch? See http://wiki.eclipse.org/SWTBot/Contributing