Exemple #1
0
	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)
		)
Exemple #2
0
 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__()
Exemple #3
0
	def test_completely_empty_tag(self):
		self.assertEqual('<>', get_easily_readable_snippet('<>'))
Exemple #4
0
	def test_no_tag(self):
		self.assertEqual(
			'Hello World!', get_easily_readable_snippet('Hello World!')
		)
Exemple #5
0
	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)
		)
Exemple #6
0
	def test_tag_with_nested_tags(self):
		self.assertEqual(
			'<body>...</body>',
			get_easily_readable_snippet('<body><p>Hello World!</p></body>')
		)