function DisplayTest::toggleContextualTriggerVisibility

Same name in other branches
  1. 9 core/modules/views_ui/tests/src/FunctionalJavascript/DisplayTest.php \Drupal\Tests\views_ui\FunctionalJavascript\DisplayTest::toggleContextualTriggerVisibility()
  2. 8.9.x core/modules/views_ui/tests/src/FunctionalJavascript/DisplayTest.php \Drupal\Tests\views_ui\FunctionalJavascript\DisplayTest::toggleContextualTriggerVisibility()
  3. 11.x core/modules/views_ui/tests/src/FunctionalJavascript/DisplayTest.php \Drupal\Tests\views_ui\FunctionalJavascript\DisplayTest::toggleContextualTriggerVisibility()

Toggles the visibility of a contextual trigger.

Parameters

string $selector: The selector for the element that contains the contextual Rink.

1 call to DisplayTest::toggleContextualTriggerVisibility()
DisplayTest::testPageContextualLinks in core/modules/views_ui/tests/src/FunctionalJavascript/DisplayTest.php
Tests contextual links on Views page displays.

File

core/modules/views_ui/tests/src/FunctionalJavascript/DisplayTest.php, line 154

Class

DisplayTest
Tests the display UI.

Namespace

Drupal\Tests\views_ui\FunctionalJavascript

Code

protected function toggleContextualTriggerVisibility($selector) {
    // Hovering over the element itself with should be enough, but does not
    // work. Manually remove the visually-hidden class.
    $this->getSession()
        ->executeScript("jQuery('{$selector} .contextual .trigger').toggleClass('visually-hidden');");
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.