Problem/Motivation
Follow up to #2946294: Fix race conditions in OffCanvasTestBase
This was solving for the random test failure the produces and error like
1) Drupal\Tests\system\FunctionalJavascript\OffCanvasTest::testOffCanvasLinks with data set "stark" ('stark')
WebDriver\Exception\UnknownError: unknown error: Element ... is not clickable at point (516, 87). Other element would receive the click: ...
(Session info: headless chrome=62.0.3202.94)
(Driver info: chromedriver=2.33.506092 (733a02544d189eeb751fe0d7ddca79a0ee28cce4),platform=Linux 4.9.0-0.bpo.6-amd64 x86_64)/var/www/html/vendor/instaclick/php-webdriver/lib/WebDriver/Exception.php:155
/var/www/html/vendor/instaclick/php-webdriver/lib/WebDriver/AbstractWebDriver.php:157
/var/www/html/vendor/instaclick/php-webdriver/lib/WebDriver/AbstractWebDriver.php:218
/var/www/html/vendor/instaclick/php-webdriver/lib/WebDriver/Container.php:224
/var/www/html/vendor/behat/mink-selenium2-driver/src/Selenium2Driver.php:775
/var/www/html/vendor/behat/mink-selenium2-driver/src/Selenium2Driver.php:763
/var/www/html/vendor/behat/mink/src/Element/NodeElement.php:153
/var/www/html/vendor/behat/mink/src/Element/TraversableElement.php:73
/var/www/html/core/modules/system/tests/src/FunctionalJavascript/OffCanvasTest.php:99
Example
This seems to be a problem where the test browser is trying to click an element but other element is moving on the page and the element to be clicked is obstructed.
Proposed resolution
Generalize the solution in #2946294: Fix race conditions in OffCanvasTestBase
Option 1: Override existing methods of clicking
If would be nice if$this->getSession()->getPage()->clickLink()
Just became fault tolerant.
But then you also have$this->getSession()->getPage()->find('css', '.my-link')->click()
So we would have to extend \Behat\Mink\Element\DocumentElement
and \Behat\Mink\Element\NodeElement
Option 2: Provide a new way to click elements
Add new method on WebDriverTestBase
something like safeClick
Remaining tasks
Figure the best solution