diff --git a/core/tests/Drupal/FunctionalJavascriptTests/JSWebAssert.php b/core/tests/Drupal/FunctionalJavascriptTests/JSWebAssert.php index a7feea1..26e4278 100644 --- a/core/tests/Drupal/FunctionalJavascriptTests/JSWebAssert.php +++ b/core/tests/Drupal/FunctionalJavascriptTests/JSWebAssert.php @@ -40,13 +40,13 @@ public function assertWaitOnAjaxRequest($timeout = 10000, $message = 'Unable to * Drupal CI Javascript tests by default use a viewport of 1024x768px. * * @param string $selector_type - * The element selector type (css, xpath). + * The element selector type (CSS, XPath). * @param string|array $selector * The element selector. Note: the first found element is used. * @param bool|string $corner * (Optional) The corner to test: * topLeft, topRight, bottomRight, bottomLeft. - * Or FALSE to check the complete element (default behavior). + * Or FALSE to check the complete element (default). * @param string $message * (optional) A message for the exception. * @@ -64,8 +64,8 @@ public function assertVisibleInViewport($selector_type, $selector, $corner = FAL throw new ElementNotFoundException($this->session->getDriver(), 'element', $selector_type, $selector); } - // Check if the node is visible on the page, which is a perquisite of being - // visible in the viewport. + // Check if the node is visible on the page, which is a prerequisite of + // being visible in the viewport. if (!$node->isVisible()) { throw new ElementHtmlException($message, $this->session->getDriver(), $node); } @@ -78,18 +78,17 @@ public function assertVisibleInViewport($selector_type, $selector, $corner = FAL } /** - * Test that a node, or it's specific corner, is not visible in the viewport. + * Test that a node, or its specific corner, is not visible in the viewport. * * Note: the node should exist in the page, otherwise this assertion fails. * * @param string $selector_type - * The element selector type (css, xpath). + * The element selector type (CSS, XPath). * @param string|array $selector * The element selector. Note: the first found element is used. * @param bool|string $corner - * (Optional) The corner to test: - * topLeft, topRight, bottomRight, bottomLeft. - * Or FALSE to check the complete element (default behavior). + * (Optional) Corner to test: topLeft, topRight, bottomRight, bottomLeft. + * Or FALSE to check the complete element (default). * @param string $message * (optional) A message for the exception. * @@ -122,9 +121,8 @@ public function assertNotVisibleInViewport($selector_type, $selector, $corner = * @param \Behat\Mink\Element\NodeElement $node * A valid node. * @param bool|string $corner - * (Optional) The corner to test: - * topLeft, topRight, bottomRight, bottomLeft. - * Or FALSE to check the complete element (default behavior). + * (Optional) Corner to test: topLeft, topRight, bottomRight, bottomLeft. + * Or FALSE to check the complete element (default). * * @return bool * Returns TRUE if the node is visible in the viewport, FALSE otherwise. @@ -219,7 +217,7 @@ function t(r, lx, ly) { r = n.getBoundingClientRect(), lx = (w.innerWidth || e.clientWidth), ly = (w.innerHeight || e.clientHeight); - + return t(r, lx, ly); }($test_javascript_function)); JS;