Skip to content

Commit f825695

Browse files
committed
Update an example test
1 parent d9f7de3 commit f825695

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

examples/hack_the_planet.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,10 @@ def test_all_your_base_are_belong_to_us(self):
5959

6060
self.open("https://google.com/ncr")
6161
self.hide_elements("iframe")
62-
self.set_text_content('a[href*="about.google"]', ayb)
63-
self.set_text_content('a[href*="store.google"]', abtu)
62+
if self.is_element_visible('a[href*="about.google"]'):
63+
self.set_text_content('a[href*="about.google"]', ayb)
64+
if self.is_element_visible('a[href*="store.google"]'):
65+
self.set_text_content('a[href*="store.google"]', abtu)
6466
self.set_text_content('a[href*="mail.google.com"]', ayb)
6567
self.set_text_content('a[href*="google.com/img"]', abtu)
6668
self.set_attributes('[value="Google Search"]', "value", ayb)
@@ -74,8 +76,10 @@ def test_all_your_base_are_belong_to_us(self):
7476
)
7577
self.add_css_style(zoom_in)
7678
self.hide_elements("iframe")
77-
self.highlight('a[href*="about.google"]', loops=3)
78-
self.highlight('a[href*="store.google"]', loops=3)
79+
if self.is_element_visible('a[href*="about.google"]'):
80+
self.highlight('a[href*="about.google"]', loops=3)
81+
if self.is_element_visible('a[href*="store.google"]'):
82+
self.highlight('a[href*="store.google"]', loops=3)
7983
self.highlight('a[href*="mail.google.com"]', loops=3)
8084
self.highlight('a[href*="google.com/img"]', loops=3)
8185
self.highlight('form[role="search"]', loops=8)

0 commit comments

Comments
 (0)