You are here

public function CkEditorContext::assertEditor in Lightning Core 8.5

Same name and namespace in other branches
  1. 8 tests/contexts/CkEditorContext.behat.inc \Acquia\LightningExtension\Context\CkEditorContext::assertEditor()
  2. 8.2 tests/contexts/CkEditorContext.behat.inc \Acquia\LightningExtension\Context\CkEditorContext::assertEditor()
  3. 8.3 tests/contexts/CkEditorContext.behat.inc \Acquia\LightningExtension\Context\CkEditorContext::assertEditor()
  4. 8.4 tests/contexts/CkEditorContext.behat.inc \Acquia\LightningExtension\Context\CkEditorContext::assertEditor()

Asserts that a CKEditor instance exists and is fully loaded.

@Given CKEditor :id exists

@Then CKEditor :id should exist

Parameters

string $id: (optional) The editor instance ID. Defaults to the first available instance.

Return value

string A snippet of JavaScript for calling instance methods.

3 calls to CkEditorContext::assertEditor()
CkEditorContext::execute in tests/contexts/CkEditorContext.behat.inc
Executes a CKEditor command.
CkEditorContext::getContent in tests/contexts/CkEditorContext.behat.inc
Gets the content of a CKEditor instance.
CkEditorContext::insert in tests/contexts/CkEditorContext.behat.inc
Puts text or HTML into a CKEditor instance.

File

tests/contexts/CkEditorContext.behat.inc, line 34

Class

CkEditorContext
Contains step definitions for working with CKEditor instances.

Namespace

Acquia\LightningExtension\Context

Code

public function assertEditor($id = NULL) {
  $js = "CKEDITOR.instances['" . ($id ?: $this
    ->getDefault()) . "']";
  $this
    ->getSession()
    ->wait(10000, "{$js}.status === 'ready'");
  return $js;
}