4teamwork / ftw.testbrowser

A testing browser for Plone.
http://ftwtestbrowser.readthedocs.io/
5 stars 1 forks source link

erroneous_fields with field description #82

Open elioschmutz opened 6 years ago

elioschmutz commented 6 years ago

The erroneous_fields function returns all fields with its corresponding error messages.

A return-value looks like this:

{'Title': ['This field is required.']}

Using this function with a field having a description ends with a broken key:

{'Title The document title': ['This field is required.']}

This because the markup is as following:

<label class="horizontal">
        Title     
        <span class="formHelp">The document title</span>
</label>

Getting the text of the label-element will include the text of the span element too.

See https://github.com/4teamwork/ftw.testbrowser/blob/master/ftw/testbrowser/pages/z3cform.py#L21