本文整理汇总了Python中firefox_puppeteer.testcases.FirefoxTestCase类的典型用法代码示例。如果您正苦于以下问题:Python FirefoxTestCase类的具体用法?Python FirefoxTestCase怎么用?Python FirefoxTestCase使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了FirefoxTestCase类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: setUp
def setUp(self):
FirefoxTestCase.setUp(self)
self.test_data = (
{
'url': 'https://ssl-dv.mozqa.com',
'identity': '',
'type': 'secure'
},
{
'url': 'https://ssl-ev.mozqa.com/',
'identity': 'Mozilla Corporation',
'type': 'secure-ev'
},
{
'url': 'https://ssl-ov.mozqa.com/',
'identity': '',
'type': 'secure'
}
)
# Set browser to restore previous session
self.prefs.set_pref('browser.startup.page', 3)
self.locationbar = self.browser.navbar.locationbar
self.identity_popup = self.locationbar.identity_popup
示例2: tearDown
def tearDown(self):
# Close the autocomplete results
try:
self.browser.navbar.locationbar.autocomplete_results.close()
self.places.restore_default_bookmarks()
finally:
FirefoxTestCase.tearDown(self)
示例3: setUp
def setUp(self):
FirefoxTestCase.setUp(self)
self.url = 'https://ssl-dv.mozqa.com/data/firefox/security/unencryptedsearch.html'
self.test_string = 'mozilla'
self.prefs.set_pref('security.warn_submit_insecure', True)
示例4: setUp
def setUp(self):
FirefoxTestCase.setUp(self)
self.locationbar = self.browser.navbar.locationbar
self.identity_popup = self.locationbar.identity_popup
self.url = 'https://ssl-ev.mozqa.com/'
示例5: tearDown
def tearDown(self):
try:
self.browser.switch_to()
self.identity_popup.close(force=True)
self.windows.close_all([self.browser])
finally:
FirefoxTestCase.tearDown(self)
示例6: setUp
def setUp(self):
FirefoxTestCase.setUp(self)
self.locationbar = self.browser.navbar.locationbar
self.identity_popup = self.locationbar.identity_popup
self.url = self.marionette.absolute_url("layout/mozilla.html")
示例7: setUp
def setUp(self):
FirefoxTestCase.setUp(self)
# Use a fake local support URL
support_url = 'about:blank?'
self.prefs.set_pref('app.support.baseURL', support_url)
self.pb_url = support_url + 'private-browsing'
示例8: setUp
def setUp(self, is_fallback=False):
FirefoxTestCase.setUp(self)
self.software_update = SoftwareUpdate(lambda: self.marionette)
self.download_duration = None
# Bug 604364 - Preparation to test multiple update steps
self.current_update_index = 0
self.staging_directory = self.software_update.staging_directory
# If requested modify the default update channel. It will be active
# after the next restart of the application
# Bug 1142805 - Modify file via Python directly
if self.update_channel:
# Backup the original content and the path of the channel-prefs.js file
self.default_update_channel = {
'content': self.software_update.update_channel.file_contents,
'path': self.software_update.update_channel.file_path,
}
self.software_update.update_channel.default_channel = self.update_channel
# If requested modify the list of allowed MAR channels
# Bug 1142805 - Modify file via Python directly
if self.update_mar_channels:
# Backup the original content and the path of the update-settings.ini file
self.default_mar_channels = {
'content': self.software_update.mar_channels.config_file_contents,
'path': self.software_update.mar_channels.config_file_path,
}
self.software_update.mar_channels.add_channels(self.update_mar_channels)
# Bug 1142805 - Until we don't modify the channel-prefs.js and update-settings.ini
# files before Firefox gets started, a restart of Firefox is necessary to
# accept the new update channel.
self.restart()
# Dictionary which holds the information for each update
self.updates = [{
'build_pre': self.software_update.build_info,
'build_post': None,
'fallback': is_fallback,
'patch': {},
'success': False,
}]
self.assertEqual(self.software_update.update_channel.default_channel,
self.software_update.update_channel.channel)
self.assertTrue(self.update_mar_channels.issubset(
self.software_update.mar_channels.channels),
'Allowed MAR channels have been set: expected "{}" in "{}"'.format(
', '.join(self.update_mar_channels),
', '.join(self.software_update.mar_channels.channels)))
# Check if the user has permissions to run the update
self.assertTrue(self.software_update.allowed,
'Current user has permissions to update the application.')
示例9: setUp
def setUp(self):
FirefoxTestCase.setUp(self)
self.new_pref = 'marionette.unittest.set_pref'
self.unknown_pref = 'marionette.unittest.unknown'
self.bool_pref = 'browser.tabs.loadBookmarksInBackground'
self.int_pref = 'browser.tabs.maxOpenBeforeWarn'
self.string_pref = 'browser.newtab.url'
示例10: tearDown
def tearDown(self):
try:
self.autocomplete_results.close(force=True)
except NoSuchElementException:
# TODO: A NoSuchElementException is thrown here when tests accessing the
# autocomplete_results element are skipped.
pass
finally:
FirefoxTestCase.tearDown(self)
示例11: setUp
def setUp(self):
FirefoxTestCase.setUp(self)
self.locationbar = self.browser.navbar.locationbar
self.identity_popup = self.locationbar.identity_popup
self.url = 'https://ssl-ev.mozqa.com'
with self.marionette.using_context('content'):
self.marionette.navigate(self.url)
示例12: tearDown
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:
FirefoxTestCase.tearDown(self)
示例13: setUp
def setUp(self):
FirefoxTestCase.setUp(self)
self.url = 'https://tlsv1-0.mozqa.com'
self.utils.sanitize({"sessions": True})
# Disable SSL 3.0, TLS 1.0 and TLS 1.1 for secure connections
# by forcing the use of TLS 1.2
# see: http://kb.mozillazine.org/Security.tls.version.*#Possible_values_and_their_effects
self.prefs.set_pref('security.tls.version.min', 3)
self.prefs.set_pref('security.tls.version.max', 3)
示例14: tearDown
def tearDown(self):
try:
self.browser.tabbar.close_all_tabs([self.browser.tabbar.selected_tab])
# Print results for now until we have treeherder integration
output = pprint.pformat(self.updates)
self.logger.info('Update test results: \n{}'.format(output))
finally:
FirefoxTestCase.tearDown(self)
self.restore_config_files()
示例15: setUp
def setUp(self):
FirefoxTestCase.setUp(self)
self.test_urls = [self.marionette.absolute_url('layout/mozilla_grants.html')]
# Disable search suggestions to only get results for history and bookmarks
self.prefs.set_pref(self.PREF_SUGGEST_SEARCHES, False)
with self.marionette.using_context('content'):
self.marionette.navigate('about:blank')
self.places.remove_all_history()