Bug 1522536 - Remove redundant address bar UI tests. r=whimboo
authorDão Gottwald <dao@mozilla.com>
Tue, 19 Feb 2019 07:45:46 +0000
changeset 520722 59fad017d3c5bd70958da132f8f0b319c9899b6b
parent 520721 831ac8c662c02753c5c5c6af197b47d28d1d0e2c
child 520723 4e0848ac59042490acf497877726e63eaf200962
push id2032
push userffxbld-merge
push dateMon, 13 May 2019 09:36:57 +0000
treeherdermozilla-release@455c1065dcbe [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerswhimboo
bugs1522536
milestone67.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1522536 - Remove redundant address bar UI tests. r=whimboo Differential Revision: https://phabricator.services.mozilla.com/D20269
testing/firefox-ui/tests/functional/locationbar/manifest.ini
testing/firefox-ui/tests/functional/locationbar/test_access_locationbar.py
testing/firefox-ui/tests/functional/locationbar/test_escape_autocomplete.py
testing/firefox-ui/tests/functional/locationbar/test_suggest_bookmarks.py
testing/firefox-ui/tests/functional/manifest.ini
deleted file mode 100644
--- a/testing/firefox-ui/tests/functional/locationbar/manifest.ini
+++ /dev/null
@@ -1,8 +0,0 @@
-[DEFAULT]
-tags = local
-
-[test_access_locationbar.py]
-disabled = Bug 1168727 - Timeout when opening auto-complete popup
-[test_escape_autocomplete.py]
-[test_suggest_bookmarks.py]
-
deleted file mode 100644
--- a/testing/firefox-ui/tests/functional/locationbar/test_access_locationbar.py
+++ /dev/null
@@ -1,60 +0,0 @@
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-from firefox_puppeteer import PuppeteerMixin
-from marionette_driver import Wait
-from marionette_harness import MarionetteTestCase
-
-
-class TestAccessLocationBar(PuppeteerMixin, MarionetteTestCase):
-
-    def setUp(self):
-        super(TestAccessLocationBar, self).setUp()
-
-        # Clear complete history so there's no interference from previous entries.
-        self.puppeteer.places.remove_all_history()
-
-        self.test_urls = [
-            'layout/mozilla_projects.html',
-            'layout/mozilla.html',
-            'layout/mozilla_mission.html'
-        ]
-        self.test_urls = [self.marionette.absolute_url(t)
-                          for t in self.test_urls]
-
-        self.locationbar = self.browser.navbar.locationbar
-        self.autocomplete_results = self.locationbar.autocomplete_results
-        self.urlbar = self.locationbar.urlbar
-
-    def test_access_locationbar_history(self):
-
-        # Open some local pages, then about:blank
-        def load_urls():
-            with self.marionette.using_context('content'):
-                for url in self.test_urls:
-                    self.marionette.navigate(url)
-        self.puppeteer.places.wait_for_visited(self.test_urls, load_urls)
-        with self.marionette.using_context('content'):
-            self.marionette.navigate('about:blank')
-
-        # Need to blur url bar or autocomplete won't load - bug 1038614
-        self.marionette.execute_script("""arguments[0].blur();""", script_args=[self.urlbar])
-
-        # Clear contents of url bar to focus, then arrow down for list of visited sites
-        # Verify that autocomplete is open and results are displayed
-        self.locationbar.clear()
-        self.urlbar.send_keys(self.puppeteer.keys.ARROW_DOWN)
-        Wait(self.marionette).until(lambda _: self.autocomplete_results.is_open)
-        Wait(self.marionette).until(lambda _: len(self.autocomplete_results.visible_results) > 1)
-
-        # Arrow down again to select first item in list, appearing in reversed order, as loaded.
-        # Verify first item.
-        self.urlbar.send_keys(self.puppeteer.keys.ARROW_DOWN)
-        Wait(self.marionette).until(lambda _: self.autocomplete_results.selected_index == '0')
-        self.assertIn('mission', self.locationbar.value)
-
-        # Navigate to the currently selected url
-        # Verify it loads by comparing the page url to the test url
-        self.urlbar.send_keys(self.puppeteer.keys.ENTER)
-        self.assertEqual(self.locationbar.value, self.test_urls[-1])
deleted file mode 100644
--- a/testing/firefox-ui/tests/functional/locationbar/test_escape_autocomplete.py
+++ /dev/null
@@ -1,56 +0,0 @@
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-from firefox_puppeteer import PuppeteerMixin
-from marionette_driver import Wait
-from marionette_harness import MarionetteTestCase
-
-
-class TestEscapeAutocomplete(PuppeteerMixin, MarionetteTestCase):
-
-    def setUp(self):
-        super(TestEscapeAutocomplete, self).setUp()
-
-        # Clear complete history so there's no interference from previous entries.
-        self.puppeteer.places.remove_all_history()
-
-        self.test_urls = [
-            'layout/mozilla.html',
-            'layout/mozilla_community.html',
-        ]
-        self.test_urls = [self.marionette.absolute_url(t)
-                          for t in self.test_urls]
-
-        self.test_string = 'mozilla.org/'
-
-        self.locationbar = self.browser.navbar.locationbar
-        self.autocomplete_results = self.locationbar.autocomplete_results
-
-    def tearDown(self):
-        self.autocomplete_results.close(force=True)
-
-        super(TestEscapeAutocomplete, self).tearDown()
-
-    def test_escape_autocomplete(self):
-        # Open some local pages
-        def load_urls():
-            with self.marionette.using_context('content'):
-                for url in self.test_urls:
-                    self.marionette.navigate(url)
-        self.puppeteer.places.wait_for_visited(self.test_urls, load_urls)
-
-        # Clear the location bar, type the test string, check that autocomplete list opens
-        self.locationbar.clear()
-        self.locationbar.urlbar.send_keys(self.test_string)
-        self.assertEqual(self.locationbar.value, self.test_string)
-        Wait(self.marionette).until(lambda _: self.autocomplete_results.is_open)
-
-        # Press escape, check location bar value, check autocomplete list closed
-        self.locationbar.urlbar.send_keys(self.puppeteer.keys.ESCAPE)
-        self.assertEqual(self.locationbar.value, self.test_string)
-        Wait(self.marionette).until(lambda _: not self.autocomplete_results.is_open)
-
-        # Press escape again and check that locationbar returns to the page url
-        self.locationbar.urlbar.send_keys(self.puppeteer.keys.ESCAPE)
-        self.assertEqual(self.locationbar.value, self.test_urls[-1])
deleted file mode 100644
--- a/testing/firefox-ui/tests/functional/locationbar/test_suggest_bookmarks.py
+++ /dev/null
@@ -1,96 +0,0 @@
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-from firefox_puppeteer import PuppeteerMixin
-from marionette_driver import By, Wait
-from marionette_harness import MarionetteTestCase
-
-
-class TestStarInAutocomplete(PuppeteerMixin, MarionetteTestCase):
-    """ This replaces
-    http://hg.mozilla.org/qa/mozmill-tests/file/default/firefox/tests/functional/testAwesomeBar/testSuggestBookmarks.js
-    Check a star appears in autocomplete list for a bookmarked page.
-    """
-
-    PREF_SUGGEST_SEARCHES = 'browser.urlbar.suggest.searches'
-
-    def setUp(self):
-        super(TestStarInAutocomplete, self).setUp()
-
-        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
-        self.marionette.set_pref(self.PREF_SUGGEST_SEARCHES, False)
-
-        with self.marionette.using_context('content'):
-            self.marionette.navigate('about:blank')
-
-        self.puppeteer.places.remove_all_history()
-
-    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.puppeteer.places.restore_default_bookmarks()
-            self.marionette.clear_pref(self.PREF_SUGGEST_SEARCHES)
-        finally:
-            super(TestStarInAutocomplete, self).tearDown()
-
-    def test_star_in_autocomplete(self):
-        search_string = 'grants'
-
-        def visit_urls():
-            with self.marionette.using_context('content'):
-                for url in self.test_urls:
-                    self.marionette.navigate(url)
-
-        # Navigate to all the urls specified in self.test_urls and wait for them to
-        # be registered as visited
-        self.puppeteer.places.wait_for_visited(self.test_urls, visit_urls)
-
-        # Bookmark the current page using the bookmark menu
-        self.browser.menubar.select_by_id('bookmarksMenu',
-                                          '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: 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"
-        with self.marionette.using_context('content'):
-            self.marionette.navigate('about:blank')
-
-        self.puppeteer.places.remove_all_history()
-
-        # Focus the locationbar, delete any contents there, and type the search string
-        locationbar = self.browser.navbar.locationbar
-        locationbar.clear()
-        locationbar.urlbar.send_keys(search_string)
-        autocomplete_results = locationbar.autocomplete_results
-
-        # Wait for the search string to be present, for the autocomplete results to appear
-        # and for there to be exactly one autocomplete result
-        Wait(self.marionette).until(lambda mn: locationbar.value == search_string)
-        Wait(self.marionette).until(lambda mn: autocomplete_results.is_complete)
-        Wait(self.marionette).until(lambda mn: len(autocomplete_results.visible_results) == 2)
-
-        # Compare the highlighted text in the autocomplete result to the search string
-        first_result = autocomplete_results.visible_results[1]
-        matching_titles = autocomplete_results.get_matching_text(first_result, 'title')
-        for title in matching_titles:
-            Wait(self.marionette).until(lambda mn: title.lower() == search_string)
-
-        self.assertIn('bookmark',
-                      first_result.get_attribute('type'),
-                      'The auto-complete result is a bookmark')
--- a/testing/firefox-ui/tests/functional/manifest.ini
+++ b/testing/firefox-ui/tests/functional/manifest.ini
@@ -1,6 +1,5 @@
 [include:keyboard_shortcuts/manifest.ini]
-[include:locationbar/manifest.ini]
 [include:private_browsing/manifest.ini]
 [include:safebrowsing/manifest.ini]
 [include:security/manifest.ini]
 [include:sessionstore/manifest.ini]