Commit b1d93a3c authored by Alex Catarineu's avatar Alex Catarineu
Browse files

Bug 40011: Update tests when switching to Fenix 84

parent b72c9c38
......@@ -760,6 +760,8 @@ class Test(testsuite.TorBrowserTest):
expectedObjects = expectedObjects.union({"MediaMetadata","MediaSession","Sanitizer"})
if self.get_version() >= 83 and self.is_early_beta_or_earlier():
expectedObjects = expectedObjects.union({"onbeforeinput"})
if self.get_version() >= 84:
expectedObjects = expectedObjects.union({"PerformancePaintTiming"}).difference({"Sanitizer"})
with self.marionette.using_context('content'):
self.marionette.navigate(self.test_page_file_url)
......
from marionette_driver import Wait
from marionette_driver.legacy_actions import Actions
from marionette_harness import MarionetteTestCase, WindowManagerMixin
class Test(WindowManagerMixin, MarionetteTestCase):
......@@ -39,9 +38,11 @@ class Test(WindowManagerMixin, MarionetteTestCase):
# Opening a same-origin link should keep the onion alias in the urlbar
el = m.find_element('id', 'submit-documents-button')
action = Actions(m)
action.middle_click(el)
action.perform()
mouse_chain = self.marionette.actions.sequence(
"pointer", "pointer_id", {"pointerType": "mouse"}
)
mouse_chain.click(element=el, button=1).perform()
Wait(m, timeout=m.timeout.page_load).until(
lambda _: len(m.window_handles) > 1)
m.switch_to_window(m.window_handles[1])
......
......@@ -81,8 +81,9 @@ class Test(WindowManagerMixin, MarionetteTestCase):
with m.using_context('content'):
m.switch_to_window(m.window_handles[1])
spotlight = m.find_element('class name', 'spotlight')
self.assertEqual(
self.get_url(), 'about:preferences#privacy-onionservices')
spotlight.get_attribute("data-subcategory"), "onionservices")
m.close()
m.switch_to_window(self.start_tab)
......
......@@ -51,8 +51,8 @@ class Test(OnionFixturesMixin, WindowManagerMixin, MarionetteTestCase):
'document.getElementById("identity-popup-more-info").click()')
m.switch_to_window(m.chrome_window_handles[1])
Wait(m, timeout=m.timeout.page_load).until(
lambda _: m.find_element('id', 'security-technical-shortform').text != '')
text = m.find_element('id', 'security-technical-shortform').text
lambda _: m.find_element('id', 'security-technical-shortform').get_attribute('value') != '')
text = m.find_element('id', 'security-technical-shortform').get_attribute('value')
m.close_chrome_window()
m.switch_to_window(self.start_window)
return text
......
......@@ -7,6 +7,7 @@
# check the entries in the search box directly.
from marionette_harness import MarionetteTestCase
from marionette_driver import Wait
import testsuite
class Test(MarionetteTestCase):
......@@ -16,6 +17,7 @@ class Test(MarionetteTestCase):
ts = testsuite.TestSuite()
def test_searchengines(self):
m = self.marionette
with self.marionette.using_context('content'):
self.marionette.navigate('about:robots')
......@@ -26,6 +28,7 @@ class Test(MarionetteTestCase):
searchbar.send_keys("test")
urlbarresults = self.marionette.find_element('id', 'urlbar-results')
result = urlbarresults.find_element("css selector", "div:first-child .urlbarView-action")
Wait(m, timeout=m.timeout.page_load).until(lambda _: result.text != '')
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.
from marionette_driver import Wait
from marionette_driver import Wait, expected
from marionette_harness import MarionetteTestCase
class Test(MarionetteTestCase):
......@@ -12,8 +12,9 @@ class Test(MarionetteTestCase):
'id', 'securityLevel-advancedSecuritySettings').click()
with m.using_context('content'):
# Test whether changing the security level value works
spotlight = m.find_element('class name', 'spotlight')
self.assertEqual(
m.get_url(), "about:preferences#privacy-securitylevel")
spotlight.get_attribute("data-subcategory"), "securitylevel")
self.assertEqual(4, m.get_pref(
'extensions.torbutton.security_slider'))
m.find_element(
......
(() => {
// The setTimeout is a workaround for some objects not being immediately available in some cases,
// such as NotifyPaintEvent.
setTimeout(() => {
// getAllPropertyNames function taken from:
// https://stackoverflow.com/questions/8024149/is-it-possible-to-get-the-non-enumerable-inherited-property-names-of-an-object
function getAllPropertyNames(obj) {
......@@ -41,4 +43,4 @@
onmessage(getGlobalNames());
}
}
})();
\ No newline at end of file
}, 2000);
\ No newline at end of file
Supports Markdown
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