You are here

public function FeatureContext::iSelectPostVisibility in Open Social 10.3.x

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

@When I select post visibility :visibility

File

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

Class

FeatureContext
Defines application features from the specific context.

Namespace

Drupal\social\Behat

Code

public function iSelectPostVisibility($visibility) {

  // First make post visibility setting visible.
  $this
    ->iClickPostVisibilityDropdown();

  // Click the label of the readio button with the visibility. The radio
  // button itself can't be clicked because it's invisible.
  $page = $this
    ->getSession()
    ->getPage();
  $field = $page
    ->findField($visibility);
  if (null === $field) {
    throw new ElementNotFoundException($this
      ->getDriver(), 'form field', 'id|name|label|value|placeholder', $visibility);
  }
  $field
    ->getParent()
    ->click();
}