Skip to content
This repository was archived by the owner on Aug 10, 2022. It is now read-only.

Commit f14acb5

Browse files
authored
Merge pull request #21 from applitools/develop
Merge develop to master
2 parents cba61d6 + 864caf1 commit f14acb5

File tree

24 files changed

+335
-204
lines changed

24 files changed

+335
-204
lines changed

.bumpversion.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[bumpversion]
2-
current_version = 4.0.0
2+
current_version = 4.0.1
33
commit = True
44
tag = True
55

eyes_common/applitools/common/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
from .match_window_data import MatchWindowData, Options
3030
from .metadata import AppEnvironment, RunningSession, SessionStartInfo
3131
from .server import FailureReports, SessionType
32-
from .test_results import TestResults
32+
from .test_results import TestResults, TestResultSummary
3333
from .visual_grid import (
3434
ChromeEmulationInfo,
3535
DeviceName,
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "4.0.0"
1+
__version__ = "4.0.1"

eyes_common/applitools/common/config/configuration.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ class Configuration(object):
8484
properties = attr.ib(factory=list)
8585
hide_scrollbars = attr.ib(default=False)
8686
match_timeout = attr.ib(default=DEFAULT_MATCH_TIMEOUT)
87-
match_level = attr.ib(default=MatchLevel.STRICT) # TODO add converter to enum
87+
match_level = attr.ib(default=MatchLevel.STRICT, converter=MatchLevel)
8888
is_disabled = attr.ib(default=False)
8989
save_new_tests = attr.ib(default=True)
9090
save_failed_tests = attr.ib(default=False)

eyes_common/applitools/common/match.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -88,30 +88,30 @@ class ImageMatchSettings(object):
8888
"""
8989

9090
match_level = attr.ib(
91-
default=MatchLevel.STRICT, metadata={JsonInclude.NON_NONE: True}
91+
default=MatchLevel.STRICT, metadata={JsonInclude.THIS: True}
9292
) # type: MatchLevel
9393
exact = attr.ib(
94-
default=None, type=ExactMatchSettings, metadata={JsonInclude.NON_NONE: True}
94+
default=None, type=ExactMatchSettings, metadata={JsonInclude.THIS: True}
9595
) # type: Optional[ExactMatchSettings]
96-
ignore_caret = attr.ib(default=None, metadata={JsonInclude.NON_NONE: True})
97-
send_dom = attr.ib(default=False, metadata={JsonInclude.NON_NONE: True})
98-
use_dom = attr.ib(default=False, metadata={JsonInclude.NON_NONE: True})
99-
enable_patterns = attr.ib(default=False, metadata={JsonInclude.NON_NONE: True})
96+
ignore_caret = attr.ib(default=False, metadata={JsonInclude.THIS: True})
97+
send_dom = attr.ib(default=False, metadata={JsonInclude.THIS: True})
98+
use_dom = attr.ib(default=False, metadata={JsonInclude.THIS: True})
99+
enable_patterns = attr.ib(default=False, metadata={JsonInclude.THIS: True})
100100

101101
ignore = attr.ib(
102-
factory=list, type=typing.List[Region], metadata={JsonInclude.NON_NONE: True}
102+
factory=list, type=typing.List[Region], metadata={JsonInclude.THIS: True}
103103
)
104104
layout = attr.ib(
105-
factory=list, type=typing.List[Region], metadata={JsonInclude.NON_NONE: True}
105+
factory=list, type=typing.List[Region], metadata={JsonInclude.THIS: True}
106106
)
107107
strict = attr.ib(
108-
factory=list, type=typing.List[Region], metadata={JsonInclude.NON_NONE: True}
108+
factory=list, type=typing.List[Region], metadata={JsonInclude.THIS: True}
109109
)
110110
content = attr.ib(
111-
factory=list, type=typing.List[Region], metadata={JsonInclude.NON_NONE: True}
111+
factory=list, type=typing.List[Region], metadata={JsonInclude.THIS: True}
112112
)
113113
floating = attr.ib(
114-
factory=list, type=typing.List[Region], metadata={JsonInclude.NON_NONE: True}
114+
factory=list, type=typing.List[Region], metadata={JsonInclude.THIS: True}
115115
)
116116

117117

eyes_common/applitools/common/test_results.py

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@
99
from .match import ImageMatchSettings
1010

1111
if typing.TYPE_CHECKING:
12-
from typing import Text, Any, Dict, Optional
12+
from typing import Text, Any, Dict, Optional, List
1313

1414
# TODO: Implement objects
1515
SessionUrls = Dict[Any, Any]
1616
StepInfo = Dict[Any, Any]
1717

18-
__all__ = ("TestResults",)
18+
__all__ = ("TestResults", "TestResultSummary")
1919

2020

2121
class TestResultsStatus(Enum):
@@ -98,3 +98,30 @@ def __str__(self):
9898
origin_str = super(TestResults, self).__str__()
9999
preamble = "New test" if self.is_new else "Existing test"
100100
return "{} [{}]".format(preamble, origin_str)
101+
102+
103+
@attr.s
104+
class TestResultSummary(object):
105+
all_results = attr.ib() # type: List[TestResults]
106+
exceptions = attr.ib(default=0)
107+
108+
passed = attr.ib(init=False, default=0)
109+
unresolved = attr.ib(init=False, default=0)
110+
failed = attr.ib(init=False, default=0)
111+
mismatches = attr.ib(init=False, default=0)
112+
missing = attr.ib(init=False, default=0)
113+
matches = attr.ib(init=False, default=0)
114+
115+
def __attrs_post_init__(self):
116+
for result in self.all_results:
117+
if result is None:
118+
continue
119+
if result.is_failed:
120+
self.failed += 1
121+
elif result.is_passed:
122+
self.passed += 1
123+
elif result.is_unresolved:
124+
self.unresolved += 1
125+
self.matches += result.matches
126+
self.missing += result.missing
127+
self.mismatches += result.mismatches
Lines changed: 54 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,63 @@
1-
from .eyes_base import EyesBase # noqa
2-
from .fluent import * # noqa
3-
from .match_window_task import * # noqa
4-
from .positioning import ( # noqa: F401
1+
from .capture import (
2+
AppOutputProvider,
3+
AppOutputWithScreenshot,
4+
EyesScreenshotFactory,
5+
ImageProvider,
6+
)
7+
from .cut import FixedCutProvider, NullCutProvider, UnscaledFixedCutProvider
8+
from .eyes_base import EyesBase
9+
from .fluent import (
10+
CheckSettings,
11+
CheckSettingsValues,
12+
CheckTarget,
13+
FloatingRegionByRectangle,
14+
GetFloatingRegion,
15+
GetRegion,
16+
GetSelector,
17+
IgnoreRegionByRectangle,
18+
)
19+
from .match_window_task import MatchWindowTask
20+
from .positioning import (
521
NULL_REGION_PROVIDER,
622
InvalidPositionProvider,
723
NullRegionProvider,
824
PositionProvider,
925
RegionProvider,
1026
)
11-
from .scaling import * # noqa
12-
from .server_connector import ServerConnector # noqa
13-
from .triggers import * # noqa
27+
from .scaling import (
28+
ContextBasedScaleProvider,
29+
FixedScaleProvider,
30+
NullScaleProvider,
31+
ScaleProvider,
32+
)
33+
from .server_connector import ServerConnector
34+
from .triggers import MouseTrigger, TextTrigger
1435

1536
__all__ = (
16-
triggers.__all__ # noqa
17-
+ match_window_task.__all__ # noqa
18-
+ scaling.__all__ # noqa
19-
+ eyes_base.__all__ # noqa
20-
+ (
21-
"PositionProvider",
22-
"InvalidPositionProvider",
23-
"RegionProvider",
24-
"NullRegionProvider",
25-
"NULL_REGION_PROVIDER",
26-
)
27-
+ fluent.__all__ # noqa
28-
+ ("ServerConnector",) # noqa
37+
"TextTrigger",
38+
"MouseTrigger",
39+
"MatchWindowTask",
40+
"ContextBasedScaleProvider",
41+
"FixedScaleProvider",
42+
"NullScaleProvider",
43+
"ScaleProvider",
44+
"EyesBase",
45+
"PositionProvider",
46+
"InvalidPositionProvider",
47+
"RegionProvider",
48+
"NullRegionProvider",
49+
"NULL_REGION_PROVIDER",
50+
"CheckSettings",
51+
"CheckSettingsValues",
52+
"CheckTarget",
53+
"GetRegion",
54+
"GetFloatingRegion",
55+
"FloatingRegionByRectangle",
56+
"IgnoreRegionByRectangle",
57+
"GetSelector",
58+
"ServerConnector",
59+
"AppOutputWithScreenshot",
60+
"AppOutputProvider",
61+
"EyesScreenshotFactory",
62+
"ImageProvider",
2963
)
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "4.0.0"
1+
__version__ = "4.0.1"

eyes_core/applitools/core/capture.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,17 @@
88

99
if typing.TYPE_CHECKING:
1010
from typing import Optional
11-
from applitools.core.fluent import CheckSettings
11+
from applitools.core import CheckSettings
1212

1313
T = typing.TypeVar("T", bound=CheckSettings)
1414

15+
__all__ = (
16+
"AppOutputWithScreenshot",
17+
"AppOutputProvider",
18+
"EyesScreenshotFactory",
19+
"ImageProvider",
20+
)
21+
1522

1623
@attr.s
1724
class AppOutputWithScreenshot(object):

eyes_core/applitools/core/cut.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
from applitools.common import Region
77
from applitools.common.utils import ABC, image_utils
88

9+
__all__ = ("FixedCutProvider", "UnscaledFixedCutProvider", "NullCutProvider")
10+
911

1012
@attr.s
1113
class CutProvider(ABC):

0 commit comments

Comments
 (0)