eyes_core 6.7.1 → 6.7.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9e8270b52cdd58ec5d01252e085200ba62f8c9b9c056cfb6a5f217f58003f2a5
4
- data.tar.gz: 8f01ec47b288f64c84aad4d7684d691a52376fc635014e059ecab49b3dec76ce
3
+ metadata.gz: e6af30db71471bb3da822c2a0088d5b8cb60f6a7810e812b3586a5a5c2be4ed2
4
+ data.tar.gz: c7805e2b0749179bc418119253568d2982181b25807f03627c18a6d905162111
5
5
  SHA512:
6
- metadata.gz: d78fa4f0fc03842d096f0af4fb7cca76b4416176fd0cdb84b30d34ef90d9bef40c839a8093197a0f111ac1e8ae1a6764df697b09850350824b5e40cd819e7f55
7
- data.tar.gz: 9cd38ffa78203fdfb4615259a3d426f30bf8178f112e5c56d6f992d23be14cad0bdc6d5d9fca7ff840e5ef54fcad8e05e249161f2a619bf6e7b57e126b61c3f2
6
+ metadata.gz: 236951c25c7347f813862b6acad69e8ef905cc80acffe53c16789e2d79082059063d111988ba5d84549ef5cf733000d0857c39b06a2f2dbe04489caefe9d1eed
7
+ data.tar.gz: 6cf0d540fa2b61fbd318a6ee52ba02e86533d09e4ea9c76fbbf8bd047bc5d94ef06e947899f77b625e2c80e8e6203a9a2e5d2590a8b19f6a94c65d672b6461fc
data/CHANGELOG.md CHANGED
@@ -1,5 +1,83 @@
1
1
  # Changelog
2
2
 
