GitLab is used only for code review, issue tracking and project management. Canonical locations for source code are still https://gitweb.torproject.org/ https://git.torproject.org/ and git-rw.torproject.org.

Unverified Commit 79f8d58a authored by boklm's avatar boklm
Browse files

Convert the searchengines test to marionette

parent 59b07f83
......@@ -330,7 +330,7 @@ our @tests = (
},
{
name => 'searchengines',
type => 'mozmill',
type => 'marionette',
descr => 'Check that we have the default search engines set',
},
{
......
# This test checks whether the top three search engines are in the right order
# in the upper right search box. This has been an issue as search engine names
# got translated, too, leading to the browser not recognizing them anymore.
# This in turn led to wrong default search engines (see bug 11236 for details).
# We are not testing whether some prefs are set properly as this can be the
# case while the search engines are still not properly ordered. Rather, we
# check the entries in the search box directly.
from marionette_driver import By, Wait
from marionette_driver.errors import MarionetteException
from firefox_ui_harness import FirefoxTestCase
import testsuite
class Test(FirefoxTestCase):
def setUp(self):
FirefoxTestCase.setUp(self)
ts = testsuite.TestSuite()
def test_searchengines(self):
with self.marionette.using_context('content'):
self.marionette.navigate('about:')
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'), 'Disconnect',
'Disconnect is not the default search engine!')
#XXX: Test whether the second and third engine are the ones we want as well.
// This test checks whether the top three search engines are in the right order
// in the upper right search box. This has been an issue as search engine names
// got translated, too, leading to the browser not recognizing them anymore.
// This in turn led to wrong default search engines (see bug 11236 for details).
// We are not testing whether some prefs are set properly as this can be the
// case while the search engines are still not properly ordered. Rather, we
// check the entries in the search box directly.
"use strict";
var {expect} = require("../mozilla-mozmill-tests/lib/assertions");
var common = require("../lib/common");
var setupModule = function(aModule) {
aModule.controller = mozmill.getBrowserController();
}
var testSearchEngines = function () {
let searchbar = controller.window.document.getElementById("searchbar");
// Do we have Startpage as default search engine?
let searchbarTextbox = controller.window.document.
getAnonymousElementByAttribute(searchbar, "anonid", "searchbar-textbox");
expect.match(searchbarTextbox.label, /Disconnect/,
"Disconnect is not the default search engine!");
// XXX: Test whether the second and third engine are the ones we want as well.
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment