Skip to content

Commit 42ccabe

Browse files
committed
Update a Shadow Root test
1 parent fbf1565 commit 42ccabe

File tree

1 file changed

+14
-9
lines changed

1 file changed

+14
-9
lines changed

examples/shadow_root_test.py

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,19 @@
1+
""" Piercing through shadow-root elements with the "::shadow" selector.
2+
To confirm that "::shadow" works, print text and assert exact text. """
3+
14
from seleniumbase import BaseCase
25

36

47
class ShadowRootTest(BaseCase):
58
def test_shadow_root(self):
6-
self.open("https://react-shadow.herokuapp.com/Patagonia")
7-
self.click("section.weather::shadow div::shadow button")
8-
self.assert_element('section.weather::shadow img[alt="Patagonia"]')
9-
weather = self.get_text("section.weather::shadow h1")
10-
self.post_message(weather)
11-
self.click('section.weather::shadow a[href="/Kyoto"]')
12-
self.assert_element('section.weather::shadow img[alt="Kyoto"]')
13-
weather = self.get_text("section.weather::shadow h1")
14-
self.post_message(weather)
9+
self.open("https://seleniumbase.io/other/shadow_dom")
10+
print("")
11+
self.click("button.tab_1")
12+
print(self.get_text("fancy-tabs::shadow #panels"))
13+
self.assert_exact_text("Content Panel 1", "fancy-tabs::shadow #panels")
14+
self.click("button.tab_2")
15+
print(self.get_text("fancy-tabs::shadow #panels"))
16+
self.assert_exact_text("Content Panel 2", "fancy-tabs::shadow #panels")
17+
self.click("button.tab_3")
18+
print(self.get_text("fancy-tabs::shadow #panels"))
19+
self.assert_exact_text("Content Panel 3", "fancy-tabs::shadow #panels")

0 commit comments

Comments
 (0)