benjamin84 / fest

Automatically exported from code.google.com/p/fest
0 stars 0 forks source link

Multiple DialogFixtures stops being able to be found with custom matcher. #195

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. A frame, and a dialog that pops up a dialog once with a simple matcher 
2. Dispose of the first dialog. Have the same dialog pops up again
3. The WindowFinder will no longer find the dialog using a custom matcher.

What is the expected output? What do you see instead?
I tried popping up a dialog, then having a DialogFixture found for the
dialog to click a button that dismisses the dialog. The WindowFinder is
provided a custom matcher that finds the dialog by Title.
This works great the first time for that dialog.
But it doesn't work the second time. (it fails after timeout, after
continuously calling my Matcher's isMatching() method.

I might be doing this wrong, but the WindowFinder finds my dialog if I
setName() on the dialog and don't use a custom matcher.

What version of the product are you using? On what operating system?
fest-swing-1.0b1
Fedora 8

Please provide any additional information below.

Thanks for your awesome Library!  The only one that seems to work with our
menagerie of components. :-)

I will attach a simple test program, "FestTest.java"
Can be compiled with: (Don't know, I use my IDE)

javac FestTest.java -cp fest-swing-1.0b1.jar
jar cvf FestTest.jar FestTest*
java -cp
FestTest.jar:fest-assert-1.0a1.jar:fest-reflect-0.4.jar:fest-util-0.4.jar:fest-s
wing-1.0b1.jar
FestTest

Original issue reported on code.google.com by bebr...@gmail.com on 8 Aug 2008 at 1:35

Attachments:

GoogleCodeExporter commented 9 years ago
Thanks a lot for reporting this bug! :)

Can you please send me your name (via e-mail to alex.ruiz.05 at gmail.com, or 
as a
comment in this issue report) so I can add you to the contributors list?

Original comment by Alex.Rui...@gmail.com on 8 Aug 2008 at 1:42

GoogleCodeExporter commented 9 years ago
This sample doesn't represent my Swing expertise.  It's the quickest I could 
come up
with that actually reproduces the problem I'm having.  Changing my real code so 
that
the dialog sets its own name property when the title changes totally fixes my 
problem.

I have to say that this library is great!  It's a lifesaver.  If there's 
anything I
can do to contribute, I'll be sure to let you know!  Thanks again, Alex+co.

BTW, I think that when the "itunes" model of a fat client hitting a web service 
via
remoting becomes more popular, UI testing will become more important. (How many 
ajax
frameworks are there that try to reproduce things like auto-complete and 
sortable
tables that they could have done for the last 10 years with a fat client?)

Original comment by bebr...@gmail.com on 8 Aug 2008 at 1:45

GoogleCodeExporter commented 9 years ago
Hi Bryan,

This is actually not a bug. The problem is that the matcher is finding two 
dialog
with title "title," resulting in a thrown exception. If you add a condition to 
match
only the showing dialog, the test will pass.

Please take a look at the class
http://code.google.com/p/fest/source/browse/trunk/fest/fest-swing/src/test/java/
org/fest/swing/fixture/Bug195_MultipleDialogFixturesTest.java
(this class is the test you sent, with some minor cleanups) :)

Thanks,
-Alex

Original comment by Alex.Rui...@gmail.com on 14 Oct 2008 at 6:58

GoogleCodeExporter commented 9 years ago
Set the module as a label, instead of being part of the title.

Original comment by Alex.Rui...@gmail.com on 1 Dec 2008 at 3:16