Skip to content

Commit

Permalink
Run google search only if called directly
Browse files Browse the repository at this point in the history
  • Loading branch information
Andmedoctopus committed Dec 28, 2023
1 parent d786f49 commit 5b521ba
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions samples/test_google_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,13 @@ def test_filling_splinter_in_the_search_box_returns_splinter_website(self):
self.browser.visit("http://www.google.com/")
self.browser.fill("q", "splinter browser automation")
# Circa April 2021, there are two identical inputs for a google search. We want the second one.
search_button = self.browser.find_by_xpath('//input[@value="Google Search"]')[1]
search_button = self.browser.find_by_xpath("//input[@value="Google Search"]")[1]
while not search_button.visible:
# Wait for the JavaScript to put the button on the page
pass
search_button.click()
self.assertTrue(self.browser.is_text_present("https://splinter.readthedocs.io"))


unittest.main()
if __name__ == "__main__":
unittest.main()

0 comments on commit 5b521ba

Please sign in to comment.