|
| 1 | +""" Piercing through shadow-root elements with the "::shadow" selector. |
| 2 | + To confirm that "::shadow" works, print text and assert exact text. """ |
| 3 | + |
1 | 4 | from seleniumbase import BaseCase
|
2 | 5 |
|
3 | 6 |
|
4 | 7 | class ShadowRootTest(BaseCase):
|
5 | 8 | 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