You are here

public function GeneralTest::testFormSubmitWithoutButton 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::testFormSubmitWithoutButton()

File

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

Class

GeneralTest

Namespace

Behat\Mink\Tests\Driver\Form

Code

public function testFormSubmitWithoutButton() {
  $session = $this
    ->getSession();
  $session
    ->visit($this
    ->pathTo('/form_without_button.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());
  }
}