You are here

protected function SettingsTrayTestBase::pressToolbarEditButton in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/settings_tray/tests/src/FunctionalJavascript/SettingsTrayTestBase.php \Drupal\Tests\settings_tray\FunctionalJavascript\SettingsTrayTestBase::pressToolbarEditButton()

Press the toolbar Edit button provided by the contextual module.

2 calls to SettingsTrayTestBase::pressToolbarEditButton()
SettingsTrayTestBase::disableEditMode in core/modules/settings_tray/tests/src/FunctionalJavascript/SettingsTrayTestBase.php
Disables edit mode by pressing edit button in the toolbar.
SettingsTrayTestBase::enableEditMode in core/modules/settings_tray/tests/src/FunctionalJavascript/SettingsTrayTestBase.php
Enables edit mode by pressing edit button in the toolbar.

File

core/modules/settings_tray/tests/src/FunctionalJavascript/SettingsTrayTestBase.php, line 79

Class

SettingsTrayTestBase
Base class for Settings Tray tests.

Namespace

Drupal\Tests\settings_tray\FunctionalJavascript

Code

protected function pressToolbarEditButton() {
  $this
    ->assertSession()
    ->waitForElement('css', '[data-contextual-id] .contextual-links a');
  $edit_button = $this
    ->getSession()
    ->getPage()
    ->find('css', static::TOOLBAR_EDIT_LINK_SELECTOR);
  $this
    ->getSession()
    ->executeScript("jQuery('[data-quickedit-entity-id]').trigger('mouseleave')");
  $edit_button
    ->mouseOver();
  $edit_button
    ->press();
}