You are here

public function FeatureContext::clickImageIconInWysiwygEditor in Open Social 8

Same name and namespace in other branches
  1. 8.2 tests/behat/features/bootstrap/FeatureContext.php \FeatureContext::clickImageIconInWysiwygEditor()

@When /^I click on the image icon in the WYSIWYG editor$/

File

tests/behat/features/bootstrap/FeatureContext.php, line 139

Class

FeatureContext
Defines application features from the specific context.

Code

public function clickImageIconInWysiwygEditor() {
  $cssSelector = 'a.cke_button__drupalimage';
  $session = $this
    ->getSession();
  $element = $session
    ->getPage()
    ->find('xpath', $session
    ->getSelectorsHandler()
    ->selectorToXpath('css', $cssSelector));
  if (null === $element) {
    throw new \InvalidArgumentException(sprintf('Could not evaluate CSS Selector: "%s"', $cssSelector));
  }
  $element
    ->click();
}