コード例 #1
0
    def test_capabilities_for_selenium(self):
        browser_options = FirefoxOptions()
        browser_options.add_argument('--foo')
        browser_options.set_preference('foo', 'bar')

        options = SauceOptions(seleniumOptions=browser_options)
        options.build = 'Sample Build Name'

        expected_capabilities = {
            'acceptInsecureCerts': True,
            'browserName': 'firefox',
            'browserVersion': 'latest',
            'platformName': 'Windows 10',
            'marionette': True,
            'moz:firefoxOptions': {
                'args': ['--foo'],
                'prefs': {
                    'foo': 'bar'
                }
            },
            'sauce:options': {
                'build': 'Sample Build Name'
            }
        }

        assert options.to_capabilities() == expected_capabilities
コード例 #2
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
コード例 #3
0
ファイル: test_options.py プロジェクト: coleve27/simple_sauce
    def test_capabilities_for_sauce(self):
        sauce = SauceOptions()
        sauce.name = 'my-test'
        sauce.record_screenshots = False

        capabilities = sauce.to_capabilities()

        assert capabilities['sauce:options']['recordScreenshots'] is False
        assert capabilities['sauce:options']['name'] == 'my-test'
コード例 #4
0
ファイル: test_options.py プロジェクト: coleve27/simple_sauce
    def test_capabilities_for_selenium(self):
        browser_options = FirefoxOptions()
        browser_options.add_argument('--foo')
        browser_options.set_preference('foo', 'bar')

        sauce = SauceOptions(seleniumOptions=browser_options)

        capabilities = sauce.to_capabilities()

        assert capabilities['moz:firefoxOptions']['args'] == ['--foo']
        assert capabilities['moz:firefoxOptions']['prefs'] == {'foo': 'bar'}
コード例 #5
0
ファイル: test_options.py プロジェクト: coleve27/simple_sauce
    def test_capabilities_for_w3c(self):
        sauce = SauceOptions()
        sauce.browser_name = 'safari'
        sauce.platform_name = 'macOS 10.14'
        sauce.accept_insecure_certs = True

        capabilities = sauce.to_capabilities()

        assert capabilities['acceptInsecureCerts'] is True
        assert capabilities['browserName'] == 'safari'
        assert capabilities['browserVersion'] == 'latest'
        assert capabilities['sauce:options']['build'] is not None
コード例 #6
0
    def test_capabilities_for_sauce(self):
        prerun = {
            'executable': 'http://url.to/your/executable.exe',
            'args': ['--silent', '-a', '-q'],
            'background': False,
            'timeout': 120
        }
        custom_data = {'foo': 'foo', 'bar': 'bar'}
        tags = ['foo', 'bar']

        options = SauceOptions()

        options.avoid_proxy = True
        options.build = 'Sample Build Name'
        options.capture_performance = True
        options.chromedriver_version = '71'
        options.command_timeout = 2
        options.custom_data = custom_data
        options.extended_debugging = True
        options.idle_timeout = 3
        options.iedriver_version = '3.141.0'
        options.max_duration = 300
        options.name = 'Sample Test Name'
        options.parent_tunnel = 'Mommy'
        options.prerun = prerun
        options.priority = 0
        options.public = 'team'
        options.record_logs = False
        options.record_screenshots = False
        options.record_video = False
        options.screen_resolution = '10x10'
        options.selenium_version = '3.141.59'
        options.tags = tags
        options.time_zone = 'San Francisco'
        options.tunnel_identifier = 'tunnelname'
        options.video_upload_on_pass = False

        expected_capabilities = {
            'browserName': 'chrome',
            'browserVersion': 'latest',
            'platformName': 'Windows 10',
            'sauce:options': {
                'build': 'Sample Build Name',
                'avoidProxy': True,
                'capturePerformance': True,
                'chromedriverVersion': '71',
                'commandTimeout': 2,
                'customData': {
                    'foo': 'foo',
                    'bar': 'bar'
                },
                'extendedDebugging': True,
                'idleTimeout': 3,
                'iedriverVersion': '3.141.0',
                'maxDuration': 300,
                'name': 'Sample Test Name',
                'parentTunnel': 'Mommy',
                'prerun': prerun,
                'priority': 0,
                'public': 'team',
                'recordLogs': False,
                'recordScreenshots': False,
                'recordVideo': False,
                'screenResolution': '10x10',
                'seleniumVersion': '3.141.59',
                'tags': ['foo', 'bar'],
                'timeZone': 'San Francisco',
                'tunnelIdentifier': 'tunnelname',
                'videoUploadOnPass': False
            }
        }

        assert options.to_capabilities() == expected_capabilities