Add the inspect_html()
method
This uses https://cdnjs.com/libraries/html-inspector
and https://github.com/philipwalton/html-inspector
Sample code:
from seleniumbase import BaseCase
class MyTestClass(BaseCase):
def test_html_inspector(self):
self.open("https://xkcd.com/1144/")
self.inspect_html()
Run command:
pytest test_inspect_html.py
Sample output:
* HTML Inspection Results: https://xkcd.com/1144/
X - https://xkcd.com/usNews - Failed to load resource: the server responded with a status of 404 (Not Found)
X - 'property' is not a valid attribute of the <meta> element.
X - Do not use <div> or <span> elements without any attributes.
X - The 'alt' attribute is required for <img> elements.
X - The 'border' attribute is no longer valid on the <img> element and should not be used.
X - 'srcset' is not a valid attribute of the <img> element.
X - The <center> element is obsolete and should not be used.
X - <script> elements should appear right before the closing </body> tag for optimal performance.
X - The id 'comicLinks' appears more than once in the document.
* (See the Console output for details!)