2020-06-01 02:46:15 +08:00
|
|
|
""" Test an error page with the "highlight() command, which uses a
|
|
|
|
JavaScript animation to point out page objects that are found.
|
|
|
|
If an element isn't visible, the test fails with an exception.
|
|
|
|
"""
|
|
|
|
from seleniumbase import BaseCase
|
|
|
|
|
|
|
|
|
2021-03-11 06:27:52 +08:00
|
|
|
class ErrorPageTests(BaseCase):
|
2020-06-01 02:46:15 +08:00
|
|
|
def test_error_page(self):
|
|
|
|
self.open("https://seleniumbase.io/error_page/")
|
|
|
|
self.highlight('img[alt="500 Error"]')
|
|
|
|
self.highlight("img#parallax_octocat")
|
|
|
|
self.highlight("#parallax_error_text")
|
|
|
|
self.highlight('img[alt*="404"]')
|
|
|
|
self.highlight("img#octobi_wan_catnobi")
|
|
|
|
self.highlight("img#speeder")
|
2022-06-07 11:50:26 +08:00
|
|
|
self.save_screenshot_after_test = True # Automatic if test fails
|