'Verifies that the text of the specified element is ``expected``.
The element whose text is verified is specified using ``source`` and
``xpath``. They have exactly the same semantics as with `Get Element`
keyword.
The text to verify is got from the specified element using the same
logic as with `Get Element Text`. This includes optional whitespace
normalization using the ``normalize_whitespace`` option.
The keyword passes if the text of the element is equal to the
``expected`` value, and otherwise it fails. The default error message
can be overridden with the ``message`` argument.  Use `Element Text
Should Match` to verify the text against a pattern instead of an exact
value.
Examples using ``${XML}`` structure from `Example`:
| Element Text Should Be | ${XML}       | text     | xpath=first      |
| Element Text Should Be | ${XML}       | ${EMPTY} | xpath=second/child |
| ${paragraph} =         | Get Element  | ${XML}   | xpath=html/p     |
| Element Text Should Be | ${paragraph} | Text with bold and italics. | normalize_whitespace=yes |'

def element_text_should_be(self, source, expected, xpath='.', normalize_whitespace=False, message=None):

    text = self.get_element_text(source, xpath, normalize_whitespace)
    should_be_equal(text, expected, message, values=False)
