benjamin84 / fest

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

JMenuItemFixture.click() fails on Mac OS X with apple.laf.useScreenMenuBar #157

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
If the application is launched on Mac with system property
"apple.laf.useScreenMenuBar" set to "true", JMenuItemFixture.click() fails
to click on menu.

Steps to reproduce the problem:
1. Compile and launch the attached test application.

Expected result: menu should be clicked and show its content.
Actual result: FEST fails to click on menu. It tries to click right below
the frame title. The menu content is not shown.

Tested on FEST 1.0a2, Mac OS X 10.5

Attachment contains the test application.

Original issue reported on code.google.com by Andriy.T...@gmail.com on 13 Jun 2008 at 4:06

Attachments:

GoogleCodeExporter commented 9 years ago
It is quite natural for Java apps running on Mac to display the menu bar in the 
Mac
screen menu bar.

Also, some legacy apps may use "com.apple.macos.useScreenMenuBar" system 
property
(which is now deprecated).

Original comment by Andriy.T...@gmail.com on 13 Jun 2008 at 4:09

GoogleCodeExporter commented 9 years ago
We are currently using following workaround:

If OS is Mac and screen menu bar is used, we call
JMenuItemFixturemenu.target.doClick()
instead of
JMenuItemFixture.click()

Original comment by Andriy.T...@gmail.com on 13 Jun 2008 at 4:13

GoogleCodeExporter commented 9 years ago
Thank you so much for the detailed explanation...it makes it a lot easier to 
fix! :)

We'll include the fix for this bug in our next release (1.0a3...we expect to 
release
it next week)

Many thanks!
-Alex

Original comment by Alex.Rui...@gmail.com on 13 Jun 2008 at 4:27

GoogleCodeExporter commented 9 years ago
Working on a fix. It seems that getting the position of a JMenu when positioned 
in
the screen menu bar doesn't work. We can fall back to Andriy workaround to call
'doClick' :)

I found a message from Simeon Fitch that reported this bug on May 22nd.

Original comment by wanghy1...@gmail.com on 16 Jun 2008 at 5:42

GoogleCodeExporter commented 9 years ago
Fixed. Used Andriy's workaround :)

Many thanks!
-Yvonne 

Original comment by wanghy1...@gmail.com on 16 Jun 2008 at 6:35

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 2:03