Example #1
0
    def test_capabilities_for_w3c(self):
        options = SauceOptions()

        options.browser_name = 'firefox'
        options.browser_version = '7'
        options.platform_name = 'macOS 10.14'
        options.accept_insecure_certs = True
        options.page_load_strategy = 'eager'
        options.set_window_rect = True
        options.unhandled_prompt_behavior = 'accept'
        options.strict_file_interactability = True
        options.timeouts = {'implicit': 1, 'pageLoad': 59, 'script': 29}
        options.build = "Build Name"

        expected_capabilities = {
            'browserName': 'firefox',
            'browserVersion': '7',
            'platformName': 'macOS 10.14',
            'acceptInsecureCerts': True,
            'pageLoadStrategy': 'eager',
            'setWindowRect': True,
            'unhandledPromptBehavior': 'accept',
            'strictFileInteractability': True,
            'timeouts': {
                'implicit': 1,
                'pageLoad': 59,
                'script': 29
            },
            'sauce:options': {
                'build': 'Build Name'
            }
        }

        assert options.to_capabilities() == expected_capabilities
Example #2
0
    def test_w3c_options(self):
        timeouts = {'implicit': 1, 'pageLoad': 59, 'script': 29}

        options = SauceOptions()
        options.browser_name = 'firefox'
        options.browser_version = '7'
        options.platform_name = 'macOS 10.14'
        options.accept_insecure_certs = True
        options.page_load_strategy = 'eager'
        options.set_window_rect = True
        options.unhandled_prompt_behavior = 'accept'
        options.strict_file_interactability = True
        options.timeouts = timeouts

        assert options.browser_name == 'firefox'
        assert options.browser_version == '7'
        assert options.platform_name == 'macOS 10.14'
        assert options.accept_insecure_certs is True
        assert options.page_load_strategy == 'eager'
        assert options.set_window_rect is True
        assert options.unhandled_prompt_behavior == 'accept'
        assert options.strict_file_interactability is True
        assert options.timeouts == timeouts