function MediaTest::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 MediaTest::clickPathLinkByTitleAttribute()
MediaTest::testEditableCaption in core/modules/ckeditor/tests/src/FunctionalJavascript/MediaTest.php
Tests caption editing in the CKEditor widget.

File

core/modules/ckeditor/tests/src/FunctionalJavascript/MediaTest.php, line 1580

Class

MediaTest
@coversDefaultClass \Drupal\ckeditor\Plugin\CKEditorPlugin\DrupalMedia @group ckeditor @group legacy

Namespace

Drupal\Tests\ckeditor\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.