How to trigger ng-dblclick with Watir

Our development department is using AngularJS to build web applications. And I'm looking into automated testing because it will save us a lot of time.

I found Watir to be very useful while testing... the thing is, it doesn't work very well with AngularJS.

Example: We have a select multiple with items. These items all use ng-dblclick to trigger an action (creating a div).

I've tried to use:

browser.select_list(:class, "domain-list").select("Item 2")
browser.select_list(:class, "domain-list").fire_event("dblclick")

And

browser.select_list(:class, "domain-list").select("Item 2")
browser.select_list(:class, "domain-list").fire_event("ng-dblclick")

And

browser.select_list(:class, "domain-list").select("Item 2")
browser.select_list(:class, "domain-list").double_click

And

browser.select_list(:class, "domain-list").select("Item 2")
browser.select_list(:class, "domain-list").click
browser.select_list(:class, "domain-list").click

All without succes.

My questions are: a. Is it even possible to double click on AngularJS ng-click/ng-dblclick enabled elements? b. If so... how?

Thanks!

Based the problem description, I am guessing that the ng-dblclick is actually on the list's options, rather than the list itself.

Try clicking the option itself:

browser.select_list(:class, "domain-list").option(:text, "Item 2").double_click

Replacing the .double_click from Justin's post to .fire_event("dblclick") made it to work!

browser.select_list(:class, "domain-list").option(:text, "Item 2").fire_event("dblclick")

Thanks Justin!