That's a good question, I think that we should not consider Surface as a mobile, but it is a really hybrid device so it could fit in this category.
Anyway, I'm pretty sure that anyone could modify the function to whatever they need.
That returns undefined in Windows 8 touch based devices. I will do more tests however.
Nice post, but I think that this would be the correct way to perform the test:
It should be expect(xPosition('#someSection')).toBeGreaterThan(0);
Much better!
I've changed it :)
@robsonsobral tables are not working right now, meanwhile I've created a list. If you could please tell me Windows Phone 7.8 and 8 user agents I could extend the function and add support for those devices too.
For now this trick have been worked an all devices I've tested. I didn't have any problem on Android, iOS, Mac OS X, Windows 7 and 8.
Achievements
270 Karma
198,866 Total ProTip Views

Forked 100

Forked 50

Forked 20

Lemmings 100

I love it :)
It will be even better if you can detect when $digest loop is called and when it finishes, to remove those
$scope.$broadcast()
, but as far as I know it is not possible in AngularJS.Another improvement could be to use
$rootScope.$emit()
that is far better in performance than$scope.$broadcast()
due to the bubbling propagation, but anyway is pretty smart and I will use this very soon I think.