コード例 #1
0
def test_config_envs():
    with patch.dict(
            os.environ,
        {
            "APPLITOOLS_BRANCH": "name",
            "APPLITOOLS_PARENT_BRANCH": "parent branch",
            "APPLITOOLS_BASELINE_BRANCH": "baseline branch",
            "APPLITOOLS_API_KEY": "api key",
            "APPLITOOLS_SERVER_URL": "server url",
        },
    ):
        config = Configuration()
    assert config.branch_name == "name"
    assert config.parent_branch_name == "parent branch"
    assert config.baseline_branch_name == "baseline branch"
    assert config.api_key == "api key"
    assert config.server_url == "server url"
コード例 #2
0
            "APPLITOOLS_BRANCH": "name",
            "APPLITOOLS_PARENT_BRANCH": "parent branch",
            "APPLITOOLS_BASELINE_BRANCH": "baseline branch",
            "APPLITOOLS_API_KEY": "api key",
            "APPLITOOLS_SERVER_URL": "server url",
        },
    ):
        config = Configuration()
    assert config.branch_name == "name"
    assert config.parent_branch_name == "parent branch"
    assert config.baseline_branch_name == "baseline branch"
    assert config.api_key == "api key"
    assert config.server_url == "server url"


@pytest.mark.parametrize("conf", [Configuration(), SeleniumConfiguration()])
def test_set_value_to_conf(conf):
    batch = BatchInfo()
    (conf.set_batch(batch).set_branch_name("branch name").set_agent_id(
        "agent id").set_parent_branch_name("parent branch name").
     set_baseline_branch_name("baseline branch name").set_baseline_env_name(
         "baseline env name").set_environment_name("env name").set_save_diffs(
             True).set_app_name("app name").set_test_name(
                 "test name").set_viewport_size({
                     "width": 400,
                     "height": 300
                 }).set_session_type(SessionType.PROGRESSION).set_ignore_caret(
                     False).set_host_app("host app").set_host_os(
                         "host os").set_match_timeout(100000).set_match_level(
                             MatchLevel.EXACT).set_ignore_displacements(True).
     set_save_new_tests(False).set_save_failed_tests(True).set_failure_reports(
コード例 #3
0
def configured_connector(custom_eyes_server):
    # type: (Optional[Text]) -> ServerConnector
    connector = ServerConnector()
    conf = Configuration(server_url=custom_eyes_server)
    connector.update_config(conf)
    return connector
コード例 #4
0
def configuration():
    return Configuration()
コード例 #5
0
def eyes_config_base():
    return Configuration()
コード例 #6
0
ファイル: eyes.py プロジェクト: pythonthings/eyes.sdk.python
    EyesBase,
    RegionProvider,
    NullCutProvider,
)
from applitools.images.fluent import ImagesCheckSettings, Target

from .__version__ import __version__
from .capture import EyesImagesScreenshot

if typing.TYPE_CHECKING:
    from typing import Text, Union, Optional, Dict
    from PIL import Image
    from applitools.common.utils.custom_types import ViewPort


@proxy_to("configuration", Configuration.all_fields())
class Eyes(EyesBase):
    _raw_title = None  # type: Optional[Text]
    _screenshot = None  # type: Optional[EyesImagesScreenshot]
    _inferred = None  # type: Optional[Text]

    @property
    def full_agent_id(self):
        # type: () -> Text
        if self.agent_id is None:
            return self.base_agent_id
        return "%s [%s]" % (self.agent_id, self.base_agent_id)

    @property
    def base_agent_id(self):
        # type: () -> Text
コード例 #7
0
def eyes_config_base():
    return Configuration().set_save_new_tests(False)