当前位置: 首页>>代码示例>>Python>>正文


Python FirefoxTestCase.setUp方法代码示例

本文整理汇总了Python中firefox_puppeteer.testcases.FirefoxTestCase.setUp方法的典型用法代码示例。如果您正苦于以下问题:Python FirefoxTestCase.setUp方法的具体用法?Python FirefoxTestCase.setUp怎么用?Python FirefoxTestCase.setUp使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在firefox_puppeteer.testcases.FirefoxTestCase的用法示例。


在下文中一共展示了FirefoxTestCase.setUp方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: setUp

# 需要导入模块: from firefox_puppeteer.testcases import FirefoxTestCase [as 别名]
# 或者: from firefox_puppeteer.testcases.FirefoxTestCase import setUp [as 别名]
    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
开发者ID:linclark,项目名称:gecko-dev,代码行数:28,代码来源:test_ssl_status_after_restart.py

示例2: setUp

# 需要导入模块: from firefox_puppeteer.testcases import FirefoxTestCase [as 别名]
# 或者: from firefox_puppeteer.testcases.FirefoxTestCase import setUp [as 别名]
    def setUp(self):
        FirefoxTestCase.setUp(self)

        self.locationbar = self.browser.navbar.locationbar
        self.identity_popup = self.locationbar.identity_popup

        self.url = 'https://mozqa.com/data/firefox/security/mixedcontent.html'
开发者ID:linclark,项目名称:gecko-dev,代码行数:9,代码来源:test_mixed_content_page.py

示例3: setUp

# 需要导入模块: from firefox_puppeteer.testcases import FirefoxTestCase [as 别名]
# 或者: from firefox_puppeteer.testcases.FirefoxTestCase import setUp [as 别名]
    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)
开发者ID:kilikkuo,项目名称:gecko-dev,代码行数:9,代码来源:test_submit_unencrypted_info_warning.py

示例4: setUp

# 需要导入模块: from firefox_puppeteer.testcases import FirefoxTestCase [as 别名]
# 或者: from firefox_puppeteer.testcases.FirefoxTestCase import setUp [as 别名]
    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")
开发者ID:linclark,项目名称:gecko-dev,代码行数:9,代码来源:test_no_certificate.py

示例5: setUp

# 需要导入模块: from firefox_puppeteer.testcases import FirefoxTestCase [as 别名]
# 或者: from firefox_puppeteer.testcases.FirefoxTestCase import setUp [as 别名]
    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'
开发者ID:kilikkuo,项目名称:gecko-dev,代码行数:10,代码来源:test_about_private_browsing.py

示例6: setUp

# 需要导入模块: from firefox_puppeteer.testcases import FirefoxTestCase [as 别名]
# 或者: from firefox_puppeteer.testcases.FirefoxTestCase import setUp [as 别名]
    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.')
开发者ID:prashant2018,项目名称:gecko-dev,代码行数:60,代码来源:update.py

示例7: setUp

# 需要导入模块: from firefox_puppeteer.testcases import FirefoxTestCase [as 别名]
# 或者: from firefox_puppeteer.testcases.FirefoxTestCase import setUp [as 别名]
    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'
开发者ID:kilikkuo,项目名称:gecko-dev,代码行数:11,代码来源:test_prefs.py

示例8: setUp

# 需要导入模块: from firefox_puppeteer.testcases import FirefoxTestCase [as 别名]
# 或者: from firefox_puppeteer.testcases.FirefoxTestCase import setUp [as 别名]
    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)
开发者ID:kilikkuo,项目名称:gecko-dev,代码行数:12,代码来源:test_toolbars.py

示例9: setUp

# 需要导入模块: from firefox_puppeteer.testcases import FirefoxTestCase [as 别名]
# 或者: from firefox_puppeteer.testcases.FirefoxTestCase import setUp [as 别名]
    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)
开发者ID:kilikkuo,项目名称:gecko-dev,代码行数:14,代码来源:test_ssl_disabled_error_page.py

示例10: setUp

