You are here

public function FeatureContext::clickEmbedIconInWysiwygEditor in Open Social 8

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

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

File

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

Class

FeatureContext
Defines application features from the specific context.

Code

public function clickEmbedIconInWysiwygEditor() {
  $cssSelector = 'a.cke_button__social_embed';
  $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();
}