server/tests
Daniel Calviño Sánchez 065ab6bfff Solve acceptance test failure due to clicks on covered elements
Firefox and Chrome drivers for Selenium refuse to click on an element if
the point to be clicked is covered by a different element, throwing an
UnknownError exception with message "Element is not clickable at point
({x}, {y}). Other element would receive the click: {element}". Although
in general that would be a legit error (as the user would not be able to
click on the element) due to a bad layout, sometimes this can be just a
temporal issue caused by an animation, in which case there would be no
problem once the animation finished and the elements are all in their
final location.

Unfortunately, automatically handling those situations in which the
problem is caused by an animation by just retrying a few times if the
element to be clicked is covered before giving up would probably cause
confusion instead of easing test writing.

The reason is that if the center of the element is covered by another
one the Firefox driver for Selenium tries to click on the corners of the
element instead. The problem is that the coordinates used for the click
are integer values, but Firefox has sub-pixel accuracy, so sometimes
(depending on which corner is not covered and whether the left, top,
width or height properties of the element to be clicked have a decimal
component or not) the clicks silently land on a different HTML element
(and that is with squared borders; with round borders they always land
on a different HTML element. That was partially addressed for Selenium
3.0 by clicking first on the edges, but it would still fail if the
middle point of the edges is covered but not the corners).

It is not possible to fix or even detect all that from the tests (except
maybe with some extreme hacks involving accessing private PHP members
from Mink and bypassing or replacing the standard JavaScript executed by
the Firefox driver with a custom implementation...), so it is not
possible to ensure that clicks during an animation will land on the
right element (in fact it is not possible even on static elements,
although except when the layout is wrong there should be no problem);
sometimes retrying a click when the element is covered would solve the
problem, sometimes it would cause a different element to be clicked (and
sometimes there would be even no retry, as the first click would have
silently landed on a different element than the expected one).

Therefore, a different approach must be used. Instead of trying to
automatically handle clicks during animations the tests must be written
being aware of the problem and thus waiting somehow for the animations
that can cause a problem to end before performing the clicks.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2017-10-19 01:46:13 +02:00
..
acceptance Solve acceptance test failure due to clicks on covered elements 2017-10-19 01:46:13 +02:00
apps Version and dependency are now required 2017-05-22 09:54:44 +02:00
Core Set the data from the template 2017-10-18 15:12:03 +02:00
data Allow multiple settings and sections per app 2017-10-05 11:34:03 +02:00
docker Namespace and array syntax fixes 2017-03-19 14:52:54 -06:00
lib Merge pull request #6602 from nextcloud/s3-multipart-upload 2017-10-11 16:10:58 +02:00
objectstore make object prefix configurable 2016-11-14 15:10:56 +01:00
Settings Set the data from the template 2017-10-18 15:12:03 +02:00
travis Changed name of default logfile from owncloud.log to nextcloud.log. 2016-07-04 11:50:32 +02:00
apps.php Fix the tests again 2016-05-25 16:51:02 +02:00
bootstrap.php unit test adjustment 2017-04-07 18:06:50 +08:00
enable_all.php Fix tests 2016-10-31 17:17:45 +01:00
karma.config.js Extract toggle visibility of a SystemTagsInfoView to its own view 2017-06-09 09:13:29 +02:00
phpunit-autotest-external.xml Adjust the phpunit config 2016-05-25 15:14:37 +02:00
phpunit-autotest.xml Add tests for OAuth2 app 2017-05-18 20:49:10 +02:00
preseed-config.php Enable object storage tests again 2017-08-17 09:40:12 +02:00
redis-cluster.config.php Fix drone 2017-07-14 15:04:18 +02:00
redis.config.php Fix drone 2017-07-14 15:04:18 +02:00
startsessionlistener.php Make compatible with PHPUnit 5.1 2015-12-10 09:22:41 +01:00