3
+ ## [6.7.2](https://github.com/Applitools-Dev/sdk/compare/ruby/eyes_core@6.7.1...ruby/eyes_core@6.7.2) (2025-06-15)
4
+
5
+
6
+ ### Dependencies
7
+
8
+ * @applitools/dom-snapshot bumped to 4.11.22
9
+ #### Bug Fixes
10
+
11
+ * css media query group conditions | FLD-3151 ([#3023](https://github.com/Applitools-Dev/sdk/issues/3023)) ([56ec107](https://github.com/Applitools-Dev/sdk/commit/56ec107bcda6a5a330d19c278267d73de5d86d8b))
12
+
13
+
14
+
15
+ * @applitools/nml-client bumped to 1.9.5
16
+ #### Bug Fixes
17
+
18
+ * nml-client depends on core-base ([#2995](https://github.com/Applitools-Dev/sdk/issues/2995)) ([1f7cf69](https://github.com/Applitools-Dev/sdk/commit/1f7cf6930709a40a498dd1f525132648aa593af0))
19
+
20
+
21
+
22
+ * @applitools/tunnel-client bumped to 1.8.0
23
+ #### Features
24
+
25
+ * update build script to include individual zip creation ([#3008](https://github.com/Applitools-Dev/sdk/issues/3008)) ([46a0cfc](https://github.com/Applitools-Dev/sdk/commit/46a0cfcc472ab69384560095d90a7fa58b4b9186))
26
+
27
+
28
+
29
+ * @applitools/ufg-client bumped to 1.16.12
30
+ #### Bug Fixes
31
+
32
+ * remove safari-early-access browser version for js sdks | AD-10226 ([#3034](https://github.com/Applitools-Dev/sdk/issues/3034)) ([7ca09f5](https://github.com/Applitools-Dev/sdk/commit/7ca09f5c0c271570142058ea766533b86434dc2e))
33
+
34
+
35
+
36
+ * @applitools/core bumped to 4.40.0
37
+ #### Features
38
+
39
+ * update build script to include individual zip creation ([#3008](https://github.com/Applitools-Dev/sdk/issues/3008)) ([46a0cfc](https://github.com/Applitools-Dev/sdk/commit/46a0cfcc472ab69384560095d90a7fa58b4b9186))
40
+
41
+
42
+ #### Bug Fixes
43
+
44
+ * css media query group conditions | FLD-3151 ([#3023](https://github.com/Applitools-Dev/sdk/issues/3023)) ([56ec107](https://github.com/Applitools-Dev/sdk/commit/56ec107bcda6a5a330d19c278267d73de5d86d8b))
45
+ * export issues for ts js with legacy solution ([#3016](https://github.com/Applitools-Dev/sdk/issues/3016)) ([a3a9daf](https://github.com/Applitools-Dev/sdk/commit/a3a9daf9c3361bb1f253499c1335a1434ec520d1))
46
+ * extractLatestCommitInfo | FLD-3217 ([#3039](https://github.com/Applitools-Dev/sdk/issues/3039)) ([3f72a23](https://github.com/Applitools-Dev/sdk/commit/3f72a230fa0166046ea85ae004cfb544de86e628))
47
+ * handle error when sending started message in tunnel manager server ([#3019](https://github.com/Applitools-Dev/sdk/issues/3019)) ([2cdaad8](https://github.com/Applitools-Dev/sdk/commit/2cdaad896fd679187449b69abe529b006f6255ee))
48
+
49
+
50
+
51
+ * @applitools/req bumped to 1.7.13
52
+
53
+ * @applitools/dom-capture bumped to 11.5.6
54
+
55
+ * @applitools/spec-driver-webdriver bumped to 1.2.6
56
+
57
+ * @applitools/screenshoter bumped to 3.11.5
58
+
59
+ * @applitools/core-base bumped to 1.25.4
60
+ #### Bug Fixes
61
+
62
+ * Differentiate Between Invalid and Missing API Key Errors ([6ac17d4](https://github.com/Applitools-Dev/sdk/commit/6ac17d40d7aff45b3de5c949dc7d4673b9739bfd))
63
+ * export issues for ts js with legacy solution ([#3016](https://github.com/Applitools-Dev/sdk/issues/3016)) ([a3a9daf](https://github.com/Applitools-Dev/sdk/commit/a3a9daf9c3361bb1f253499c1335a1434ec520d1))
64
+
65
+
66
+
67
+ * @applitools/ec-client bumped to 1.10.15
68
+
69
+ * @applitools/test-server bumped to 1.2.3
70
+ #### Bug Fixes
71
+
72
+ * basic auth protected resources | FLD-2761 | FMRI-120 ([#2444](https://github.com/Applitools-Dev/sdk/issues/2444)) ([b48cf49](https://github.com/Applitools-Dev/sdk/commit/b48cf49dec50bbf1ed2ba111608a48cf09962565))
73
+ * export issues for ts js with legacy solution ([#3016](https://github.com/Applitools-Dev/sdk/issues/3016)) ([a3a9daf](https://github.com/Applitools-Dev/sdk/commit/a3a9daf9c3361bb1f253499c1335a1434ec520d1))
74
+ * storybook navigation timeouts ([#2701](https://github.com/Applitools-Dev/sdk/issues/2701)) ([64e3a40](https://github.com/Applitools-Dev/sdk/commit/64e3a40a524ae76ec457ae9c2d1170fbaea5e982))
75
+
76
+
77
+
78
+ * eyes_universal bumped to 4.40.0
79
+
80
+
3
81
  ## [6.7.1](https://github.com/Applitools-Dev/sdk/compare/ruby/eyes_core@6.7.0...ruby/eyes_core@6.7.1) (2025-05-22)
4
82
 
5
83
 
data/LICENSE ADDED
@@ -0,0 +1,26 @@
1
+ - -
2
+ SDK LICENSE AGREEMENT
3
+ IMPORTANT - PLEASE READ CAREFULLY THE TERMS OF THIS LICENSE AGREEMENT ("AGREEMENT"). BY INSTALLING, ACCESSING AND/OR USING THE SOFTWARE (AS DEFINED BELOW), YOU EXPRESSLY ACKNOWLEDGE AND AGREE THAT YOU, OR THE COMPANY YOU REPRESENT, ("YOU" OR "LICENSEE") ARE ENTERING INTO A LEGAL AGREEMENT WITH APPLITOOLS LTD. AND ITS AFFILIATES ("APPLITOOLS"), AND HAVE UNDERSTOOD AND AGREE TO COMPLY WITH, AND BE LEGALLY BOUND BY, THE TERMS AND CONDITIONS OF THIS AGREEMENT. YOU HEREBY WAIVE ANY RIGHTS OR REQUIREMENTS UNDER ANY LAWS OR REGULATIONS IN ANY JURISDICTION WHICH REQUIRE AN ORIGINAL (NON-ELECTRONIC) SIGNATURE OR DELIVERY OR RETENTION OF NON-ELECTRONIC RECORDS, TO THE EXTENT PERMITTED UNDER APPLICABLE LAW.
4
+ THE SOFTWARE MAY BE USED SOLELY FOR YOUR PERSONAL, NON-COMMERCIAL PURPOSES. FOR COMMERCIAL PURPOSES PLEASE CONTACT THE REGIONAL APPLITOOLS BUSINESS REPRESENTATIVE.
5
+ 1. Definitions. For purposes of this Agreement, the following capitalized terms shall have the following meaning:
6
+ 1. "Documentation" means the user's guides and technical manuals delivered by Applitools to Licensee.
7
+ 2. "Feedback" means suggestions, comments or feedback (whether orally or in writing) with respect to the Software.
8
+ 3. "Intellectual Property Rights" means all intangible legal rights, titles and interests evidenced by or embodied in all: (i) inventions (regardless of patentability and whether or not reduced to practice), improvements thereto, patents, patent applications, patent disclosures, together with all reissuances, continuations, continuations in part, revisions, extensions and reexaminations thereof; (ii) trademarks, service marks, trade dress, logos, trade names, corporate names, together with translations, adaptations, derivations and combinations thereof, including goodwill associated therewith, and applications, registrations, and renewals in connection therewith; (iii) any work of authorship, regardless of copyrightable, copyrightable works, copyrights (including moral rights), and applications, registrations and renewals in connection therewith; (iv) mask works and applications, registrations and renewals in connection therewith; (v) trade secrets and Confidential Information; and (vi) other proprietary rights and any other similar rights, in each case on a worldwide basis, and copies and tangible embodiments thereof, in whatever form or medium.
9
+ 4. "License" means the right to use the Software pursuant to Section ‎2.1 to this Agreement.
10
+ 5. "Software" means Applitools' software development kit software in object or source code version, Documentation and any updates and upgrade thereto (to the extent delivered).
11
+ 1. License
12
+ 1. Grant of License. Subject to the terms and conditions of this Agreement, Applitools grants You, during the Term, a personal, non-exclusive, non-sublicensable, non-transferable, revocable license to: (i) use the Software solely for Your own personal (non-commercial) use and (ii) use and display Applitools' Marks solely for the purpose of publicizing or advertising that You are using the Software.
13
+ 2. Documentation. Applitools may make available Documentation to Licensee for Licensee to use solely in connection with Licensee's use of the Software during the term of this Agreement. Licensee may print or copy the Documentation as needed for its own purposes provided that all copyright notices are included therein. The Documentation shall be considered the Confidential Information of Applitools.
14
+ 1. Reservation of Rights; Use Restrictions. Other than the rights explicitly granted in this Agreement, Licensee shall have no other rights, express or implied, in the Software. Without limiting the generality of the foregoing, Licensee agrees and undertakes not to: (i) allow any third party to use the Software in any manner, including but not limited to, sell, lease, sublicense or distribute the Software, or any part thereof; (ii) modify, revise, or alter the Software or reverse engineer, decompile, disassemble or otherwise reduce to human-perceivable form the Software's source code; (iii) copy or allow copies of the Software to be made; (iv) remove, alter or obscure any proprietary notice or identification, including copyright, trademark, patent or other notices, contained in or displayed on or via the Software; (v) use the Software to violate any applicable laws, rules or regulations, or for any unlawful, harmful, irresponsible, or inappropriate purpose, or in any manner that breaches this Agreement, and/or (vi) represent that it possesses any proprietary interest in the Software.
15
+ 1. Third Party Software. Licensee acknowledges and agrees that any third party software ("Third Party Software") that provided with the Software is provided under the terms of the license attached/linked thereto or, if no such license is attached, such Third Party Software is provided for free and on "AS IS" basis. Applitools is not liable for any losses or damages which may occur resulting from the use of any Third Party Software. Applitools does not possess any proprietary interest in such Third Party Software.
16
+ 1. Open Source Licenses. The Software includes certain open source code software and materials (as shall be listed in the documentation of the Software) ("Open Source Software") that are subject to their respective open source licenses ("Open Source Licenses"). Such Open Source Licenses contain a list of conditions with respect to warranty, copyright policy and other provisions. By executing this Agreement, Licensee undertakes to strictly comply with the terms and condition of the Open Source Licenses, as may be amended from time to time. In order to comply with the Open Source Licenses, Licensee shall read the respective licenses or notices, such list of Open Source Licenses may be amended from time to time by Applitools, at its sole discretion. In the event of any inconsistencies or conflicting provisions between the provisions of the Open Source Licenses and the provisions of this Agreement, the provisions of the Open Source Licenses shall prevail. Without derogating from the generality of the foregoing, it is clarified that any Open Source Software is provided on an "AS IS" basis, without indemnity or warranty of any kind, whether express or implied. For clarity, the representations and warranties set forth in Section ‎4 hereunder shall not apply to any Open Source Software.
17
+ 1. Title & Ownership. APPLITOOLS DOES NOT SELL OR TRANSFER TITLE IN THE SOFTWARE, OR ANY PART THEREOF, TO LICENSEE. The Documentation, Software (excluding any Open Source Software and Third Party Software therein which are owned by their respective licensors) and/or any copies thereof, including without limitation any derivative works made (regardless of whether such derivative works were made and/or developed pursuant to the request and/or specifications of Licensee, and irrespective of any support and/or assistance Applitools may, will or had received from Licensee, or any third party on its behalf, with respect thereto), as well as any updates or upgrades thereto, if provided to Applitools pursuant to this Agreement, shall remain Applitools' sole and exclusive property. All Intellectual Property Rights evidenced by or embodied in and/or attached/connected/related to the Software, or part thereof, are and shall be owned solely and exclusively by Applitools. Nothing in this Agreement shall constitute a waiver of Applitools' Intellectual Property Rights under any law, or be in any way construed or interpreted as such. It is further agreed that to the extent Licensee provides Applitools with Feedback, Licensee acknowledges that any and all rights, including Intellectual Property Rights in such Feedback shall belong exclusively to Applitools and Licensee hereby irrevocably and unconditionally transfers and assigns to Applitools all intellectual property rights in such Feedback and waives any and all moral rights that Licensee may have in respect thereto. It is further understood that use of Feedback, if any, may be made by Applitools at its sole discretion, and that Applitools in no way shall be obliged to make use of any kind of the Feedback or part thereof.
18
+ 1. Warranty. Applitools warrants that to its knowledge it has the right to grant the license under this Agreement. Applitools' sole liability for any breach of this warranty or any other warranty under this Agreement shall be, at Applitools' sole discretion: (i) to replace or repair the Software or the applicable portion thereof; or (ii) to terminate this Agreement.
19
+ 2. Warranty Exclusions. The warranties set forth in Section ‎4 are contingent upon Licensee's proper use of the Software, and shall not apply to damage caused by abuse, misuse, alteration, neglect or unauthorized repair or installation, or by the use or attempted use of Software other than that supplied and supported by Applitools. Applitools will use reasonable commercial efforts to repair or replace the Software or the applicable portion thereof, pursuant to the foregoing warranty within thirty (30) days of being so notified.
20
+ 1. Warranty Disclaimers. AS BETWEEN LICENSEE AND APPLITOOLS, EXCEPT AS SET IN SECTION ‎4, THE SOFTWARE IS PROVIDED ON AN "AS IS" AND "AS AVAILABLE" BASIS WITHOUT WARRANTIES OF ANY KIND INCLUDING, WITHOUT LIMITATION, REPRESENTATIONS, WARRANTIES AND CONDITIONS OF MERCHANTABILITY, FITNESS FOR INTENDED OR PARTICULAR PURPOSE, TITLE, NON-INFRINGEMENT, THAT THE SOFTWARE WILL MEET LICENSEE'S REQUIREMENTS OR EXPECTATIONS OR WILL ACHIEVE ANY SPECIFIC RESULTS AND THOSE ARISING BY STATUTE OR FROM A COURSE OF DEALING OR USAGE OF TRADE. Applicable law may not allow the exclusion of certain warranties, so to that extent such exclusions may not apply.
21
+ 1. High Risk Activities. You acknowledge that the Software is not fault tolerant and is not designed, manufactured, or intended for use or resale as on-line control equipment in hazardous or high risk environments and activities requiring fail-safe performance (such as in the operation of nuclear facilities, aircraft navigation or communication systems, air traffic control, direct life support machines and/or devices, or weapons systems) in which the failure of the Software could lead directly to death, personal injury, or severe physical or environmental damage, and You agree not to use or allow the use of the Software or any portion thereof for, or in connection with, any such environment or activity.
22
+ 1. Indemnify. You agree that Applitools shall have no liability whatsoever for any use made of the Software by You or any third party. You hereby agree to defend, indemnify and hold harmless Applitools and its affiliates and their respective officers, directors, agents and employees from any and all claims, damages, liabilities, costs, and expenses (including attorney's fees) arising from claims related to Your use of the Software as well as from Your failure to comply with this Agreement.
23
+ 1. Limitation of Liability. UNDER NO CIRCUMSTANCES SHALL APPLITOOLS AND/OR ITS AFFILIATES BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL, PUNITIVE OR CONSEQUENTIAL DAMAGES, OR FOR ANY LOSS OF DATA, REVENUE, BUSINESS OR REPUTATION, THAT ARISES UNDER OR IN CONNECTION WITH THIS AGREEMENT, OR THAT RESULTS FROM THE USE OF, OR THE INABILITY TO USE, THE SOFTWARE. APPLITOOLS'S TOTAL AGGREGATE LIABILITY FOR ANY AND ALL DIRECT DAMAGES AND LOSSES THAT ARISE UNDER OR IN CONNECTION WITH THIS AGREEMENT SHALL NOT IN ANY CIRCUMSTANCE EXCEED THE AMOUNT OF 100.00 (ONE HUNDRED) UNITED STATES DOLLARS. THE FOREGOING LIMITATIONS AND EXCLUSIONS IN THIS SECTION ‎7 SHALL APPLY: (I) EVEN IF APPLITOOLS HAS BEEN ADVISED OF THE POSSIBILITY OF ANY DAMAGES OR LOSSES; (II) EVEN IF ANY REMEDY SET FORTH HEREIN FAILS OF ITS ESSENTIAL PURPOSE; AND (III) REGARDLESS OF THE BASIS OR THEORY OF LIABILITY.
24
+ 1. Export Laws. Licensee agrees to comply fully with all U.S., EU, Israeli, and all applicable export laws and regulations to ensure that neither the Software nor any technical data related thereto are exported or re-exported directly or indirectly in violation of, or used for any purposes prohibited by, such laws and regulations. For clarity, and without derogating from Section ‎11 below, in case of any change of any applicable law, policy or regulation, which might affect Applitools' business, Applitools will have the right to terminate this Agreement and the license granted hereunder and the Licensee shall have no claims regarding such termination.
25
+ 1. Term and Termination. This Agreement shall continue until terminated as set forth in this section (the "Term"). You may terminate this Agreement at any time by removing the Software from Your system and destroying all copies of the Software and Documentation relating to the Software. Unauthorized copying of the Software or otherwise failing to comply with this Agreement will result in automatic immediate termination of this Agreement and will make available to Applitools legal remedies. Applitools reserves the right to terminate this Agreement and the License at any time and without notice. Upon termination of this Agreement, the License will terminate and You: (i) will cease any and all rights to use the Software, and (ii) will remove the Software from all hard drives, networks and other storage media and destroy all copies of the Software in your possession or under your control. The provisions of Sections ‎2.3, ‎2.4, ‎2.5, ‎6, ‎7, ‎8, ‎9, 10, ‎11 and ‎12 shall survive the termination, expiration or other ending of this Agreement.
26
+ 1. Miscellaneous. This Agreement represents the complete agreement concerning the Software between You and Applitools and supersedes all prior agreements and representations between You and Applitools. If any provision of this Agreement is held to be unenforceable for any reason, such provision shall be reformed only to the extent necessary to make it enforceable. Any waiver of any provision of this Agreement will be effective only if in writing and signed by Applitools. This Agreement is personal to You and may not be assigned or transferred for any reason whatsoever without the consent of Applitools and any action or conduct in violation of the foregoing shall be void and without effect. Applitools expressly reserves the right to assign this Agreement and to delegate any of its obligations hereunder. This Agreement are governed by and construed under the laws of the State of Israel, excluding its conflicts of law rules. You expressly agree that the exclusive jurisdiction for any claim or action arising out of or relating to this Agreement shall be the courts located in Tel Aviv, Israel, and You further agree and submit to the exercise of personal jurisdiction of such courts for the purpose of litigating any such claim or action. In any action or proceeding to enforce rights under this Agreement, the prevailing party shall be entitled to recover costs and attorneys' fees.
data/README.md ADDED
@@ -0,0 +1,402 @@
1
+ # Applitools Eyes Core SDK
2
+
3
+ [![Gem Version](https://badge.fury.io/rb/eyes_core.svg)](https://badge.fury.io/rb/eyes_core)
4
+
5
+ The `eyes_core` gem is the foundation of the Applitools Eyes Ruby SDK ecosystem. It provides the core functionality, base classes, and utilities that power all specialized Applitools SDKs for Ruby.
6
+
7
+ ## Table of Contents
8
+
9
+ 1. [Overview](#overview)
10
+ 2. [Installation](#installation)
11
+ 3. [Core Components](#core-components)
12
+ - [EyesBase](#eyesbase)
13
+ - [Configuration](#configuration)
14
+ - [Viewport Size](#viewport-size)
15
+ - [Batch Info](#batch-info)
16
+ - [Region](#region)
17
+ - [Match Settings](#match-settings)
18
+ 4. [Universal SDK Integration](#universal-sdk-integration)
19
+ 5. [Error Handling](#error-handling)
20
+ 6. [Advanced Features](#advanced-features)
21
+ - [Accessibility Testing](#accessibility-testing)
22
+ - [Layout Breakpoints](#layout-breakpoints)
23
+ - [Proxy Configuration](#proxy-configuration)
24
+ 7. [Best Practices](#best-practices)
25
+ 8. [Troubleshooting](#troubleshooting)
26
+ 9. [FAQ](#faq)
27
+
28
+ ## Overview
29
+
30
+ The `eyes_core` gem serves as the foundation for all Applitools Ruby SDKs. While not intended for direct use, it provides essential functionality that enables visual testing across different platforms and frameworks.
31
+
32
+ ### Core Capabilities
33
+
34
+ - **Configuration Management**: Centralized settings for all Eyes operations
35
+ - **Server Communication**: Handles API interactions with Applitools services
36
+ - **Data Structures**: Common models for regions, batches, and test results
37
+ - **Visual Validation Primitives**: Base implementation for visual comparisons
38
+ - **Universal SDK Integration**: Connects to the cross-platform Universal SDK
39
+ - **Utility Functions**: Shared helpers for geometry, image processing, and more
40
+
41
+ ## Installation
42
+
43
+ The `eyes_core` gem is automatically installed as a dependency when you install any of the specific Eyes SDK implementations. You typically don't need to install it directly.
44
+
45
+ ```ruby
46
+ # Installing a specific SDK automatically includes eyes_core
47
+ gem install eyes_selenium
48
+ gem install eyes_images
49
+ gem install eyes_capybara
50
+ gem install eyes_appium
51
+
52
+ # Or add to your Gemfile
53
+ gem 'eyes_selenium' # This will include eyes_core as a dependency
54
+ ```
55
+
56
+ > **Note**: Direct installation of `eyes_core` is only needed if you're building a custom integration or extending the SDK functionality.
57
+
58
+ ## Core Components
59
+
60
+ ### EyesBase
61
+
62
+ The `EyesBase` class is the foundation of all Eyes SDK implementations. It provides the core functionality for:
63
+
64
+ - Opening and closing tests
65
+ - Performing visual validations
66
+ - Managing test configurations
67
+ - Communicating with the Applitools server
68
+
69
+ Key methods include:
70
+
71
+ ```ruby
72
+ # Opening a test
73
+ open_base(options = {})
74
+
75
+ # Core validation method (used by specific implementations)
76
+ check_window_base(region_provider, retry_timeout, match_window_data)
77
+
78
+ # Closing a test and getting results
79
+ close(throw_exception = true, be_silent = false)
80
+
81
+ # Aborting a test
82
+ abort_if_not_closed
83
+ ```
84
+
85
+ ### Configuration
86
+
87
+ The `EyesBaseConfiguration` class manages all test settings. Key configurations include:
88
+
89
+ ```ruby
90
+ # Basic test information
91
+ config.app_name = "My Application"
92
+ config.test_name = "My Test"
93
+ config.viewport_size = Applitools::RectangleSize.new(1024, 768)
94
+
95
+ # Authentication
96
+ config.api_key = "YOUR_API_KEY"
97
+ config.server_url = "https://eyesapi.applitools.com" # Default server
98
+
99
+ # Test organization
100
+ config.batch = Applitools::BatchInfo.new("My Batch")
101
+ config.branch_name = "feature/branch"
102
+ config.parent_branch_name = "master"
103
+
104
+ # Match settings
105
+ config.match_level = Applitools::MatchLevel::STRICT
106
+ config.match_timeout = 5 # seconds
107
+ config.ignore_caret = true
108
+ config.ignore_displacements = false
109
+
110
+ # Advanced features
111
+ config.accessibility_validation = Applitools::AccessibilitySettings.new(
112
+ level: Applitools::AccessibilityLevel::AA,
113
+ guidelines_version: Applitools::AccessibilityGuidelinesVersion::WCAG_2_0
114
+ )
115
+ ```
116
+
117
+ The configuration system supports environment variables:
118
+ - `APPLITOOLS_API_KEY` - Your API key
119
+ - `APPLITOOLS_SERVER_URL` - The Applitools server URL
120
+ - `APPLITOOLS_BRANCH` - Branch name for the test
121
+ - `APPLITOOLS_PARENT_BRANCH` - Parent branch for baseline comparison
122
+ - `APPLITOOLS_BASELINE_BRANCH` - Specific branch to use as baseline
123
+
124
+ ### Viewport Size
125
+
126
+ The viewport size is defined using the `RectangleSize` class:
127
+
128
+ ```ruby
129
+ viewport_size = Applitools::RectangleSize.new(width, height)
130
+ ```
131
+
132
+ This class provides methods for manipulating and comparing sizes:
133
+
134
+ ```ruby
135
+ size.width # Get width
136
+ size.height # Get height
137
+ size.empty? # Check if width or height is zero
138
+ size.to_hash # Convert to a hash: {width: w, height: h}
139
+ ```
140
+
141
+ ### Batch Info
142
+
143
+ The `BatchInfo` class groups test results for easier management:
144
+
145
+ ```ruby
146
+ batch = Applitools::BatchInfo.new("My Batch Name")
147
+ batch.id = "unique-batch-id" # Optional, auto-generated if not provided
148
+ batch.started_at = Time.now # Optional, defaults to now
149
+ ```
150
+
151
+ Batches with the same name and ID are grouped together in the Applitools dashboard.
152
+
153
+ ### Region
154
+
155
+ The `Region` class represents a rectangular area for operations like:
156
+ - Check specific parts of a page
157
+ - Define ignore regions
158
+ - Specify areas for accessibility checks
159
+
160
+ ```ruby
161
+ region = Applitools::Region.new(left, top, width, height)
162
+
163
+ # Operations
164
+ region.contains?(location) # Check if a point is inside the region
165
+ region.intersect(other_region) # Get intersection of two regions
166
+ region.empty? # Check if the region has zero area
167
+ ```
168
+
169
+ ### Match Settings
170
+
171
+ The `ImageMatchSettings` class controls how visual comparisons work:
172
+
173
+ ```ruby
174
+ settings = Applitools::ImageMatchSettings.new
175
+ settings.match_level = Applitools::MatchLevel::STRICT
176
+ settings.ignore_caret = true
177
+ settings.ignore_displacements = false
178
+ ```
179
+
180
+ Match levels include:
181
+ - `NONE` - No comparison (screenshot only)
182
+ - `LAYOUT` - Compare layout structure
183
+ - `CONTENT` - Compare textual content
184
+ - `STRICT` - Compare visually with some tolerance (default)
185
+ - `EXACT` - Pixel-perfect comparison
186
+
187
+ ## Universal SDK Integration
188
+
189
+ The `eyes_core` gem integrates with the cross-language Universal SDK through several components:
190
+
191
+ - `UniversalEyes` - Manages the session lifecycle and visual checks
192
+ - `UniversalClient` - Handles communication with the Universal SDK
193
+ - `UniversalCheckSettings` - Configures check operations
194
+ - `UniversalServerControl` - Manages the Universal SDK process
195
+
196
+ This integration provides:
197
+ - Consistent behavior across language SDKs
198
+ - Improved performance and reliability
199
+ - Access to advanced features
200
+
201
+ ```ruby
202
+ # The UniversalEyes class provides methods like:
203
+ universal_eyes.check(check_settings, image_target)
204
+ universal_eyes.close
205
+ universal_eyes.abort
206
+ ```
207
+
208
+
209
+ ## Error Handling
210
+
211
+ The SDK defines several error classes:
212
+
213
+ - `EyesError` - Base class for all errors
214
+ - `TestFailedError` - Test did not match the baseline
215
+ - `DiffsFoundError` - Differences found during comparison
216
+ - `NewTestError` - First run of a test with no baseline
217
+
218
+ ```ruby
219
+ begin
220
+ # Eyes operations
221
+ eyes.close
222
+ rescue Applitools::NewTestError => e
223
+ puts "New test (no baseline): #{e.message}"
224
+ puts "See results at: #{e.test_results.url}"
225
+ rescue Applitools::DiffsFoundError => e
226
+ puts "Found differences: #{e.message}"
227
+ puts "See results at: #{e.test_results.url}"
228
+ rescue Applitools::TestFailedError => e
229
+ puts "Test failed: #{e.message}"
230
+ rescue Applitools::EyesError => e
231
+ puts "Eyes error: #{e.message}"
232
+ end
233
+ ```
234
+
235
+ ## Advanced Features
236
+
237
+ ### Accessibility Testing
238
+
239
+ The SDK supports automated accessibility testing:
240
+
241
+ ```ruby
242
+ # Configure accessibility testing
243
+ config.accessibility_validation = Applitools::AccessibilitySettings.new(
244
+ level: Applitools::AccessibilityLevel::AA,
245
+ guidelines_version: Applitools::AccessibilityGuidelinesVersion::WCAG_2_1
246
+ )
247
+
248
+ # Add specific regions for accessibility checks
249
+ check_settings.accessibility_region(
250
+ region,
251
+ Applitools::AccessibilityRegionType::REGULAR_TEXT
252
+ )
253
+ ```
254
+
255
+ Accessibility levels:
256
+ - `AA` - WCAG AA standard
257
+ - `AAA` - WCAG AAA standard
258
+
259
+ Guidelines versions:
260
+ - `WCAG_2_0` - Web Content Accessibility Guidelines 2.0
261
+ - `WCAG_2_1` - Web Content Accessibility Guidelines 2.1
262
+
263
+ ### Layout Breakpoints
264
+
265
+ The SDK supports responsive design testing with layout breakpoints:
266
+
267
+ ```ruby
268
+ # Enable automatic breakpoints
269
+ config.layout_breakpoints = true
270
+
271
+ # Specify exact breakpoint widths (in pixels)
272
+ config.layout_breakpoints = [768, 1024, 1440]
273
+
274
+ # Advanced configuration
275
+ config.layout_breakpoints(
276
+ [768, 1024, 1440], # Width breakpoints
277
+ reload: true, # Reload page at each breakpoint
278
+ height_breakpoints: [600, 900] # Height breakpoints
279
+ )
280
+ ```
281
+
282
+ ### Proxy Configuration
283
+
284
+ For environments that require a proxy to access the internet:
285
+
286
+ ```ruby
287
+ # Basic proxy configuration
288
+ config.proxy = Applitools::Connectivity::Proxy.new('http://proxy-address:port')
289
+
290
+ # Proxy with authentication
291
+ config.proxy = Applitools::Connectivity::Proxy.new(
292
+ 'http://proxy-address:port',
293
+ 'username',
294
+ 'password'
295
+ )
296
+
297
+ # Alternative syntax
298
+ config.set_proxy('http://proxy-address:port', 'username', 'password')
299
+ ```
300
+
301
+ ## Best Practices
302
+
303
+ 1. **Configuration Management**
304
+ - Create a base configuration that's shared across tests
305
+ - Override specific settings for individual tests as needed
306
+ - Use environment variables for deployment-specific settings
307
+
308
+ 2. **Batch Organization**
309
+ - Group related tests in the same batch
310
+ - Use descriptive batch names
311
+ - Consider using consistent batch IDs for CI/CD pipelines
312
+
313
+ 3. **Error Handling**
314
+ - Always wrap Eyes operations in try/catch blocks
315
+ - Handle different error types appropriately
316
+ - Decide on a strategy for handling new tests vs. failing tests
317
+
318
+ 4. **Resource Management**
319
+ - Always call `close` or `abort_if_not_closed` to release resources
320
+ - Use `abort_if_not_closed` in ensure blocks to prevent resource leaks
321
+
322
+ 5. **Performance Optimization**
323
+ - Only check what's necessary (specific regions when possible)
324
+ - Use the appropriate match level for each test
325
+ - Leverage batching to improve efficiency
326
+
327
+ ## Troubleshooting
328
+
329
+ ### Common Issues
330
+
331
+ 1. **API Key Errors**
332
+ - Ensure your API key is set correctly
333
+ - Check environment variables are properly configured
334
+ - Verify the API key has permissions for the server you're using
335
+
336
+ 2. **Connection Issues**
337
+ - Check network connectivity to Applitools servers
338
+ - Verify proxy settings if applicable
339
+ - Check server URL if using a private cloud
340
+
341
+ 3. **Match Level Problems**
342
+ - If getting too many false differences, consider using a less strict match level
343
+ - If missing important differences, use a stricter match level
344
+
345
+ 4. **Performance Issues**
346
+ - Large or complex pages may have slower performance
347
+ - Consider checking specific regions instead of full page
348
+ - Optimize match timeout settings
349
+
350
+
351
+ ### Logging
352
+
353
+ The SDK provides built-in logging:
354
+
355
+ ```ruby
356
+ # Set log level
357
+ Applitools::EyesLogger.log_handler = Logger.new(STDOUT)
358
+ Applitools::EyesLogger.log_handler.level = Logger::DEBUG
359
+ ```
360
+
361
+ Log levels:
362
+ - `DEBUG` - Very verbose for troubleshooting
363
+ - `INFO` - Normal operations (default)
364
+ - `WARN` - Potential issues
365
+ - `ERROR` - Operation failures
366
+
367
+ ## FAQ
368
+
369
+ ### Q: Is `eyes_core` meant to be used directly?
370
+ A: No, the `eyes_core` gem provides core functionality for other Eyes SDK implementations like `eyes_selenium` or `eyes_images`. You should use those specific implementations instead.
371
+
372
+ ### Q: How do I set my API key?
373
+ A: You can set your API key in any of these ways:
374
+ - Via environment variable: `ENV['APPLITOOLS_API_KEY']='your_api_key'`
375
+ - In your code: `config.api_key = 'your_api_key'`
376
+ - In your configuration file (if applicable to your test framework)
377
+
378
+ ### Q: How do match levels affect visual testing?
379
+ A: Match levels determine how strictly Eyes compares screenshots:
380
+ - `EXACT`: Pixel-perfect matching (very strict)
381
+ - `STRICT`: Default level, allows small differences
382
+ - `CONTENT`: More lenient, focuses on content matching
383
+ - `LAYOUT`: Most lenient, only checks layout structure
384
+
385
+ ### Q: What's the difference between `close` and `abort_if_not_closed`?
386
+ A: `close` completes the test and reports results to the Applitools dashboard, while `abort_if_not_closed` terminates the test without reporting results. Use `abort_if_not_closed` in exception handling.
387
+
388
+ ### Q: How do I handle tests with no baseline?
389
+ A: When running a test for the first time with no baseline, it will raise a `NewTestError`. You can:
390
+ 1. Catch this error and handle it (e.g., approve it automatically in certain environments)
391
+ 2. Pass `false` to the `throw_exception` parameter of `close` to prevent the exception
392
+ 3. Use `save_new_tests = true` in your configuration (default) to save new tests as baselines
393
+
394
+
395
+ ### Q: Can I use eyes_core with non-web applications?
396
+ A: Yes, through specialized SDKs like `eyes_images` for image comparison or `eyes_appium` for mobile testing, which build on the core functionality provided by `eyes_core`.
397
+
398
+ ## License
399
+
400
+ This SDK is distributed under the Applitools SDK License Agreement. See the [LICENSE](LICENSE) file for more details.
401
+
402
+ **Important:** This SDK may be used solely for your personal, non-commercial purposes. For commercial use, please contact your Applitools representative or visit [applitools.com](https://applitools.com) to obtain a commercial license.
data/eyes_core.gemspec CHANGED
@@ -14,11 +14,13 @@ Gem::Specification.new do |spec|
14
14
  spec.description = "Don't use it directly, take a look at eyes_selenium, eyes_images or eyes_calabash gems instead."
15
15
  spec.summary = 'Core of the Applitools Ruby SDK'
16
16
  spec.homepage = 'https://www.applitools.com'
17
- spec.license = 'Applitools'
17
+ spec.license = 'Proprietary'
18
18
 
19
19
  spec.files = `git ls-files lib/applitools`.split($RS) + [
20
20
  'lib/require_utils.rb',
21
21
  'lib/eyes_core.rb',
22
+ 'LICENSE',
23
+ 'README.md',
22
24
  'CHANGELOG.md',
23
25
  'eyes_core.gemspec',
24
26
  'Rakefile',
@@ -38,13 +40,12 @@ Gem::Specification.new do |spec|
38
40
  spec.add_dependency 'colorize'
39
41
  spec.add_dependency 'websocket'
40
42
  spec.add_dependency 'sorted_set'
41
- spec.add_dependency 'eyes_universal', "= 4.38.0"
43
+ spec.add_dependency 'eyes_universal', "= 4.40.0"
42
44
 
43
45
  spec.add_development_dependency 'bundler'
44
46
  spec.add_development_dependency 'rake'
45
47
  spec.add_development_dependency 'rspec', '>= 3'
46
48
  spec.add_development_dependency 'rubocop', '<= 0.46.0'
47
- spec.add_development_dependency 'webdrivers', '~> 5.0'
48
49
 
49
50
  # Exclude debugging support on Travis CI, due to its incompatibility with jruby and older rubies.
50
51
  unless ENV['TRAVIS']
@@ -7,8 +7,7 @@ module Applitools
7
7
  def initialize(app_output, screenshot, allow_empty_screenshot = false)
8
8
  raise Applitools::EyesIllegalArgument.new 'app_output is not kind of Applitools::AppOutput' unless
9
9
  app_output.is_a? Applitools::AppOutput
10
- raise Applitools::EyesIllegalArgument.new 'screenshot is not kind of Applitools::EyesScreenshot' unless
11
- allow_empty_screenshot || screenshot.is_a?(Applitools::EyesScreenshot)
10
+ # No type checking for screenshot since EyesScreenshot is removed
12
11
  @app_output = app_output
13
12
  @screenshot = screenshot
14
13
  end
@@ -25,4 +24,4 @@ module Applitools
25
24
  app_output.screenshot_url
26
25
  end
27
26
  end
28
- end
27
+ end
@@ -15,7 +15,9 @@ module Applitools
15
15
  case image
16
16
  when Applitools::Screenshot
17
17
  image.save(file_name_to_save(suffix)) if image.area > 0
18
- when Applitools::EyesScreenshot
18
+ # EyesScreenshot class has been removed
19
+ # when responding to :image method, try to save the image
20
+ when -> (img) { img.respond_to?(:image) && img.image.respond_to?(:area) && img.image.respond_to?(:save) }
19
21
  image.image.save(file_name_to_save(suffix)) if image.image.area > 0
20
22
  # when String
21
23
  # ::ChunkyPNG::Image.from_string(image).save(file_name_to_save(suffix))
@@ -38,8 +38,9 @@ module Applitools
38
38
 
39
39
  USE_DEFAULT_TIMEOUT = -1
40
40
 
41
- SCREENSHOT_AS_IS = Applitools::EyesScreenshot::COORDINATE_TYPES[:screenshot_as_is].freeze
42
- CONTEXT_RELATIVE = Applitools::EyesScreenshot::COORDINATE_TYPES[:context_relative].freeze
41
+ # Define these constants directly since EyesScreenshot is removed
42
+ SCREENSHOT_AS_IS = :screenshot_as_is
43
+ CONTEXT_RELATIVE = :context_relative
43
44
 
44
45
  class << self
45
46
  def set_viewport_size(driver, viewport_size)
@@ -677,8 +678,8 @@ module Applitools
677
678
  return
678
679
  end
679
680
 
680
- control = last_screenshot.intersected_region control, EyesScreenshot::COORDINATE_TYPES[:context_relative],
681
- EyesScreenshot::COORDINATE_TYPES[:screenshot_as_is]
681
+ # Use constants defined at class level since EyesScreenshot is removed
682
+ control = last_screenshot.intersected_region control, CONTEXT_RELATIVE, SCREENSHOT_AS_IS
682
683
 
683
684
  if control.empty?
684
685
  logger.info "Ignoring '#{text}' out of bounds"
@@ -1,62 +1,14 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ # Empty placeholder for backward compatibility
4
+ # This class has been removed as its functionality is now handled by the Universal SDK
5
+
3
6
  module Applitools
7
+ # Empty placeholder class to maintain backward compatibility
4
8
  class EyesScreenshot
5
- extend Forwardable
6
- extend Applitools::Helpers
7
-
8
- def_delegators 'Applitools::EyesLogger', :logger, :log_handler, :log_handler=
9
- attr_accessor :image, :top_left_location
10
- def_delegators '@image', :width, :height
11
-
12
9
  COORDINATE_TYPES = {
13
- context_as_is: 'CONTEXT_AS_IS',
14
- screenshot_as_is: 'SCREENSHOT_AS_IS',
15
- context_relative: 'CONTEXT_RELATIVE'
10
+ context_relative: :context_relative,
11
+ screenshot_as_is: :screenshot_as_is
16
12
  }.freeze
17
-
18
- def initialize(screenshot)
19
- Applitools::ArgumentGuard.is_a? screenshot, 'screenshot', Applitools::Screenshot
20
- self.image = screenshot
21
- end
22
-
23
- abstract_method :sub_screenshot, false
24
- abstract_method :convert_location, false
25
- abstract_method :location_in_screenshot, false
26
- abstract_method :intersected_region, false
27
-
28
- def sub_screenshots(regions, coordinate_type)
29
- Applitools::ArgumentGuard.is_a? regions, 'regions', Enumerable
30
- regions.map do |region|
31
- sub_screenshot(region, coordinate_type, false, true)
32
- end
33
- end
34
-
35
- def convert_region_location(region, from, to)
36
- Applitools::ArgumentGuard.not_nil region, 'region'
37
- Applitools::ArgumentGuard.is_a? region, 'region', Applitools::Region
38
- if region.empty?
39
- return region.dup.tap do |r|
40
- r.left = 0
41
- r.top = 0
42
- r.width = 0
43
- r.height = 0
44
- end
45
- end
46
- Applitools::ArgumentGuard.not_nil from, 'from'
47
- Applitools::ArgumentGuard.not_nil to, 'to'
48
-
49
- updated_location = convert_location(region.location, from, to)
50
- region.dup.tap do |r|
51
- r.left = updated_location.x
52
- r.top = updated_location.y
53
- end
54
- end
55
-
56
- private
57
-
58
- def image_region
59
- Applitools::Region.new(0, 0, image.width, image.height)
60
- end
61
13
  end
62
- end
14
+ end
@@ -94,20 +94,22 @@ module Applitools
94
94
  end
95
95
 
96
96
  def ==(other)
97
- min_diff_intensity == other.min_diff_intensity &&
98
- min_diff_width == other.min_diff_width &&
99
- min_diff_height == other.min_diff_height &&
100
- match_threshold == other.match_threshold
97
+ return false unless other.is_a?(self.class)
98
+ self.min_diff_intensity == other.min_diff_intensity &&
99
+ self.min_diff_width == other.min_diff_width &&
100
+ self.min_diff_height == other.min_diff_height &&
101
+ self.match_threshold == other.match_threshold
101
102
  end
102
103
 
103
104
  def to_hash
104
105
  {
105
- minDiffIntensity: min_diff_intensity,
106
- minDiffWidth: min_diff_width,
107
- minDiffHeight: min_diff_height,
108
- matchThreshold: match_threshold
106
+ minDiffIntensity: self.min_diff_intensity,
107
+ minDiffWidth: self.min_diff_width,
108
+ minDiffHeight: self.min_diff_height,
109
+ matchThreshold: self.match_threshold
109
110
  }
110
111
  end
112
+
111
113
  end
112
114
 
113
115
  # export type MatchSettings<TRegion> = {
@@ -5,17 +5,18 @@ module Applitools::MatchLevelSetter
5
5
  raise Applitools::EyesError unless
6
6
  Applitools::MATCH_LEVEL.keys.include?(value) | Applitools::MatchLevel.enum_values.include?(value)
7
7
 
8
- if value != :exact && value != Applitools::MatchLevel::EXACT && (exact_options && !exact_options.empty?)
9
- raise Applitools::EyesError.new(
10
- 'Exact options are accepted only for EXACT match level'
11
- )
12
- end
13
8
  match_level_value = if Applitools::MatchLevel.enum_values.include?(value)
14
9
  value
15
10
  else
16
11
  Applitools::MATCH_LEVEL[value]
17
12
  end
18
- [match_level_value, value == Applitools::MatchLevel::EXACT ? convert_exact_options(exact_options) : nil]
13
+ if match_level_value != Applitools::MatchLevel::EXACT && (exact_options && !exact_options.empty?)
14
+ raise Applitools::EyesError.new(
15
+ 'Exact options are accepted only for EXACT match level'
16
+ )
17
+ end
18
+
19
+ [match_level_value, match_level_value == Applitools::MatchLevel::EXACT ? convert_exact_options(exact_options) : nil]
19
20
  end
20
21
 
21
22
  private
@@ -7,8 +7,9 @@ module Applitools
7
7
  return region.with_padding.to_hash if region.respond_to?(:converted?) && region.converted?
8
8
  screenshot.convert_region_location(
9
9
  region.with_padding,
10
- Applitools::EyesScreenshot::COORDINATE_TYPES[:context_relative],
11
- Applitools::EyesScreenshot::COORDINATE_TYPES[:screenshot_as_is]
10
+ # Use constants directly since EyesScreenshot is removed
11
+ :context_relative,
12
+ :screenshot_as_is
12
13
  ).to_hash
13
14
  end
14
15
 
@@ -387,8 +388,9 @@ module Applitools
387
388
  self.floating_regions = @floating_regions.map do |r|
388
389
  updated_region = app_output.screenshot.convert_region_location(
389
390
  r,
390
- Applitools::EyesScreenshot::COORDINATE_TYPES[:context_relative],
391
- Applitools::EyesScreenshot::COORDINATE_TYPES[:screenshot_as_is]
391
+ # Use constants directly since EyesScreenshot is removed
392
+ :context_relative,
393
+ :screenshot_as_is
392
394
  )
393
395
 
394
396
  Applitools::FloatingRegion.new(
@@ -3,7 +3,7 @@
3
3
  module Applitools
4
4
  module UniversalEyesOpen
5
5
 
6
- # Starts a test
6
+ # Starts a test with Universal SDK
7
7
  #
8
8
  # @param options [Hash] options
9
9
  # @option options :driver The driver that controls the browser hosting the application
@@ -14,8 +14,8 @@ module Applitools
14
14
  # (i.e., the visible part of the document's body) or +nil+ to use the current window's viewport.
15
15
  # @option options :session_type The type of the test (e.g., standard test / visual performance test).
16
16
  # Default value is 'SEQUENTAL'
17
- # @return [Applitools::Selenium::Driver] A wrapped web driver which enables Eyes
18
- # trigger recording and frame handling
17
+ # @return [Applitools::Selenium::Driver] A wrapped web driver for internal SDK use
18
+ # (Note: open() method will return the original, unwrapped driver)
19
19
  def universal_open(options = {})
20
20
  original_driver = options.delete(:driver)
21
21
  if self.class.name != 'Applitools::Images::Eyes'
@@ -27,10 +27,18 @@ module Applitools
27
27
  end
28
28
 
29
29
  self.driver = Applitools::Selenium::SeleniumEyes.eyes_driver(original_driver, self)
30
+
31
+ # Call driver-specific settings if available
32
+ if respond_to?(:perform_driver_specific_settings, true)
33
+ perform_driver_specific_settings(original_driver)
34
+ end
30
35
  end
31
36
 
32
37
  update_config_from_options(options)
33
38
  universal_driver_config = driver.universal_driver_config if self.class.name != 'Applitools::Images::Eyes'
39
+
40
+ # Ensure we have a runner (default to ClassicRunner if not provided)
41
+ self.runner ||= Applitools::ClassicRunner.new
34
42
  universal_eyes_manager = runner.get_universal_eyes_manager(self)
35
43
 
36
44
  universal_eyes_config = Applitools::UniversalEyesConfig.new
@@ -12,15 +12,31 @@ module Applitools
12
12
  def extract_text(*args)
13
13
  image_target = args[0].is_a?(Hash) ? args[0] : nil
14
14
  targets_array = args[0].is_a?(Hash) ? args[1].to_a : args[0]
15
- targets_array.map do |target|
16
- target['target'] = { elementId: target['target'].ref } if target['target'].is_a?(::Selenium::WebDriver::Element)
17
- target['target']['x'] = target['target'].delete('left') if target['target']['left']
18
- target['target']['y'] = target['target'].delete('top') if target['target']['top']
15
+ targets_array = targets_array.map do |target|
16
+ # Handle element references
17
+ if target['target'].is_a?(::Selenium::WebDriver::Element)
18
+ ref = target['target'].ref
19
+ # Handle different formats of element refs
20
+ ref = ref[1] if ref.is_a?(Array) && ref[0] == :element
21
+ target['target'] = { elementId: ref }
22
+ elsif target['target'].is_a?(String)
23
+ # It's a CSS selector
24
+ target['target'] = target['target']
25
+ elsif target['target'].is_a?(Hash)
26
+ # Handle coordinate-based regions
27
+ if target['target']['left']
28
+ target['target']['x'] = target['target'].delete('left')
29
+ end
30
+ if target['target']['top']
31
+ target['target']['y'] = target['target'].delete('top')
32
+ end
33
+ end
19
34
  target[:region] = target.delete('target')
20
35
  target
21
36
  end
22
- driver_target = respond_to?(:driver) ? driver.universal_driver_config : image_target
23
- universal_eyes.extract_text(targets_array, driver_target)
37
+ driver_target = respond_to?(:driver) ? Applitools::Selenium.universal_driver_config(driver) : image_target
38
+ result = universal_eyes.extract_text(targets_array, driver_target)
39
+ result
24
40
  end
25
41
 
26
42
 
@@ -31,7 +47,7 @@ module Applitools
31
47
  # language?: string
32
48
  # }
33
49
  def extract_text_regions(patterns_array)
34
- driver_target = respond_to?(:driver) ? driver.universal_driver_config : { image: patterns_array.delete('image') }
50
+ driver_target = respond_to?(:driver) ? Applitools::Selenium.universal_driver_config(driver) : { image: patterns_array.delete('image') }
35
51
  results = universal_eyes.extract_text_regions(patterns_array, driver_target)
36
52
  Applitools::Utils.deep_stringify_keys(results)
37
53
  end
@@ -42,7 +58,7 @@ module Applitools
42
58
  locatorNames: locate_settings[:locator_names],
43
59
  firstOnly: !!locate_settings[:first_only]
44
60
  }
45
- driver_target = locate_settings.has_key?(:image) ? {image: locate_settings[:image]} : driver.universal_driver_config
61
+ driver_target = locate_settings.has_key?(:image) ? {image: locate_settings[:image]} : Applitools::Selenium.universal_driver_config(driver)
46
62
  results = universal_eyes.locate(settings, driver_target)
47
63
 
48
64
  old_style = results.map do |k, v|
@@ -2,7 +2,7 @@
2
2
 
3
3
  module Applitools
4
4
  module EyesCore
5
- VERSION = '6.7.1'.freeze
5
+ VERSION = '6.7.2'.freeze
6
6
  end
7
7
 
8
8
  VERSION = Applitools::EyesCore::VERSION
@@ -255,7 +255,9 @@ module Applitools::Connectivity
255
255
  # type ExtractTextResponsePayload = string[]
256
256
  payload = { target: driver_target, settings: regions, config: commands_config }
257
257
  payload.delete(:settings) if regions.empty?
258
- command_with_result(EYES_EXTRACT_TEXT, payload)
258
+ result = command_with_result(EYES_EXTRACT_TEXT, payload)
259
+ # Ensure we return the result array
260
+ result.is_a?(Hash) && result['result'] ? result['result'] : result
259
261
  end
260
262
 
261
263
  def eyes_close(eyes)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eyes_core
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.7.1
4
+ version: 6.7.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Applitools Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-05-22 00:00:00.000000000 Z
11
+ date: 2025-06-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -114,14 +114,14 @@ dependencies:
114
114
  requirements:
115
115
  - - '='
116
116
  - !ruby/object:Gem::Version
117
- version: 4.38.0
117
+ version: 4.40.0
118
118
  type: :runtime
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
122
  - - '='
123
123
  - !ruby/object:Gem::Version
124
- version: 4.38.0
124
+ version: 4.40.0
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: bundler
127
127
  requirement: !ruby/object:Gem::Requirement
@@ -178,20 +178,6 @@ dependencies:
178
178
  - - "<="
179
179
  - !ruby/object:Gem::Version
180
180
  version: 0.46.0
181
- - !ruby/object:Gem::Dependency
182
- name: webdrivers
183
- requirement: !ruby/object:Gem::Requirement
184
- requirements:
185
- - - "~>"
186
- - !ruby/object:Gem::Version
187
- version: '5.0'
188
- type: :development
189
- prerelease: false
190
- version_requirements: !ruby/object:Gem::Requirement
191
- requirements:
192
- - - "~>"
193
- - !ruby/object:Gem::Version
194
- version: '5.0'
195
181
  - !ruby/object:Gem::Dependency
196
182
  name: pry
197
183
  requirement: !ruby/object:Gem::Requirement
@@ -285,6 +271,8 @@ extensions: []
285
271
  extra_rdoc_files: []
286
272
  files:
287
273
  - CHANGELOG.md
274
+ - LICENSE
275
+ - README.md
288
276
  - Rakefile
289
277
  - eyes_core.gemspec
290
278
  - lib/applitools/connectivity/proxy.rb
@@ -369,7 +357,7 @@ files:
369
357
  - lib/require_utils.rb
370
358
  homepage: https://www.applitools.com
371
359
  licenses:
372
- - Applitools
360
+ - Proprietary
373
361
  metadata:
374
362
  yard.run: yri
375
363
  post_install_message: