-
Notifications
You must be signed in to change notification settings - Fork 1.3k
/
Copy pathshadow_root_test.py
23 lines (21 loc) · 1.05 KB
/
shadow_root_test.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
"""Piercing through shadow-root elements with the "::shadow" selector.
To confirm that "::shadow" works, print text and assert exact text."""
from seleniumbase import BaseCase
BaseCase.main(__name__, __file__)
class ShadowRootTest(BaseCase):
def test_shadow_root(self):
if self.recorder_mode:
self.open("about:blank")
print("Skipping test in Recorder Mode.")
self.skip("Skipping test in Recorder Mode.")
self.open("https://seleniumbase.io/other/shadow_dom")
print("")
self.click("button.tab_1")
print(self.get_text("fancy-tabs::shadow #panels"))
self.assert_exact_text("Content Panel 1", "fancy-tabs::shadow #panels")
self.click("button.tab_2")
print(self.get_text("fancy-tabs::shadow #panels"))
self.assert_exact_text("Content Panel 2", "fancy-tabs::shadow #panels")
self.click("button.tab_3")
print(self.get_text("fancy-tabs::shadow #panels"))
self.assert_exact_text("Content Panel 3", "fancy-tabs::shadow #panels")