@applitools/eyes-selenium 4.67.3 → 4.68.0

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,147 @@
1
1
  # Changelog
2
2
 
3
+ ## [4.68.0](https://github.com/applitools/eyes.sdk.javascript1/compare/js/eyes-selenium-v4.67.6...js/eyes-selenium@4.68.0) (2023-09-11)
4
+
5
+
6
+ ### Features
7
+
8
+ * rework log event on opent eyes ([#1842](https://github.com/applitools/eyes.sdk.javascript1/issues/1842)) ([532756b](https://github.com/applitools/eyes.sdk.javascript1/commit/532756b75c1023967c3781316148c890dbcfaac8))
9
+
10
+
11
+ ### Code Refactoring
12
+
13
+ * refactored spec driver interface ([#1839](https://github.com/applitools/eyes.sdk.javascript1/issues/1839)) ([aa49ec2](https://github.com/applitools/eyes.sdk.javascript1/commit/aa49ec2a7d14b8529acc3a8a4c2baecfa113d98a))
14
+
15
+
16
+ ### Dependencies
17
+
18
+ * @applitools/core bumped to 3.10.3
19
+ #### Bug Fixes
20
+
21
+ * suppport coded regions with layoutBreakpoints reload ([7903347](https://github.com/applitools/eyes.sdk.javascript1/commit/79033472b9475992a44cf3828ff334c958ae2066))
22
+ * @applitools/eyes bumped to 1.8.3
23
+
24
+
25
+ ## [4.67.5](https://github.com/applitools/eyes.sdk.javascript1/compare/js/eyes-selenium@4.67.4...js/eyes-selenium@4.67.5) (2023-09-04)
26
+
27
+
28
+ ### Dependencies
29
+
30
+ * @applitools/utils bumped to 1.6.0
31
+ #### Features
32
+
33
+ * add support for fallback in `req` ([#1899](https://github.com/applitools/eyes.sdk.javascript1/issues/1899)) ([d69c4b5](https://github.com/applitools/eyes.sdk.javascript1/commit/d69c4b5830370c471dfc25b6e2caddca8b458df9))
34
+ * @applitools/logger bumped to 2.0.10
35
+
36
+ * @applitools/socket bumped to 1.1.10
37
+
38
+ * @applitools/req bumped to 1.6.0
39
+ #### Features
40
+
41
+ * add support for fallback in `req` ([#1899](https://github.com/applitools/eyes.sdk.javascript1/issues/1899)) ([d69c4b5](https://github.com/applitools/eyes.sdk.javascript1/commit/d69c4b5830370c471dfc25b6e2caddca8b458df9))
42
+ * update testcafe ([#1884](https://github.com/applitools/eyes.sdk.javascript1/issues/1884)) ([104f1b6](https://github.com/applitools/eyes.sdk.javascript1/commit/104f1b6cc0d4f107ba46404383de2fa11fe99dcf))
43
+
44
+
45
+
46
+ * @applitools/image bumped to 1.1.5
47
+
48
+ * @applitools/spec-driver-webdriver bumped to 1.0.44
49
+
50
+ * @applitools/spec-driver-selenium bumped to 1.5.58
51
+
52
+ * @applitools/spec-driver-puppeteer bumped to 1.2.0
53
+ #### Features
54
+
55
+ * update testcafe ([#1884](https://github.com/applitools/eyes.sdk.javascript1/issues/1884)) ([104f1b6](https://github.com/applitools/eyes.sdk.javascript1/commit/104f1b6cc0d4f107ba46404383de2fa11fe99dcf))
56
+
57
+
58
+
59
+ * @applitools/driver bumped to 1.14.0
60
+ #### Features
61
+
62
+ * update testcafe ([#1884](https://github.com/applitools/eyes.sdk.javascript1/issues/1884)) ([104f1b6](https://github.com/applitools/eyes.sdk.javascript1/commit/104f1b6cc0d4f107ba46404383de2fa11fe99dcf))
63
+
64
+
65
+
66
+ * @applitools/screenshoter bumped to 3.8.10
67
+
68
+ * @applitools/nml-client bumped to 1.5.10
69
+
70
+ * @applitools/tunnel-client bumped to 1.2.2
71
+
72
+ * @applitools/ufg-client bumped to 1.8.0
73
+ #### Features
74
+
75
+ * add support for fallback in `req` ([#1899](https://github.com/applitools/eyes.sdk.javascript1/issues/1899)) ([d69c4b5](https://github.com/applitools/eyes.sdk.javascript1/commit/d69c4b5830370c471dfc25b6e2caddca8b458df9))
76
+
77
+
78
+
79
+ * @applitools/ec-client bumped to 1.7.7
80
+
81
+ * @applitools/core-base bumped to 1.5.3
82
+
83
+ * @applitools/core bumped to 3.10.1
84
+
85
+ * @applitools/eyes bumped to 1.8.1
86
+
87
+
88
+ ## [4.67.4](https://github.com/applitools/eyes.sdk.javascript1/compare/js/eyes-selenium@4.67.3...js/eyes-selenium@4.67.4) (2023-08-30)
89
+
90
+
91
+ ### Dependencies
92
+
93
+ * @applitools/utils bumped to 1.5.2
94
+ #### Bug Fixes
95
+
96
+ * fixed some types ([498b1d7](https://github.com/applitools/eyes.sdk.javascript1/commit/498b1d7c547df04773b64b66ee39cccb402c093e))
97
+ * @applitools/nml-client bumped to 1.5.9
98
+ #### Bug Fixes
99
+
100
+ * update broker url when server respond with error ([#1882](https://github.com/applitools/eyes.sdk.javascript1/issues/1882)) ([ab5a6ae](https://github.com/applitools/eyes.sdk.javascript1/commit/ab5a6ae8976b061bda8b56a9cc11c149e47d6dea))
101
+
102
+
103
+
104
+ * @applitools/core bumped to 3.10.0
105
+ #### Features
106
+
107
+ * allowed running multiple classic test with different devices for applitoolsified native apps ([#1891](https://github.com/applitools/eyes.sdk.javascript1/issues/1891)) ([a84311f](https://github.com/applitools/eyes.sdk.javascript1/commit/a84311f88e6f532268543a96f841ae5ad87d5659))
108
+
109
+
110
+
111
+ * @applitools/logger bumped to 2.0.9
112
+
113
+ * @applitools/socket bumped to 1.1.9
114
+
115
+ * @applitools/req bumped to 1.5.4
116
+
117
+ * @applitools/image bumped to 1.1.4
118
+
119
+ * @applitools/spec-driver-webdriver bumped to 1.0.43
120
+
121
+ * @applitools/spec-driver-selenium bumped to 1.5.57
122
+
123
+ * @applitools/spec-driver-puppeteer bumped to 1.1.74
124
+
125
+ * @applitools/driver bumped to 1.13.6
126
+
127
+ * @applitools/screenshoter bumped to 3.8.9
128
+
129
+ * @applitools/tunnel-client bumped to 1.2.1
130
+
131
+ * @applitools/ufg-client bumped to 1.7.2
132
+
133
+ * @applitools/ec-client bumped to 1.7.6
134
+
135
+ * @applitools/core-base bumped to 1.5.2
136
+
137
+ * @applitools/eyes bumped to 1.8.0
138
+ #### Features
139
+
140
+ * added more iOS devices ([a84311f](https://github.com/applitools/eyes.sdk.javascript1/commit/a84311f88e6f532268543a96f841ae5ad87d5659))
141
+
142
+
143
+
144
+
3
145
  ## [4.67.3](https://github.com/applitools/eyes.sdk.javascript1/compare/js/eyes-selenium@4.67.2...js/eyes-selenium@4.67.3) (2023-08-18)
4
146
 
5
147
 
package/README.md CHANGED
@@ -7,1015 +7,6 @@
7
7
  </div>
8
8
  <br/>
9
9
 
10
- ### Table of contents
11
-
12
- - [Installation](#installation)
13
- - [Applitools API key](#applitools-api-key)
14
- - [Usage](#usage)
15
- - [Getting started with the API](#getting-started-with-the-api)
16
- - [Eyes constructor](#eyes-constructor)
17
- - [open](#open)
18
- - [Visual tests and baselines](#visual-tests-and-baselines)
19
- - [Batches](#batches)
20
- - [check](#check)
21
- - [`checkSettings`](#checksettings)
22
- - [Page screenshot](#page-screenshot)
23
- - [Region screenshot](#region-screenshot)
24
- - [Switching into frames](#switching-into-frames)
25
- - [Ignore Regions](#ignore-regions)
26
- - [Floating Regions](#floating-regions)
27
- - [Content/Strict/Layout Regions](#contentstrictlayout-regions)
28
- - [Accessiblity Regions](#accessiblity-regions)
29
- - [Scroll root element](#scroll-root-element)
30
- - [Tag (`withName`)](#tag-withname)
31
- - [Variation group ID](#variation-group-id)
32
- - [Lazy loading (`lazyLoad`)](#lazy-loading-lazyload)
33
- - [Density metrics](#density-metrics-densitymetrics)
34
- - [Other checkSettings configuration](#other-checksettings-configuration)
35
- - [close](#close)
36
- - [Runners](#runners)
37
- - [Purpose of runners](#purpose-of-runners)
38
- - [1. Use the Ultrafast grid](#1-use-the-ultrafast-grid)
39
- - [2. Manage tests across multiple `Eyes` instances](#2-manage-tests-across-multiple-eyes-instances)
40
- - [Visual locators](#visual-locators)
41
- - [](#)
42
- - [Recipes for common tasks](#recipes-for-common-tasks)
43
- - [Configure Server URL](#configure-server-url)
44
- - [Configure Proxy](#configure-proxy)
45
- - [Make every visual test correspond to a functional test](#make-every-visual-test-correspond-to-a-functional-test)
46
- - [Organize tests in batches](#organize-tests-in-batches)
47
- - [Method 1: environment variable](#method-1-environment-variable)
48
- - [Method 2: `eyes.setBatch`](#method-2-eyessetbatch)
49
- - [Stitch mode](#stitch-mode)
50
- - [Background information](#background-information)
51
- - [1. Stitch mode: Scroll](#1-stitch-mode-scroll)
52
- - [2. Stitch mode: CSS](#2-stitch-mode-css)
53
- - [Stitch overlap](#stitch-overlap)
54
- - [Match level](#match-level)
55
- - [Ignore displacements](#ignore-displacements)
56
- - [Test properties](#test-properties)
57
- - [Test results](#test-results)
58
- - [Logging](#logging)
59
- - [Configuring browsers for the Ultrafast grid](#configuring-browsers-for-the-ultrafast-grid)
60
- - [Desktop browsers](#desktop-browsers)
61
- - [Chrome device emulation](#chrome-device-emulation)
62
- - [iOS device](#ios-device)
63
-
64
-
65
- ## Installation
66
-
67
- Install Eyes-Selenium as a local dev dependency in your tested project:
68
-
69
- ```bash
70
- npm i -D @applitools/eyes-selenium
71
- ```
72
-
73
- ## Applitools API key
74
-
75
- In order to authenticate via the Applitools server, you need to supply the Eyes-Selenium SDK with the API key you got from Applitools. Read more about how to obtain the API key [here](https://applitools.com/docs/topics/overview/obtain-api-key.html).
76
-
77
- To do this, set the environment variable `APPLITOOLS_API_KEY` to the API key before running your tests.
78
- For example, on Linux/Mac:
79
-
80
- ```bash
81
- export APPLITOOLS_API_KEY=<your_key>
82
- npm test
83
- ```
84
-
85
- And on Windows:
86
-
87
- ```bash
88
- set APPLITOOLS_API_KEY=<your_key>
89
- npx test
90
- ```
91
-
92
- It's also possible to set the API key programmatically like so:
93
-
94
- ```js
95
- eyes.setApiKey('<your API key>')
96
- ```
97
-
98
- ## Usage
99
-
100
- After defining the API key, you will be able to use commands from Eyes-Selenium in your tests to take screenshots and use Applitools Eyes to manage them.
101
-
102
- For example:
103
-
104
- ```js
105
- const {Eyes, Target} = require('@applitools/eyes-selenium')
106
-
107
- describe('My first visual test', function() {
108
- it('should check the Applitools website', async function() {
109
- browser.get('https://applitools.com');
110
-
111
- const eyes = new Eyes();
112
- await eyes.open(browser, "applitools.com website", "My first Selenium test!")
113
- await eyes.check('home page', Target.window().fully())
114
- await eyes.close()
115
- });
116
- });
117
- ```
118
-
119
- ## Getting started with the API
120
-
121
- ### Eyes constructor
122
-
123
- Creates an instance of `Eyes`, which then exposes methods to run and configure visual tests.
124
-
125
- ```js
126
- const eyes = new Eyes(runner)
127
- ```
128
-
129
- - `runner` - A runner instance which manages tests across multiple `Eyes` instances. The runner can be an instance of either a `ClassicRunenr` or a `VisualGridRunner`. For more information, see the [Runners](#runners) section below.
130
-
131
- ### open
132
-
133
- Creates an Applitools test.
134
- This will start a session with the Applitools server.
135
-
136
- ```js
137
- eyes.open(browser, appName, testName, viewportSize)
138
- ```
139
-
140
- #### Visual tests and baselines
141
-
142
- By using the `open`/`check`/`close` methods on `Eyes`, you are creating visual tests in Applitools Eyes. A visual test is a sequence of screenshots, compared with a baseline. The baseline is also a sequence of screenshots. The specific baseline to compare against is found by using the values for:
143
-
144
- 1. Browser
145
- 2. Operating system
146
- 3. App name
147
- 4. Test name
148
- 5. Viewport size
149
-
150
- The baseline is created automatically when running a test with specific values for these 5 parameters for the first time. For example, you run a test with **Chrome** on **OS X** and specify the **app name**, **test name** and **viewport size** via `eyes.open(t, 'some app', 'some test', {width: 1200, height: 800})`. The first time the test runs with these parameters, a baseline will be created. Any subsequent execution with the same values will compare screenshots against this baseline. The test will actually be created after running `eyes.close`, and the results of the test are returned as a `TestResults` object.
151
-
152
- _For more information, visit our documentation page:
153
- https://applitools.com/docs/topics/general-concepts/how-eyes-compares-checkpoints.html_
154
-
155
- #### Batches
156
-
157
- It's possible to aggregate tests that are run in different processes, or in different Eyes instances, under the same batch. This is done by providing the same batch ID to these tests.
158
-
159
- For instructions, see the [Organize tests in batches](#organize-tests-in-batches) section below.
160
-
161
- _For more information, visit our documentation page:
162
- https://applitools.com/docs/topics/working-with-test-batches/working-with-test-batches-in-overview.html_
163
-
164
- ### check
165
-
166
- Generates a screenshot of the current page and add it to the Applitools Test.
167
-
168
- ```js
169
- eyes.check(checkSettings)
170
- ```
171
-
172
- #### `checkSettings`
173
-
174
- Holds the checkpoint's configuration. This is defined using a fluent API, starting with `Target`.
175
-
176
- ##### Page screenshot
177
-
178
- - For taking a viewport screenshot, call `Target.window()`.
179
- - For a full page screenshot, call `Target.window().fully()`.
180
-
181
- ##### Region screenshot
182
-
183
- To take an element screenshot, it's possible to specify either a locator or the element representation itself. For example:
184
-
185
- ```js
186
- // region by locator
187
- const locator = by.css('.banner')
188
- eyes.check(Target.region(locator))
189
-
190
- // region by element
191
- const el = element(locator)
192
- eyes.check(Target.region(el))
193
- ```
194
-
195
- Passing a string is interpreted as a css selector:
196
-
197
- ```js
198
- // region by css selector
199
- eyes.check(Target.region('.banner'))
200
- ```
201
-
202
- It's also possible to specify the absolute coordinates for the desired region:
203
-
204
- ```js
205
- // region by coordinates
206
- eyes.check(
207
- Target.region({left: 10, top: 20, width: 200, height: 80})
208
- )
209
- ```
210
-
211
- For all the above options, it's possible to specify `.fully()` in order to take the entire content of an element that can be scrolled.
212
-
213
- ##### Switching into frames
214
-
215
- For taking screenshots of elements inside iframes, it's possible to specify the frame using the `Target.frame` fluent API. For example:
216
-
217
- ```js
218
- // element inside frame
219
- eyes.check(
220
- Target.frame('frame-1').region(by.css('.element-inside frame')
221
- )
222
- ```
223
-
224
- It's possible to take a screenshot of the entire frame:
225
-
226
- ```js
227
- // entire frame
228
- eyes.check(
229
- Target.frame('frame-1').fully()
230
- )
231
- ```
232
-
233
- Multiple frame calls can be made, thus creating a "frame chain". For example:
234
-
235
- ```js
236
- // element inside nested frames
237
- eyes.check(
238
- Target.frame('frame-1').frame('frame-1-1').region(by.css('.nested-element'))
239
- )
240
- ```
241
-
242
- ##### Ignore Regions
243
-
244
- <!-- TODO add explanation -->
245
-
246
- ```js
247
- // single region
248
- eyes.check(
249
- 'viewport screenshot with ignore region',
250
- Target
251
- .window()
252
- .ignoreRegion('.dynamic-content-here')
253
- )
254
-
255
- // multiple regions
256
- eyes.check(
257
- 'viewport screenshot with ignore region',
258
- Target
259
- .window()
260
- .ignoreRegions('.dynamic-content-here', someElement, someCoordinates)
261
- )
262
- ```
263
-
264
- Possible input types are:
265
-
266
- - string (interpreted as css selector)
267
- - `by` locator
268
- - element
269
- - coordinates (`{left, top, width, height}`)
270
-
271
- ##### Floating Regions
272
-
273
- <!-- TODO add explanation -->
274
-
275
- ```js
276
- // viewport screenshot with floating region
277
- eyes.check(
278
- Target
279
- .window()
280
- .floatingRegion('.floating-area', 10, 10, 10, 10) // up, down, left, right
281
- )
282
-
283
- // multiple regions
284
- eyes.check(
285
- Target
286
- .window()
287
- .floatingRegions(10, '.floating-area', someElement, someCoordinates) // up, down, left, right all equal to 10
288
- )
289
- ```
290
-
291
- Possible input types are:
292
-
293
- - string (interpreted as css selector)
294
- - `by` locator
295
- - element
296
- - coordinates (`{left, top, width, height}`)
297
-
298
- ##### Content/Strict/Layout Regions
299
-
300
- <!-- TODO add explanation -->
301
-
302
- ```js
303
- // viewport screenshot with content region
304
- eyes.check(Target.window().contentRegion('.some-element'))
305
-
306
- // viewport screenshot with strict region
307
- eyes.check(Target.window().strictRegion('.some-element'))
308
-
309
- // viewport screenshot with layout region
310
- eyes.check(Target.window().layoutRegion('.some-element'))
311
-
312
- // multiple regions
313
- Target.window().contentRegions(region1, region2, region3)
314
- Target.window().strictRegions(region1, region2, region3)
315
- Target.window().layoutRegions(region1, region2, region3)
316
- ```
317
-
318
- Possible input types are:
319
-
320
- - string (interpreted as css selector)
321
- - `by` locator
322
- - element
323
- - coordinates (`{left, top, width, height}`)
324
-
325
- ##### Accessiblity Regions
326
-
327
- <!-- TODO add explanation -->
328
-
329
- ```js
330
- const {AccessibilityRegionType} = require('@applitools/eyes-selenium')
331
-
332
- // viewport screenshot with accessibility region
333
- eyes.check(
334
- Target.window().accessibilityRegion('.some-element', AccessibilityRegionType.LargeText)
335
- )
336
-
337
- // multiple regions is done by chaining the same method
338
- eyes.check(
339
- Target.window()
340
- .accessibilityRegion('.element-1', AccessibilityRegionType.LargeText)
341
- .accessibilityRegion('.element-2', AccessibilityRegionType.IgnoreContrast)
342
- .accessibilityRegion('.element-3', AccessibilityRegionType.BoldText)
343
- )
344
- ```
345
-
346
- Possible input types are:
347
-
348
- - string (interpreted as css selector)
349
- - `by` locator
350
- - element
351
- - coordinates (`{left, top, width, height}`)
352
-
353
- ##### Scroll root element
354
-
355
- <!-- TODO add explanation -->
356
-
357
- ```js
358
- // full page with custom scroll root element
359
- eyes.check(
360
- Target.window().fully().scrollRootElement('.main-content')
361
- )
362
- ```
363
-
364
- Possible input types are:
365
-
366
- - string (interpreted as css selector)
367
- - `by` locator
368
- - element
369
-
370
- ##### Tag (`withName`)
371
-
372
- Defines a name for the checkpoint in the Eyes Test Manager. The name may be any string and serves to identify the step to the user in the Test manager. You may change the tag value without impacting testing in any way since Eyes does not use the tag to identify the baseline step that corresponds to the checkpoint - Eyes matches steps based on their content and position in the sequences of images of the test. See [How Eyes compares checkpoints and baseline images](https://applitools.com/docs/topics/general-concepts/how-eyes-compares-checkpoints.html) for details.
373
-
374
- ```js
375
- eyes.check(Target.window().withName('Main page'))
376
- ```
377
-
378
- ##### Variation group ID
379
-
380
- ```js
381
- eyes.check(Target.window().variationGroupId('Login button on the right'))
382
- ```
383
-
384
- _For more information, visit our documentation page: https://applitools.com/docs/features/baseline-variations-groups.html_
385
-
386
- ##### Lazy loading (`lazyLoad`)
387
-
388
- It's possible to have the SDK scroll the entire page (or a specific length of the page) to make sure all lazyily loaded assets are on the page before performing a check.
389
-
390
- ```js
391
- // lazy loads with sensible defaults
392
- eyes.check(Target.window().lazyLoad())
393
-
394
- // lazy loads with options specified
395
- eyes.check(Target.window().lazyLoad({
396
- maxAmountToScroll: 1000, // total pixels of the page to be scrolled
397
- scrollLength: 250, // amount of pixels to use for each scroll attempt
398
- waitingTime: 500, // milliseconds to wait in-between each scroll attempt
399
- }))
400
- ```
401
-
402
- Possible input types are:
403
-
404
- - nothing (enables sensible defaults)
405
- - options object (`{maxAmountToScroll, waitingTime, scrollLength}`)
406
-
407
- Other details:
408
-
409
- - If an option is omitted, the sensible default for that value will be used
410
- - The SDK will repeatedly scroll the page using the `scrollLength` until either the page cannot be scrolled further or the `maxAmountToScroll` has been reached (whichever happens first)
411
- - If more time is needed for additional content to load, then increase the waitingTime to a value higher than 500 milliseconds. If better performance is desired and additional content lazily loads faster than the default waitingTime, then reduce it to a value below 500 milliseconds
412
-
413
- ##### Density metrics (`densityMetrics`)
414
-
415
- In order to set the density metrics for the screenshot, use the `densityMetrics` method. This method accepts a object value with the following properties:
416
-
417
- - `xdpi` - The exact physical pixels per inch of the screen in the X dimension.
418
- - `ydpi` - The exact physical pixels per inch of the screen in the Y dimension.
419
- - `scaleRatio` - The scale ratio.
420
-
421
- ```js
422
- // set density metrics
423
- eyes.check(Target.window().densityMetrics({
424
- xdpi: 100,
425
- ydpi: 100,
426
- scaleRatio: 1
427
- }))
428
- ```
429
-
430
- ###### Other checkSettings configuration
431
-
432
- <!-- TODO add explanation -->
433
-
434
- - `hideScrollbars`
435
- - `hideCaret`
436
- - `ignoreDisplacements`
437
- - `useDom`
438
- - `enablePatterns`
439
-
440
- ### close
441
-
442
- Closes the applitools test and check that all screenshots are valid.
443
-
444
- It is important to call this at the end of each test, symmetrically to `open`(or in `afterEach()`, see [Best practice for using the SDK](#best-practice-for-using-the-sdk)).
445
-
446
- ```js
447
- const testResults = await eyes.close(throwEx)
448
- ```
449
-
450
- - `throwEx` - (Boolean) throw an error if visual differences were found, or if the test failed for any other reason. The deault is `true`.
451
-
452
- Return value: [`TestResults`](#test-results).
453
-
454
- ## Runners
455
-
456
- There are two types of runners: `ClassicRunner` and `VisualGridRunner`:
457
-
458
- 1. `ClassicRunner` - used when the screenshot is taken by the SDK itself.
459
-
460
- ```js
461
- const {ClassicRunner} = require('@applitools/eyes-selenium')
462
- const runner = new ClassicRunner()
463
- ```
464
-
465
- 2. `VisualGridRunner` - used when the screenshot is taken by the **Ultrafast grid**.
466
-
467
- ```js
468
- const {VisualGridRunner} = require('@applitools/eyes-selenium')
469
- const runner = new VisualGridRunner(concurrentSessions)
470
- ```
471
-
472
- - `concurrentSessions` - (Number) the number of visual tests that are allowed to run at the same time. Default: `1`.
473
-
474
- ### Purpose of runners
475
-
476
- There are two purposes for using runners:
477
-
478
- #### 1. Use the Ultrafast grid
479
-
480
- This is done simply by specifying the `VisualGridRunner`. Browsers are specified by using the [`Configuration`](#configuration) API. For example:
481
-
482
- ```js
483
- const {Eyes, VisualGridRunner, BrowserType, DeviceName} = require('@applitools/eyes-selenium')
484
- const eyes = new Eyes(new VisualGridRunner)
485
- const configuration = eyes.getConfiguration()
486
-
487
- configuration.addBrowser({width: 1200, height: 800, name: BrowserType.CHROME})
488
- configuration.addBrowser({width: 1200, height: 800, name: BrowserType.FIREFOX})
489
- configuration.addBrowser({width: 1200, height: 800, name: BrowserType.SAFARI})
490
- configuration.addBrowser({width: 1200, height: 800, name: BrowserType.EDGE})
491
- configuration.addBrowser({width: 1200, height: 800, name: BrowserType.IE_11})
492
- configuration.addBrowser({deviceName: DeviceName.Galaxy_S9_Plus})
493
-
494
- eyes.setConfiguration(configuration)
495
- ```
496
-
497
- #### 2. Manage tests across multiple `Eyes` instances
498
-
499
- If you decide to create more than one instance of `Eyes` in your tests (for example, if you run `new Eyes()` in `beforeEach` test hooks), the runner provides a method called **`getAllTestResults`** for collecting test results across all eyes instances.
500
-
501
- Consider the following:
502
-
503
- ```js
504
- const {Eyes, ClassicRunner, StitchMode} = require('applitools/eyes-selenium')
505
- const runner = new VisualGridRunner(10)
506
-
507
- async function runTest(url, ...browsers) {
508
- await driver.get(url)
509
- const eyes = new Eyes(runner)
510
- const configuration = eyes.getConfiguration()
511
- configuration.addBrowsers(...browsers)
512
- eyes.setConfiguration(configuration)
513
- await eyes.open(driver, appName, testName, viewportSize)
514
- await eyes.check(undefined, Target.window().fully())
515
- eyes.close()
516
- }
517
-
518
- async function collectResults() {
519
- const testResultsSummary = await runner.getAllTestResults()
520
- for (const testResultContainer of testResultsSummary) {
521
- const testResults = testResultContainer.getTestResults()
522
- console.log(formatTestResults(testResults)) // see the Recipes section below for the implementation of this function
523
- }
524
- }
525
-
526
- Promise.all([
527
- runTest('https://example.org',
528
- {width: 1200, height: 800, name: BrowserType.CHROME},
529
- {width: 1200, height: 800, name: BrowserType.FIREFOX}
530
- ),
531
- runTest('https://applitools.com',
532
- {deviceName: DeviceName.Galaxy_S9_Plus},
533
- {deviceName: DeviceName.iPhone_X}
534
- )
535
- ]).then(collectResults)
536
- ```
537
-
538
- This snippet of code runs two visual tests in parallel on two websites, using a specific configuration for each url. To achieve this, multiple `Eyes` instances are used, but in order to wait for all test results, we call `runner.getAllTestResults`. We then iterate through the results and print out a formatted summary.
539
-
540
- <!-- TODO
541
- ## Configuration
542
-
543
- show logs
544
- save debug data ???
545
- api key
546
- server url
547
- proxy
548
- connection timeout ???
549
- remove session ???
550
- ignore baseline
551
- save new tests
552
- save failed tests
553
- match timeout
554
- match level
555
- isDisabled
556
- batch
557
- properties
558
- branch name
559
- parent branch name
560
- baseline branch name
561
- environment name
562
- save diffs
563
- send dom
564
- host app
565
- host os
566
- host app info
567
- host os info
568
- device info
569
- app name
570
- test name
571
- display name
572
- viewport size
573
- accessibility validation
574
- use dom
575
- enable patterns
576
- ignore displacements
577
- ignore caret
578
- force full page screenshot
579
- wait before screenshots
580
- stitch mode
581
- hide scrollbars
582
- hide caret
583
- stitch overlap
584
- dont close batches
585
- concurrent sessions ???
586
- add browsers
587
- -->
588
-
589
- ## Visual locators
590
-
591
- Information about what are visual locators and how to use them can be found in the documentation page [here](https://applitools.com/docs/features/visual-locators.html).
592
-
593
- The API to locate a visual locator in Eyes-Selenium has the following TypeScript signature:
594
-
595
- ```ts
596
- // Note: This is a formal TypeScript definition.
597
- // The reason we use the generic type TLocator here is that is shows how the return value of eyes.locate is an object
598
- // with the same keys as the array of locatorNames in the input to eyes.locate.
599
- // We explain this in more detail in the example below.
600
-
601
- interface Eyes {
602
- locate<TLocator extends string>(settings: VisualLocatorSettings<TLocator>): Promise<Record<TLocator, Array<Region>>>
603
- }
604
-
605
- interface VisualLocatorSettings<TLocator extends string> {
606
- locatorNames: Array<TLocator>;
607
- firstOnly: boolean;
608
- }
609
-
610
- interface Region {
611
- x: number;
612
- y: number;
613
- width: number;
614
- height: number;
615
- }
616
- ```
617
-
618
- Here is an example for using this API:
619
-
620
- ```js
621
- // first need to call eyes.open
622
- await eyes.open(driver, 'Test app', 'Test visual locators')
623
-
624
- // example for using eyes.locate
625
- const regionsMap = await eyes.locate({
626
- locatorNames: ['locator_a', 'locator_b', 'locator_c'],
627
- })
628
-
629
- // now get the coordinates of one of the locators
630
- const regionsForLocator_A = regionsMap['locator_a']
631
-
632
- // if region is found, perform press at the middle
633
- if (regionsForLocator_A && regionsForLocator_A.length > 0) {
634
- const region = regionsForLocator_A[0]
635
- const clickLocation = {
636
- x: region.left + region.width / 2,
637
- y: region.top + region.height / 2,
638
- }
639
- await driver.actions({ bridge: true }).move(clickLocation).click().perform()
640
- }
641
- ```
642
-
643
- ###
644
-
645
- ## Recipes for common tasks
646
-
647
- ### Configure Server URL
648
-
649
- By default, Eyes-Selenium communicates with Applitools' public Eyes cloud server, located at `https://eyesapi.applitools.com`.
650
-
651
- If you have a dedicated cloud or an on-premise server, configure a different Eyes server URL as follows:
652
-
653
- ```js
654
- eyes.setServerUrl('https://mycompanyeyesapi.applitools.com')
655
- ```
656
-
657
- ### Configure Proxy
658
-
659
- If your company's network requires requests to go through the corporate proxy, you may configure it as follows:
660
-
661
- ```js
662
- eyes.setProxy('http://yourproxy.com')
663
-
664
- // provide username and password:
665
- eyes.setProxy('http://user:pass@yourproxy.com')
666
- // OR
667
- eyes.setProxy({
668
- url: 'https://yourproxy.com',
669
- username: 'user',
670
- password: 'pass'
671
- })
672
-
673
- // use tunneling in case of HTTP over HTTPS proxy:
674
- eyes.setProxy({
675
- url: 'http://yourproxy.com',
676
- isHttpOnly: true
677
- })
678
- ```
679
-
680
- ### Make every visual test correspond to a functional test
681
-
682
- Every call to `eyes.open` and `eyes.close` defines a test in Applitools Eyes, and all the calls to `eyes.check` between them are called "steps". In order to get a test structure in Applitools that corresponds to the test structure in your functional test, it's best to open/close tests in every `test` call.
683
-
684
- For example, when running with Mocha as a test runner:
685
-
686
- ```js
687
- describe('My first visual test', function() {
688
- beforeEach(async () => {
689
- await eyes.open(browser, "applitools.com website", "My first Selenium test!")
690
- })
691
- afterEach(async () => {
692
- await eyes.close()
693
- })
694
- it('...', async function() {
695
- // ...
696
- });
697
- });
698
- ```
699
-
700
- ### Organize tests in batches
701
-
702
- It's possible to manage how visual tests are aggregated into batches. Here are two methods for clustering tests into a single batch:
703
-
704
- #### Method 1: environment variable
705
-
706
- Run all the processes that execute Selenium with the same value for `APPLITOOLS_BATCH_ID`. For example, run tests with the same randomly generated UUID:
707
-
708
- ```sh
709
- #! Unix based machines:
710
- APPLITOOLS_BATCH_ID=`uuidgen` npm test
711
-
712
- # Powershell on Windows:
713
- set APPLITOOLS_BATCH_ID = powershell -Command "[guid]::NewGuid().ToString()"
714
- ```
715
-
716
- It's also possible to control the batch name that shows up in Test Manager. For example:
717
-
718
- ```sh
719
- export APPLITOOLS_BATCH_ID=`uuidgen`
720
- export APPLITOOLS_BATCH_NAME="Login tests"
721
- npm test
722
- ```
723
-
724
- #### Method 2: `eyes.setBatch`
725
-
726
- Provide all Eyes instances with the same value for batch ID. For example:
727
-
728
- ```js
729
- eyes.setBatch({
730
- id: SOME_SHARED_VALUE_THAT_WILL_BE_THE_SAME_FOR_ALL_TEST_FILES,
731
- name: 'My batch'
732
- })
733
- ```
734
-
735
- ### Stitch mode
736
-
737
- The default stitch mode is `Scroll`. In order to change it:
738
-
739
- ```js
740
- const {Eyes, StitchMode} = require('@applitools/eyes-selenium')
741
-
742
- const eyes = new Eyes()
743
- eyes.setStitchMode(StitchMode.CSS)
744
-
745
- // to go back to scroll:
746
- eyes.setStitchMode(StitchMode.SCROLL)
747
- ```
748
-
749
- #### Background information
750
-
751
- Eyes-Selenium allows you to control if the checkpoint image should include only the viewport - i.e. what you see in the browser window when you first load a page, or if it should also include the full page - i.e. what you would see if you manually scrolled down, or across, a page that is larger than the viewport.
752
-
753
- When Eyes-Selenium takes a full page screenshot, it does so by taking multiple screenshots of the viewport at different locations of the page (via the Selenium browser driver), and then "stitching" them together. The output is one clear, potentially very large, screenshot of what can be revealed on the page when it is scrolled.
754
-
755
- There are two methods for creating the stitched screenshot, and they are both related to the way the page is moved relative to the viewport. Here they are:
756
-
757
- ##### 1. Stitch mode: Scroll
758
-
759
- Using this method, the page is scrolled, just as a user would scroll. Eyes-Selenium takes the viewport screenshot, then scrolls the page to calculated locations.
760
- The issue with this method is that the page might respond to scroll events, and change the way it appears visually between the screenshots.
761
-
762
- ##### 2. Stitch mode: CSS
763
-
764
- Using this method, the page is moved around by changing the CSS property `transform` on the HTML element with different values for `translate(x,y)`.
765
- This method is not sensitive to scroll events, and is usually the recommended method for stitching.
766
-
767
- ### Stitch overlap
768
-
769
- The stitch overlap is the length of the intersecting area between two screenshots that are stitched together. It's like placing two printed pictures one on top of the other with some overlapping area between them.
770
-
771
- This is useful in cases of fixed elements, like a footer, that show up in each of the sub-screenshots. Using a stitch overlap bigger than the size of the footer would make it disappear from every image, and only show up at the bottom of the full page screenshot.
772
-
773
- The default stitch overlap is 50 pixels. To change it:
774
-
775
- ```js
776
- eyes.setStitchOverlap(60)
777
- ```
778
-
779
- ### Match level
780
-
781
- The **match level** determines the way by which Eyes compares the checkpoint image with the baseline image.
782
-
783
- The default match level is `Strict`. To change it:
784
-
785
- ```js
786
- // Option 1: For the rest of the execution
787
- const {MatchLevel} = require('@applitools/eyes-selenium')
788
- eyes.setMatchLevel(MatchLevel.Layout)
789
-
790
- // Option 2: For a single checkpoint
791
- eyes.check(Target.window().layout())
792
- eyes.check(Target.window().strict())
793
- eyes.check(Target.window().content())
794
- eyes.check(Target.window().exact())
795
- ```
796
-
797
- _For more information, visit our documentation page: https://applitools.com/docs/common/cmn-eyes-match-levels.html_
798
-
799
- ### Ignore displacements
800
-
801
- By using **ignore displacements** you can hide diffs that arise from content whose position on the page has changed, and focus on mismatches caused by actual changes in the content.
802
-
803
- The default is `false`. To change it:
804
-
805
- ```js
806
- // For the rest of the execution
807
- eyes.setIgnoreDisplacements(true)
808
-
809
- // For a single checkpoint
810
- eyes.check(Target.window().ignoreDisplacements())
811
- ```
812
-
813
- _For more information, visit our documentation page: https://applitools.com/docs/topics/test-manager/viewers/tm-diff-displacement.html_
814
-
815
- ### Test properties
816
-
817
- It's possible to provide additional information about each test in custom fields, which can then show up in Test Manager in their own column.
818
-
819
- This is done by calling `setProperties` on the configuration, and providing it with an array of properties with the structure `{name, value}`. For example:
820
-
821
- ```js
822
- const {Eyes} = require('@applitools/eyes-selenium')
823
-
824
- const eyes = new Eyes()
825
-
826
- const configuration = eyes.getConfiguration()
827
- configuration.setProperties([{name: 'my custom property', value: 'some value'}])
828
- eyes.setConfiguration(configuration)
829
- ```
830
-
831
- The test properties could also be specified per batch by calling `setProperties` on the batch info, and providing it with an array of properties with the structure `{name, value}`. For example:
832
-
833
- ```js
834
- const {Eyes, BatchInfo} = require('@applitools/eyes-selenium')
835
-
836
- const eyes = new Eyes()
837
-
838
- const batch = new BatchInfo()
839
- batch.setProperties([{name: 'my custom batch property', value: 'some value'}])
840
-
841
- const configuration = eyes.getConfiguration()
842
- configuration.setBatch(batch)
843
- eyes.setConfiguration(configuration)
844
- ```
845
-
846
- ### Test results
847
-
848
- The results of the test can be consumed as the return value from `eyes.close`. Here's an example for creating a formatted output string out of the `TestResults` object:
849
-
850
- ```js
851
- function formatTestResults(testResults) {
852
- return `
853
- Test name : ${testResults.getName()}
854
- Test status : ${testResults.getStatus()}
855
- URL to results : ${testResults.getUrl()}
856
- Total number of steps : ${testResults.getSteps()}
857
- Number of matching steps : ${testResults.getMatches()}
858
- Number of visual diffs : ${testResults.getMismatches()}
859
- Number of missing steps : ${testResults.getMissing()}
860
- Display size : ${testResults.getHostDisplaySize().toString()}
861
- Steps :
862
- ${testResults
863
- .getStepsInfo()
864
- .map(step => {
865
- return ` ${step.getName()} - ${getStepStatus(step)}`
866
- })
867
- .join('\n')}`
868
- }
869
-
870
- function getStepStatus(step) {
871
- if (step.getIsDifferent()) {
872
- return 'Diff'
873
- } else if (!step.getHasBaselineImage()) {
874
- return 'New'
875
- } else if (!step.getHasCurrentImage()) {
876
- return 'Missing'
877
- } else {
878
- return 'Passed'
879
- }
880
- }
881
- ```
882
-
883
- _For the full list of methods, visit our documentation page: https://applitools.com/docs/api/eyes-sdk/index-gen/class-testresults-selenium4-javascript.html_
884
-
885
- ### Logging
886
-
887
- To enable logging to the console, use the `ConsoleLogHandler` class:
888
-
889
- ```js
890
- import {Eyes, ConsoleLogHandler} from '@applitools/eyes-selenium'
891
-
892
- const eyes = new Eyes()
893
- eyes.setLogHandler(new ConsoleLogHandler())
894
-
895
- // To enable verbose logging:
896
- eyes.setLogHandler(new ConsoleLogHandler(true))
897
- ```
898
-
899
- To write logs to file, use the `FileLogHandler` class. It's possible to configure the file path, verbosity, and whether to append to file.
900
-
901
- The API is as follows:
902
-
903
- ```js
904
- new FileLogHandler(isVerbose, filepath, append)
905
- ```
906
-
907
- Default values are:
908
-
909
- - `isVerbose`: `false`
910
- - `filepath`: `'eyes.log'`, meaning a file with this name will be created in the current working directory.
911
- - `append`: `true`, meaning that every test will append to the file instead of recreating it.
912
-
913
- For example:
914
-
915
- ```js
916
- const {Eyes, FileLogHandler} = require('@applitools/eyes-selenium')
917
- const path = require('path')
918
-
919
- const eyes = new Eyes()
920
-
921
- // append non-verbose logs to logs/eyes.log (relative to current working directory)
922
- eyes.setLogHandler(new FileLogHandler(false, path.resolve('logs', 'eyes.log')))
923
-
924
- // write verbose logs to a new file at logs/eyes-{timestamp}.log (relative to current working directory)
925
- eyes.setLogHandler(new FileLogHandler(true, path.resolve('logs', `eyes-${Date.now()}.log`), false))
926
- ```
927
-
928
- ### Configuring browsers for the Ultrafast grid
929
-
930
- When it comes to multiple browsers and mobile devices, the Ultrafast grid shines.
931
- It's now possible to run one functional test, and in the background have multiple screenshots rendered for different browsers, viewport sizes, and mobile devices.
932
-
933
- The API methods are:
934
-
935
- - `configuration.addBrowser(browser)` for adding a single browser configuration.
936
- - `configuration.addBrowsers(browser1, browser2, ...)` for adding single or multiple browser configurations.
937
-
938
- Here are examples for how to execute visual tests on different browsers and platforms:
939
-
940
- #### Desktop browsers
941
-
942
- ```js
943
- const {BrowserType} = require('@applitools/eyes-selenium')
944
- // ...
945
- const configuration = eyes.getConfiguration()
946
- configuration.addBrowsers(
947
- {name: BrowserType.EDGE_CHROMIUM, width: 768, height: 1024},
948
- {name: BrowserType.EDGE_LEGACY, width: 768, height: 1024},
949
- {name: BrowserType.FIREFOX, width: 768, height: 1024},
950
- {name: BrowserType.CHROME, width: 768, height: 1024},
951
- {name: BrowserType.IE_11, width: 768, height: 1024},
952
- {name: BrowserType.IE_10, width: 768, height: 1024},
953
- {name: BrowserType.SAFARI, width: 768, height: 1024},
954
- {name: BrowserType.CHROME_ONE_VERSION_BACK, width: 768, height: 1024},
955
- {name: BrowserType.CHROME_TWO_VERSIONS_BACK, width: 768, height: 1024},
956
- // ...
957
- )
958
- eyes.setConfiguration(configuration)
959
- ```
960
-
961
- #### Chrome device emulation
962
-
963
- Predefined device:
964
-
965
- ```js
966
- const {ScreenOrientation, DeviceName} = require('@applitools/eyes-selenium')
967
- // ...
968
- const configuration = eyes.getConfiguration()
969
- configuration.addBrowsers(
970
- {
971
- chromeEmulationInfo: {
972
- deviceName: DeviceName.iPhone_6_7_8,
973
- },
974
- },
975
- {
976
- chromeEmulationInfo: {
977
- deviceName: DeviceName.Galaxy_S9_Plus,
978
- screenOrientation: ScreenOrientation.LANDSCAPE,
979
- },
980
- },
981
- )
982
- eyes.setConfiguration(configuration)
983
- ```
984
-
985
- Custom device:
986
-
987
- ```js
988
- const configuration = eyes.getConfiguration()
989
- configuration.addBrowser({
990
- chromeEmulationInfo: {
991
- width: 800,
992
- height: 600,
993
- deviceScaleFactor: 3,
994
- },
995
- })
996
- eyes.setConfiguration(configuration)
997
- ```
998
-
999
- #### iOS device
1000
-
1001
- ```js
1002
- const {IosDeviceName, ScreenOrientation, IosVersion} = require('@applitools/eyes-selenium')
1003
- // ...
1004
- const configuration = eyes.getConfiguration()
1005
- configuration.addBrowser({
1006
- iosDeviceInfo: {
1007
- deviceName: IosDeviceName.iPhone_11,
1008
- screenOrientation: ScreenOrientation.LANDSCAPE, // optional, default: ScreenOrientation.PORTRAIT
1009
- iosVersion: IosVersion.LATEST // optional, default: undefined (i.e. the default is determined by the Ultrafast grid)
1010
- },
1011
- })
1012
- eyes.setConfiguration(configuration)
1013
- ```
1014
-
1015
- The list of devices is available at https://github.com/applitools/eyes.sdk.javascript1/blob/master/packages/eyes-api/src/enums/IosDeviceName.ts
1016
-
1017
- Possible values for `iosVersion` are:
1018
-
1019
- - `IosVersion.LATEST` - the latest iOS version that's supported by the UFG
1020
- - `IosVersion.LATEST_ONE_VERSION_BACK'` - one version prior to the latest version
1021
- - `undefined` - the UFG's default
10
+ ## Resources
11
+ - [Quick start](https://applitools.com/tutorials/quickstart/web/selenium/javascript)
12
+ - [API reference](https://applitools.com/docs/api-ref/sdk-api/selenium/javascript/)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applitools/eyes-selenium",
3
- "version": "4.67.3",
3
+ "version": "4.68.0",
4
4
  "description": "Applitools Eyes SDK for Selenium WebDriver",
5
5
  "keywords": [
6
6
  "eyes-selenium",
@@ -17,15 +17,7 @@
17
17
  "webdriver",
18
18
  "webdriverjs"
19
19
  ],
20
- "homepage": "https://applitools.com",
21
- "bugs": {
22
- "url": "https://github.com/applitools/eyes.sdk.javascript1/issues"
23
- },
24
- "repository": {
25
- "type": "git",
26
- "url": "git://github.com/applitools/eyes.sdk.javascript1.git",
27
- "directory": "js/packages/eyes-selenium"
28
- },
20
+ "homepage": "https://applitools.com/docs/api-ref/sdk-api/selenium/javascript/",
29
21
  "license": "SEE LICENSE IN LICENSE",
30
22
  "author": {
31
23
  "name": "Applitools Team",
@@ -49,13 +41,13 @@
49
41
  "up:framework": "yarn add --dev --caret selenium-webdriver${APPLITOOLS_FRAMEWORK_VERSION:+@$APPLITOOLS_FRAMEWORK_VERSION}"
50
42
  },
51
43
  "dependencies": {
52
- "@applitools/eyes": "1.7.3",
53
- "@applitools/spec-driver-selenium": "1.5.56"
44
+ "@applitools/eyes": "1.8.3",
45
+ "@applitools/spec-driver-selenium": "1.5.58"
54
46
  },
55
47
  "devDependencies": {
56
- "@applitools/api-extractor": "^1.2.21",
48
+ "@applitools/api-extractor": "^1.2.22",
57
49
  "@applitools/bongo": "^5.6.1",
58
- "@applitools/generic": "^3.3.9",
50
+ "@applitools/generic": "^3.3.10",
59
51
  "@applitools/test-utils": "^1.5.17",
60
52
  "@types/node": "^12.20.55",
61
53
  "@types/selenium-webdriver": "^4.1.1",
package/types/index.d.ts CHANGED
@@ -357,7 +357,21 @@ export type TargetAutomation = {
357
357
  webview(webview?: undefined | string): CheckSettingsAutomation;
358
358
  webview(webview?: undefined | boolean): CheckSettingsAutomation;
359
359
  };
360
+ export const TargetAutomation: {
361
+ window(): CheckSettingsAutomation;
362
+ region(region: (RegionPlain | (Element | (string | Selector | { selector: string | Selector; type?: undefined | string; shadow?: undefined | EyesSelector<Selector>; frame?: undefined | EyesSelector<Selector>; })))): CheckSettingsAutomation;
363
+ region(region: LegacyRegionPlain): CheckSettingsAutomation;
364
+ frame(context: { frame: number | (Element | (string | Selector | { selector: string | Selector; type?: undefined | string; shadow?: undefined | EyesSelector<Selector>; frame?: undefined | EyesSelector<Selector>; })); scrollRootElement?: undefined | (Element | (string | Selector | { selector: string | Selector; type?: undefined | string; shadow?: undefined | EyesSelector<Selector>; frame?: undefined | EyesSelector<Selector>; })); }): CheckSettingsAutomation;
365
+ frame(frame: number, scrollRootElement?: undefined | (Element | (string | Selector | { selector: string | Selector; type?: undefined | string; shadow?: undefined | EyesSelector<Selector>; frame?: undefined | EyesSelector<Selector>; }))): CheckSettingsAutomation;
366
+ frame(frame: (Element | (string | Selector | { selector: string | Selector; type?: undefined | string; shadow?: undefined | EyesSelector<Selector>; frame?: undefined | EyesSelector<Selector>; })), scrollRootElement?: undefined | (Element | (string | Selector | { selector: string | Selector; type?: undefined | string; shadow?: undefined | EyesSelector<Selector>; frame?: undefined | EyesSelector<Selector>; }))): CheckSettingsAutomation;
367
+ shadow(selector: string): CheckSettingsAutomation;
368
+ shadow(selector: Selector): CheckSettingsAutomation;
369
+ shadow(selector: { selector: string | Selector; type?: undefined | string; shadow?: undefined | EyesSelector<Selector>; frame?: undefined | EyesSelector<Selector>; }): CheckSettingsAutomation;
370
+ webview(webview?: undefined | string): CheckSettingsAutomation;
371
+ webview(webview?: undefined | boolean): CheckSettingsAutomation;
372
+ };
360
373
  export type Target = TargetImage & TargetAutomation;
374
+ export const Target: TargetImage & TargetAutomation;
361
375
  export type OCRRegion = { target: Element | RegionPlain | EyesSelector<Selector>; hint?: undefined | string; minMatch?: undefined | number; language?: undefined | string; };
362
376
  export type ConfigurationPlain = {
363
377
  debugScreenshots?: undefined | { save: boolean; path?: undefined | string; prefix?: undefined | string; };
@@ -774,33 +788,66 @@ export enum FailureReport {
774
788
  IMMEDIATE = 'IMMEDIATE',
775
789
  ON_CLOSE = 'ON_CLOSE'
776
790
  }
777
- export type IosDeviceNamePlain = "iPhone 11" | "iPhone 11 Pro" | "iPhone 11 Pro Max" | "iPhone X" | "iPhone XR" | "iPhone 14 Pro Max" | "iPhone 14" | "iPhone 13 Pro Max" | "iPhone 13 Pro" | "iPhone 13" | "iPhone 12 Pro Max" | "iPhone 12 Pro" | "iPhone 12" | "iPhone 12 mini" | "iPhone Xs" | "iPhone 8" | "iPhone 8 Plus" | "iPhone 7" | "iPhone SE (1st generation)" | "iPad Pro (12.9-inch) (3rd generation)" | "iPad Pro (11-inch) (4th generation)" | "iPad (7th generation)" | "iPad (9th generation)" | "iPad Air (2nd generation)" | "iPad Air (4th generation)";
791
+ export type IosDeviceNamePlain = "iPad Air 2" | "iPhone 11" | "iPhone 11 Pro" | "iPhone 11 Pro Max" | "iPhone X" | "iPhone XR" | "iPhone 6s" | "iPhone 6s Plus" | "iPhone 7" | "iPhone 7 Plus" | "iPhone 8" | "iPhone 8 Plus" | "iPhone Xs" | "iPhone Xs Max" | "iPhone 12" | "iPhone 12 mini" | "iPhone 12 Pro" | "iPhone 12 Pro Max" | "iPhone 13" | "iPhone 13 mini" | "iPhone 13 Pro" | "iPhone 13 Pro Max" | "iPhone 14" | "iPhone 14 Plus" | "iPhone 14 Pro" | "iPhone 14 Pro Max" | "iPhone SE (1st generation)" | "iPhone SE (2nd generation)" | "iPhone SE (3rd generation)" | "iPad (5th generation)" | "iPad (6th generation)" | "iPad (7th generation)" | "iPad (8th generation)" | "iPad (9th generation)" | "iPad (10th generation)" | "iPad Air (3rd generation)" | "iPad Air (4th generation)" | "iPad Air (5th generation)" | "iPad mini 4" | "iPad mini (5th generation)" | "iPad mini (6th generation)" | "iPad Pro (9.7-inch)" | "iPad Pro (10.5-inch)" | "iPad Pro (11-inch) (1st generation)" | "iPad Pro (12.9-inch) (1st generation)" | "iPad Pro (11-inch) (2nd generation)" | "iPad Pro (12.9-inch) (2nd generation)" | "iPad Pro (11-inch) (3rd generation)" | "iPad Pro (12.9-inch) (3rd generation)" | "iPad Pro (11-inch) (4th generation)" | "iPad Pro (12.9-inch) (4th generation)" | "iPad Pro (12.9-inch) (5th generation)" | "iPad Pro (12.9-inch) (6th generation)" | "iPod touch (7th generation)";
778
792
  export enum IosDeviceName {
779
- iPhone_14_Pro_Max = 'iPhone 14 Pro Max',
780
- iPhone_14 = 'iPhone 14',
781
- iPhone_13_Pro_Max = 'iPhone 13 Pro Max',
782
- iPhone_13_Pro = 'iPhone 13 Pro',
783
- iPhone_13 = 'iPhone 13',
784
- iPhone_12_Pro_Max = 'iPhone 12 Pro Max',
785
- iPhone_12_Pro = 'iPhone 12 Pro',
786
- iPhone_12 = 'iPhone 12',
787
- iPhone_12_mini = 'iPhone 12 mini',
788
- iPhone_11_Pro = 'iPhone 11 Pro',
789
- iPhone_11_Pro_Max = 'iPhone 11 Pro Max',
790
- iPhone_11 = 'iPhone 11',
791
- iPhone_XR = 'iPhone XR',
792
- iPhone_XS = 'iPhone Xs',
793
- iPhone_X = 'iPhone X',
793
+ iPhone_6s = 'iPhone 6s',
794
+ iPhone_6s_Plus = 'iPhone 6s Plus',
795
+ iPhone_7 = 'iPhone 7',
796
+ iPhone_7_Plus = 'iPhone 7 Plus',
794
797
  iPhone_8 = 'iPhone 8',
795
798
  iPhone_8_Plus = 'iPhone 8 Plus',
796
- iPhone_7 = 'iPhone 7',
799
+ iPhone_X = 'iPhone X',
800
+ iPhone_XR = 'iPhone XR',
801
+ iPhone_Xs = 'iPhone Xs',
802
+ iPhone_XS = 'iPhone Xs',
803
+ iPhone_Xs_Max = 'iPhone Xs Max',
804
+ iPhone_11 = 'iPhone 11',
805
+ iPhone_11_Pro = 'iPhone 11 Pro',
806
+ iPhone_11_Pro_Max = 'iPhone 11 Pro Max',
807
+ iPhone_12 = 'iPhone 12',
808
+ iPhone_12_mini = 'iPhone 12 mini',
809
+ iPhone_12_Pro = 'iPhone 12 Pro',
810
+ iPhone_12_Pro_Max = 'iPhone 12 Pro Max',
811
+ iPhone_13 = 'iPhone 13',
812
+ iPhone_13_mini = 'iPhone 13 mini',
813
+ iPhone_13_Pro = 'iPhone 13 Pro',
814
+ iPhone_13_Pro_Max = 'iPhone 13 Pro Max',
815
+ iPhone_14 = 'iPhone 14',
816
+ iPhone_14_Plus = 'iPhone 14 Plus',
817
+ iPhone_14_Pro = 'iPhone 14 Pro',
818
+ iPhone_14_Pro_Max = 'iPhone 14 Pro Max',
797
819
  iPhone_SE = 'iPhone SE (1st generation)',
798
- iPad_Pro_3 = 'iPad Pro (12.9-inch) (3rd generation)',
799
- iPad_Pro_4 = 'iPad Pro (11-inch) (4th generation)',
820
+ iPhone_SE_1 = 'iPhone SE (1st generation)',
821
+ iPhone_SE_2 = 'iPhone SE (2nd generation)',
822
+ iPhone_SE_3 = 'iPhone SE (3rd generation)',
823
+ iPad_5 = 'iPad (5th generation)',
824
+ iPad_6 = 'iPad (6th generation)',
800
825
  iPad_7 = 'iPad (7th generation)',
826
+ iPad_8 = 'iPad (8th generation)',
801
827
  iPad_9 = 'iPad (9th generation)',
802
- iPad_Air_2 = 'iPad Air (2nd generation)',
803
- iPad_Air_4 = 'iPad Air (4th generation)'
828
+ iPad_10 = 'iPad (10th generation)',
829
+ iPad_Air_2 = 'iPad Air 2',
830
+ iPad_Air_3 = 'iPad Air (3rd generation)',
831
+ iPad_Air_4 = 'iPad Air (4th generation)',
832
+ iPad_Air_5 = 'iPad Air (5th generation)',
833
+ iPad_mini_4 = 'iPad mini 4',
834
+ iPad_mini_5 = 'iPad mini (5th generation)',
835
+ iPad_mini_6 = 'iPad mini (6th generation)',
836
+ iPad_Pro_9_7_inch_1 = 'iPad Pro (9.7-inch)',
837
+ iPad_Pro_10_5_inch_1 = 'iPad Pro (10.5-inch)',
838
+ iPad_Pro_11_inch_1 = 'iPad Pro (11-inch) (1st generation)',
839
+ iPad_Pro_12_9_inch_1 = 'iPad Pro (12.9-inch) (1st generation)',
840
+ iPad_Pro_11_inch_2 = 'iPad Pro (11-inch) (2nd generation)',
841
+ iPad_Pro_12_9_inch_2 = 'iPad Pro (12.9-inch) (2nd generation)',
842
+ iPad_Pro_11_inch_3 = 'iPad Pro (11-inch) (3rd generation)',
843
+ iPad_Pro_12_9_inch_3 = 'iPad Pro (12.9-inch) (3rd generation)',
844
+ iPad_Pro_3 = 'iPad Pro (12.9-inch) (3rd generation)',
845
+ iPad_Pro_11_inch_4 = 'iPad Pro (11-inch) (4th generation)',
846
+ iPad_Pro_4 = 'iPad Pro (11-inch) (4th generation)',
847
+ iPad_Pro_12_9_inch_4 = 'iPad Pro (12.9-inch) (4th generation)',
848
+ iPad_Pro_12_9_inch_5 = 'iPad Pro (12.9-inch) (5th generation)',
849
+ iPad_Pro_12_9_inch_6 = 'iPad Pro (12.9-inch) (6th generation)',
850
+ iPod_touch_7 = 'iPod touch (7th generation)'
804
851
  }
805
852
  export type IosVersionPlain = AndroidVersionPlain;
806
853
  export enum IosVersion {
@@ -1145,6 +1192,16 @@ export type TargetImage = {
1145
1192
  url(imageUrl: string): CheckSettingsImage;
1146
1193
  url(imageUrl: URL): CheckSettingsImage;
1147
1194
  };
1195
+ export const TargetImage: {
1196
+ image(image: string): CheckSettingsImage;
1197
+ image(image: Buffer): CheckSettingsImage;
1198
+ image(image: URL): CheckSettingsImage;
1199
+ buffer(imageBuffer: Buffer): CheckSettingsImage;
1200
+ base64(imageBase64: string): CheckSettingsImage;
1201
+ path(imagePath: string): CheckSettingsImage;
1202
+ url(imageUrl: string): CheckSettingsImage;
1203
+ url(imageUrl: URL): CheckSettingsImage;
1204
+ };
1148
1205
  export type CutProviderPlain = { top: number; right: number; bottom: number; left: number; } | { x: number; y: number; width: number; height: number; };
1149
1206
  export class CutProvider implements Required<{
1150
1207
  x: number;