[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [tor-browser-bundle-testsuite/master] Fix searchengines test



commit aa420c446bacd1dd800ad75467261726037b5ec2
Author: Alex Catarineu <acat@xxxxxxxxxxxxxx>
Date:   Mon May 18 09:36:03 2020 +0200

    Fix searchengines test
---
 TBBTestSuite/TestSuite/BrowserBundleTests.pm       |  2 --
 marionette/tor_browser_tests/test_searchengines.py | 13 ++++++++-----
 2 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/TBBTestSuite/TestSuite/BrowserBundleTests.pm b/TBBTestSuite/TestSuite/BrowserBundleTests.pm
index 0bf4359..91aa6f0 100644
--- a/TBBTestSuite/TestSuite/BrowserBundleTests.pm
+++ b/TBBTestSuite/TestSuite/BrowserBundleTests.pm
@@ -385,8 +385,6 @@ our @tests = (
         name            => 'searchengines',
         type            => 'marionette',
         descr           => 'Check that we have the default search engines set',
-        # Bug 30340: temporarily disable test
-        enable          => sub { undef },
     },
     {
         name            => 'noscript',
diff --git a/marionette/tor_browser_tests/test_searchengines.py b/marionette/tor_browser_tests/test_searchengines.py
index 69d0ffe..eeb2c6b 100644
--- a/marionette/tor_browser_tests/test_searchengines.py
+++ b/marionette/tor_browser_tests/test_searchengines.py
@@ -22,12 +22,15 @@ class Test(MarionetteTestCase):
 
     def test_searchengines(self):
         with self.marionette.using_context('content'):
-            self.marionette.navigate('about:')
+            self.marionette.navigate('about:robots')
 
         with self.marionette.using_context('chrome'):
-            searchbar = self.marionette.find_element('id', 'searchbar')
-            txtbox = searchbar.find_element('anon attribute', {'anonid': 'searchbar-textbox'})
-            self.assertRegexpMatches(txtbox.get_attribute('label'), 'DuckDuckGo',
-                    'DuckDuckGo is not the default search engine!')
+            self.marionette.timeout.implicit = 5
+            searchbar = self.marionette.find_element('id', 'urlbar-input')
+            searchbar.click()
+            searchbar.send_keys("test")
+            urlbarresults = self.marionette.find_element('id', 'urlbar-results')
+            result = urlbarresults.find_element("css selector", "div:first-child .urlbarView-action")
+            self.assertRegexpMatches(result.text, 'DuckDuckGo', 'DuckDuckGo is not the default search engine!')
 
             #XXX: Test whether the second and third engine are the ones we want as well.



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits