You are here

public function FeatureContext::clickImageIconInWysiwygEditor in Open Social 8.7

Same name and namespace in other branches
  1. 8.9 tests/behat/features/bootstrap/FeatureContext.php \Drupal\social\Behat\FeatureContext::clickImageIconInWysiwygEditor()
  2. 8.3 tests/behat/features/bootstrap/FeatureContext.php \Drupal\social\Behat\FeatureContext::clickImageIconInWysiwygEditor()
  3. 8.4 tests/behat/features/bootstrap/FeatureContext.php \Drupal\social\Behat\FeatureContext::clickImageIconInWysiwygEditor()
  4. 8.5 tests/behat/features/bootstrap/FeatureContext.php \Drupal\social\Behat\FeatureContext::clickImageIconInWysiwygEditor()
  5. 8.6 tests/behat/features/bootstrap/FeatureContext.php \Drupal\social\Behat\FeatureContext::clickImageIconInWysiwygEditor()
  6. 8.8 tests/behat/features/bootstrap/FeatureContext.php \Drupal\social\Behat\FeatureContext::clickImageIconInWysiwygEditor()
  7. 10.3.x tests/behat/features/bootstrap/FeatureContext.php \Drupal\social\Behat\FeatureContext::clickImageIconInWysiwygEditor()
  8. 10.0.x tests/behat/features/bootstrap/FeatureContext.php \Drupal\social\Behat\FeatureContext::clickImageIconInWysiwygEditor()
  9. 10.1.x tests/behat/features/bootstrap/FeatureContext.php \Drupal\social\Behat\FeatureContext::clickImageIconInWysiwygEditor()
  10. 10.2.x tests/behat/features/bootstrap/FeatureContext.php \Drupal\social\Behat\FeatureContext::clickImageIconInWysiwygEditor()

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

File

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

Class

FeatureContext
Defines application features from the specific context.

Namespace

Drupal\social\Behat

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();
}