mozilla / geckodriver

WebDriver for Firefox
https://firefox-source-docs.mozilla.org/testing/geckodriver/
Mozilla Public License 2.0
7.11k stars 1.52k forks source link

click event on React dropdown button only trigger tooltip #962

Open mmanach opened 6 years ago

mmanach commented 6 years ago

System

Testcase

The click event is not correctly executed on React dropdown component with Firefox / GeckoDriver (on Chrome it's ok).

Actual :

Clicking on this button will only trigger display of the tooltip (aria-describedby) "related items" image

Expected :

The dropdown open. image

For reproducing, you can test on http://talend.surge.sh/components/?selectedKind=ActionDropdown&selectedStory=default&full=0&down=1&left=1&panelRight=0&downPanel=storybook%2Factions%2Factions-panel

Note : take care of the iframe ! If you need, I can provide a project for reproduce.

Stacktrace

No stacktrace are produce here

whimboo commented 6 years ago

@mmanach thanks a lot for filing this issue. Given that it is always hard to figure out the exact problem for larger pages, I would be grateful if you could provide a minimized testcase for that.

andreastt commented 6 years ago

From the screenshot, it looks to me like the drop-down menu is being activated.

mmanach commented 6 years ago

Hello,

@whimboo Here a sample to reproduce this case : https://github.com/mmanach/sandbox

  1. In this scenario, it clicks on the first dropdown (which does not have aria-describedby attribute), and the menu is being well activated. It tries to click on the menu, and it succeeded.
  2. Next, it clicks on third dropdown (with aria-describedby), and only the tooltip is activated (like on the screenshot). It tries to click on the menu, and it fails.

@andreastt On which screenshot are you talking about ? The expected one is from Chrome.

mmanach commented 6 years ago

@whimboo Hello, any news on it ? I see that the label is still on reporter feedback :)

whimboo commented 6 years ago

@mmanach can you please try something out? With Firefox 57 we allow to make use of the webdriver conforming click, which can be enabled by setting the capability moz:webdriverClick to true.

Please run your tests with this new click method and report back by also attaching a trace-level log from geckodriver.

mmanach commented 6 years ago

Hi @whimboo ,

So I just tested with FF 57 and "moz:webdriverClick", the result seems the same, only the "aria-describedby" is open, and not the menu-item

If I'm right, here is the gecko trace for the click on the involved element (on attachment) gecko_trace.log

And here the trace when "moz:webdriverClick" is disabled : gecko_trace_with_no_moz_webdriverClick.log

mmanach commented 6 years ago

Hi !

I faced again a similar (and strange) issue.

image

On this element, the click just pop-up the aria-describedby "delete", when I run my test. But when I run the same test on debug mode from IntelliJ, the click event works as expected (click on the cross button), the aria-describedby is not triggered.

So my first thought was : 1- in debug mode, there is probably more wait before interacting with element, so let's add wait ! Same results :disappointed_relieved: 2- I compared the 2 trace level log from geckodriver, for normal run and debug run, and everything seems good, the element is found, and the click on it too.

So... I do not understand what running test in debug execution change :confused:

whimboo commented 6 years ago

So I had a chance to look at this issue again, and as it looks like there is a bug when trying to open this specific dropdown. While it is working fine for the "default" case, it fails for "With hideLabel option". A workaround I had to use to make it work was to click the element with the class name dropdown btn-group btn-group-default twice, before the dropdown opens. After that I was able to successfully click the document1 entry.

The page is kinda complex, so I will take another looks tomorrow to figure out if the first click really triggers a click for that element.

whimboo commented 6 years ago

For further investigation I filed https://bugzilla.mozilla.org/show_bug.cgi?id=1445182.