def test_empty_tag_with_attributes(self): empty_tag_with_attrs = \ '<input type="checkbox" id="checkBoxId" name="checkBoxName" ' \ 'class="checkBoxClass">' self.assertEqual( empty_tag_with_attrs, get_easily_readable_snippet(empty_tag_with_attrs) )
def __repr__(self): if self._is_bound(): element_html = self.web_element.get_attribute('outerHTML') return get_easily_readable_snippet(element_html) else: return super(HTMLElement, self).__repr__()
def test_completely_empty_tag(self): self.assertEqual('<>', get_easily_readable_snippet('<>'))
def test_no_tag(self): self.assertEqual( 'Hello World!', get_easily_readable_snippet('Hello World!') )
def test_tag_with_long_content(self): tag_with_long_content = '<body>%s</body>' % ('x' * 100) self.assertEqual( '<body>...</body>', get_easily_readable_snippet(tag_with_long_content) )
def test_tag_with_nested_tags(self): self.assertEqual( '<body>...</body>', get_easily_readable_snippet('<body><p>Hello World!</p></body>') )