# 需要导入模块: from firefox_puppeteer.testcases import FirefoxTestCase [as 别名]
# 或者: from firefox_puppeteer.testcases.FirefoxTestCase import setUp [as 别名]
    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()
开发者ID:kilikkuo,项目名称:gecko-dev,代码行数:14,代码来源:test_suggest_bookmarks.py

示例11: setUp

# 需要导入模块: from firefox_puppeteer.testcases import FirefoxTestCase [as 别名]
# 或者: from firefox_puppeteer.testcases.FirefoxTestCase import setUp [as 别名]
    def setUp(self):
        FirefoxTestCase.setUp(self)

        self.urls = [
            # Invalid cert page
            'https://ssl-expired.mozqa.com',
            # Secure page
            'https://ssl-ev.mozqa.com/',
            # Insecure page
            'http://www.mozqa.com'
        ]

        self.identity_box = self.browser.navbar.locationbar.identity_box
开发者ID:kilikkuo,项目名称:gecko-dev,代码行数:15,代码来源:test_security_notification.py

示例12: setUp

# 需要导入模块: from firefox_puppeteer.testcases import FirefoxTestCase [as 别名]
# 或者: from firefox_puppeteer.testcases.FirefoxTestCase import setUp [as 别名]
    def setUp(self):
        FirefoxTestCase.setUp(self)

        def opener(win):
            self.marionette.execute_script("""
              let updatePrompt = Components.classes["@mozilla.org/updates/update-prompt;1"]
                                 .createInstance(Components.interfaces.nsIUpdatePrompt);
              updatePrompt.checkForUpdates();
            """)

        self.dialog = self.browser.open_window(callback=opener,
                                               expected_window_class=UpdateWizardDialog)
        self.wizard = self.dialog.wizard
开发者ID:kilikkuo,项目名称:gecko-dev,代码行数:15,代码来源:test_update_wizard.py

示例13: setUp

# 需要导入模块: from firefox_puppeteer.testcases import FirefoxTestCase [as 别名]
# 或者: from firefox_puppeteer.testcases.FirefoxTestCase import setUp [as 别名]
    def setUp(self):
        FirefoxTestCase.setUp(self)

        # Disable search suggestions to get results only for history and bookmarks
        self.prefs.set_pref(self.PREF_SUGGEST_SEARCHES, False)

        self.places.remove_all_history()

        self.test_urls = [self.marionette.absolute_url('layout/mozilla.html')]

        self.test_string = 'mozilla'
        self.test_favicon = 'mozilla_favicon.ico'

        self.autocomplete_results = self.browser.navbar.locationbar.autocomplete_results
开发者ID:kilikkuo,项目名称:gecko-dev,代码行数:16,代码来源:test_favicon_in_autocomplete.py

示例14: setUp

# 需要导入模块: from firefox_puppeteer.testcases import FirefoxTestCase [as 别名]
# 或者: from firefox_puppeteer.testcases.FirefoxTestCase import setUp [as 别名]
    def setUp(self):
        FirefoxTestCase.setUp(self)

        self.url = 'https://mozqa.com/data/firefox/security/mixed_content_blocked/index.html'

        self.test_elements = [
            ('result1', 'Insecure script one'),
            ('result2', 'Insecure script from iFrame'),
            ('result3', 'Insecure plugin'),
            ('result4', 'Insecure stylesheet'),
        ]

        self.locationbar = self.browser.navbar.locationbar
        self.identity_popup = self.locationbar.identity_popup
开发者ID:kilikkuo,项目名称:gecko-dev,代码行数:16,代码来源:test_mixed_script_content_blocking.py

示例15: setUp

# 需要导入模块: from firefox_puppeteer.testcases import FirefoxTestCase [as 别名]
# 或者: from firefox_puppeteer.testcases.FirefoxTestCase import setUp [as 别名]
    def setUp(self):
        FirefoxTestCase.setUp(self)

        # Clear complete history so there's no interference from previous entries.
        self.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
开发者ID:linclark,项目名称:gecko-dev,代码行数:19,代码来源:test_access_locationbar.py


注:本文中的firefox_puppeteer.testcases.FirefoxTestCase.setUp方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。