I'm trying to test a requirement that says the first name field is always capitalized. I have an input field that looks like the following:
<input type="text" class="form-control" id="firstName" name="firstName" style="text-transform: capitalize" />
In my Geb test, my current testing code looks like this:
def "First Name field automatically capitalizes first letter"() {
given:
def page = to NewRegisterPage
when:
page.containers.firstName << 'mary'
then:
page.containers.firstName.value() == 'Mary'
}
However, this always fails. I'm wondering if there is a way to validate that the text-transform has taken place. I am currently using both the PhantomJS driver and the Chrome driver.
Aucun commentaire:
Enregistrer un commentaire