function CKEditorIntegrationTest::clickPathLinkByTitleAttribute

Clicks a link in the editor's path links with the given title text.

Parameters

string $text: The title attribute of the link to click.

1 call to CKEditorIntegrationTest::clickPathLinkByTitleAttribute()
CKEditorIntegrationTest::testEditableCaption in core/modules/media/tests/src/FunctionalJavascript/CKEditorIntegrationTest.php
Tests caption editing in the CKEditor widget.

File

core/modules/media/tests/src/FunctionalJavascript/CKEditorIntegrationTest.php, line 1524

Class

CKEditorIntegrationTest
@coversDefaultClass \Drupal\media\Plugin\CKEditorPlugin\DrupalMedia @group media

Namespace

Drupal\Tests\media\FunctionalJavascript

Code

protected function clickPathLinkByTitleAttribute($text) {
    $this->getSession()
        ->switchToIFrame();
    $selector = '//span[@id="cke_1_path"]//a[@title="' . $text . '"]';
    $this->assertSession()
        ->elementExists('xpath', $selector)
        ->click();
}

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