You are here

public function PermissionsByTermDrupalSubContext::iSubmitTheForm in Permissions by Term 8.2

@Then /^I submit the form$/

File

tests/src/Behat/Context/permissions_by_term.behat.inc, line 310

Class

PermissionsByTermDrupalSubContext
Class PermissionsByTermContext

Namespace

Drupal\Tests\permissions_by_term\Behat\PermissionsByTermDrupalSubContext

Code

public function iSubmitTheForm() {
  $session = $this
    ->getSession();

  // get the mink session
  $element = $session
    ->getPage()
    ->find('xpath', $session
    ->getSelectorsHandler()
    ->selectorToXpath('xpath', '//*[@type="submit"]'));

  // runs the actual query and returns the element
  // errors must not pass silently
  if (null === $element) {
    throw new \InvalidArgumentException(sprintf('Could not evaluate XPath: "%s"', '//*[@type="submit"]'));
  }

  // ok, let's click on it
  $element
    ->click();
}