HTML5 Form Validation with Capybara, PhantomJS and Poltergeist
Asked Answered
R

0

7

I have a modal dialog (bootstrap modal-content) with a form on it.

The form has a field for an email:

<input class="form-control" data-error="Email address is invalid" required="required" id="email_to_forward" name="email_to_forward" placeholder="Enter email" type="email">

The form also has a button:

<button type="submit" class="btn btn-primary" id="forward" name="forward" value="forward">Forward</button>

The expected behavior is as follows:

  • Given I enter an invalid email address
  • When I click submit
  • Then the dialog should remain visible

This works as expected if I do a manual test.

This works as expected if I run the automation using the Firefox selenium driver.

This does not work if I use poltergeist with PhantomJS. As soon as it clicks the submit button, the dialog is no longer visible.

Does PhantomJS and Poltergeist support HTML5 validation?

Recommit answered 22/4, 2015 at 11:13 Comment(1)
I just ran into this as well. It doesn't look like it includes HTML form validation.Christo

© 2022 - 2024 — McMap. All rights reserved.