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"
"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(
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
def configuration(): return Configuration()
def eyes_config_base(): return Configuration()
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
def eyes_config_base(): return Configuration().set_save_new_tests(False)