You are here

public function GeneralTest::testFormSubmit in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/behat/mink/driver-testsuite/tests/Form/GeneralTest.php \Behat\Mink\Tests\Driver\Form\GeneralTest::testFormSubmit()

File

vendor/behat/mink/driver-testsuite/tests/Form/GeneralTest.php, line 89

Class

GeneralTest

Namespace

Behat\Mink\Tests\Driver\Form

Code

public function testFormSubmit() {
  $session = $this
    ->getSession();
  $session
    ->visit($this
    ->pathTo('/basic_form.html'));
  $webAssert = $this
    ->getAssertSession();
  $webAssert
    ->fieldExists('first_name')
    ->setValue('Konstantin');
  $webAssert
    ->elementExists('xpath', 'descendant-or-self::form[1]')
    ->submit();
  if ($this
    ->safePageWait(5000, 'document.getElementById("first") !== null')) {
    $this
      ->assertEquals('Firstname: Konstantin', $webAssert
      ->elementExists('css', '#first')
      ->getText());
  }
}