/**
 * @Then the :button CKeditor button should be :state
 */
public function assertCKEditorButtonState($button, $state) {
  $page = $this->getSession()->getPage();
  $locator = '//li[@data-drupal-ckeditor-button-name= "' . $button. '"]';
  $selectElement = $page->find('xpath', $locator);
  if (!$selectElement) {
    throw new ExpectationException(sprintf('The CKeditor button "%s" wasn\'t found', $button), $this->getSession()
      ->getDriver());
  }
  $enabled = $page->find('xpath', $locator. '/ancestor::ul[contains(@class,\'ckeditor-active-toolbar-configuration\')]');
  $enabled = $enabled ? 'enabled' : 'disabled';
  if ($enabled != $state) {
    throw new ExpectationException(sprintf('The CKeditor button "%s" was %s', $button, $enabled), $this->getSession()
      ->getDriver());
  }
}