FrozenCanuck / Lebowski

The test automation framework for SproutCore applications
http://frozencanuck.wordpress.com
MIT License
78 stars 8 forks source link

Unable to click segments in a segmented view (SC.SegmentedView) #7

Closed FrozenCanuck closed 13 years ago

FrozenCanuck commented 13 years ago

nothing happens when trying click click on a segmented view's segments using Lebowski.

Issue occurs in SproutCore 1.4-stable

rvalle commented 13 years ago

I think the problem has to do with SegmentedItemArray.click_with_index(value) The CoreQuery[value].html() returns nil, which I suppose is not right.... and then, sending the mouseDown event won't work...

rvalle commented 13 years ago

mmmm CoreQuery[value].classes() returns the right classes... looks like the element was properly selected... let's see if the mouseDown event is received.

rvalle commented 13 years ago

The problem has todo with event.pageX and event.pageY SC.SegmentedView is handling the events directly and using this coordinates to guess which segment has been clicked.

The easiest fix is to modify user-extensions.js to use selenium actions that will include event coordinates.

instead of mouseDown(locator), use mouseDownAt(locator, coordinates), same for mouseUp, etc.

coordinates are a string relative to the located elment. "1,1" is the corner of the elment and will generate valid coordinates for elements that have at least 1x1 in size, that should be all.

this fixes the issue...

FrozenCanuck commented 13 years ago

Resolved in Lebowki v0.3