Skip to content
This repository has been archived by the owner on Jan 20, 2022. It is now read-only.

Commit

Permalink
Bug 1228278 - Fix handling of editBookmarkPanel. r=maja_zf
Browse files Browse the repository at this point in the history
  • Loading branch information
whimboo committed Jan 6, 2016
1 parent 2db4504 commit 4b59f7b
Showing 1 changed file with 10 additions and 1 deletion.
Expand Up @@ -19,6 +19,7 @@ class TestStarInAutocomplete(FirefoxTestCase):
def setUp(self):
FirefoxTestCase.setUp(self)

self.bookmark_panel = None
self.test_urls = [self.marionette.absolute_url('layout/mozilla_grants.html')]

# Disable search suggestions to only get results for history and bookmarks
Expand All @@ -32,6 +33,11 @@ def setUp(self):
def tearDown(self):
# Close the autocomplete results
try:
if self.bookmark_panel:
self.marionette.execute_script("""
arguments[0].hidePopup();
""", script_args=[self.bookmark_panel])

self.browser.navbar.locationbar.autocomplete_results.close()
self.places.restore_default_bookmarks()
finally:
Expand All @@ -55,8 +61,11 @@ def visit_urls():
'menu_bookmarkThisPage')

# TODO: Replace hard-coded selector with library method when one is available
self.bookmark_panel = self.marionette.find_element(By.ID, 'editBookmarkPanel')
done_button = self.marionette.find_element(By.ID, 'editBookmarkPanelDoneButton')
Wait(self.marionette).until(lambda mn: done_button.is_displayed)

Wait(self.marionette).until(
lambda mn: self.bookmark_panel.get_attribute('panelopen') == 'true')
done_button.click()

# We must open the blank page so the autocomplete result isn't "Switch to tab"
Expand Down

0 comments on commit 4b59f7b

Please sign in to comment.