behave_manners.pagelems.page_elements module

class DomContainerElement(tag=None, attrs=())

Base class for ‘regular’ DOM elements that can contain others

reduce(site=None)

Cleanup internally, possibly merging nested elements

None can be returned, in case this element is no longer useful. reduce() shall be called after all children have been scanned and appended to this; after thet have been reduced.

If site is provided, this should be a context object, which provides (or consumes) additional resources from this element.

class LeafElement(tag, attrs)

Generic element, that has no sub-elements

class NamedElement(tag, attrs)

Generic element, defining DOM component through ‘this’ attribute

pretty_dom()

Walk this template, generate (indent, name, xpath) sets of each node

class Text2AttrElement(name, strip=False)

Internal pagelem node that retrieves text as an attribute to DOM component

This is instantiated when template has eg. <div>[text]</div> . The text is not asserted, but rather appointed to an attribute of parent component.

consume_after(element)

Turn this into a partial text matcher, after some element tag

consume_before(element)

Turn this into a partial text matcher, before some tag