@wdio/visual-service 9.2.2 → 9.2.4
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 +77 -0
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,82 @@
|
|
|
1
1
|
# @wdio/visual-service
|
|
2
2
|
|
|
3
|
+
## 9.2.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 60997df: fix: prevent false emulation detection when checkElement is called inside an iframe after switchFrame
|
|
8
|
+
|
|
9
|
+
### Committers: 1
|
|
10
|
+
|
|
11
|
+
- Taro.Nonoyama([@n2-freevas](https://github.com/n2-freevas))
|
|
12
|
+
|
|
13
|
+
- Updated dependencies [60997df]
|
|
14
|
+
- @wdio/image-comparison-core@1.2.4
|
|
15
|
+
|
|
16
|
+
## 9.2.3
|
|
17
|
+
|
|
18
|
+
### Patch Changes
|
|
19
|
+
|
|
20
|
+
- c56e1ae: ## #1146 Fix BiDi element screenshots missing composited layers (scrollbars, fixed/sticky overlays)
|
|
21
|
+
|
|
22
|
+
### Root cause
|
|
23
|
+
|
|
24
|
+
When `checkElement` / `saveElement` is used with the WebDriver BiDi protocol, the screenshot was taken with `browsingContext.captureScreenshot` using `origin: 'document'`. This renders the document layout independently of the browser's compositor, which means **composited layers are never included** — element-level scrollbars, `position: fixed` / `position: sticky` overlays, and elements with a `will-change` CSS property all render as invisible or without their correct visual state.
|
|
25
|
+
|
|
26
|
+
The switch to `origin: 'document'` was introduced in an earlier fix (commit `227f10a`) to avoid a `zero dimensions` error that occurred when `origin: 'viewport'` was used for elements that were outside the visible viewport. That fix was correct for out-of-viewport elements, but it also silently broke composited-layer capture for all elements.
|
|
27
|
+
|
|
28
|
+
### Fix: new `biDiOrigin` method option
|
|
29
|
+
|
|
30
|
+
A new **method-level** option `biDiOrigin` has been added to `saveElement` / `checkElement`. It is BiDi-only and ignored for the legacy WebDriver screenshot path.
|
|
31
|
+
|
|
32
|
+
| Value | Behaviour |
|
|
33
|
+
| ------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
34
|
+
| `'document'` _(default)_ | Previous behaviour — works for any element position but composited layers (scrollbars, overlays, `will-change`) are not captured |
|
|
35
|
+
| `'viewport'` | Captures the composited frame as the browser painted it — scrollbars, fixed/sticky overlays and `will-change` layers are included. The element must be visible in the viewport; descriptive errors are thrown when it is not |
|
|
36
|
+
|
|
37
|
+
#### Usage
|
|
38
|
+
|
|
39
|
+
```ts
|
|
40
|
+
// Capture an element with its scrollbar / overlay visible:
|
|
41
|
+
await browser.checkElement(element, "myTag", { biDiOrigin: "viewport" });
|
|
42
|
+
await browser.saveElement(element, "myTag", { biDiOrigin: "viewport" });
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
#### Error messages when `biDiOrigin: 'viewport'` cannot produce a valid screenshot
|
|
46
|
+
|
|
47
|
+
**Element larger than the viewport** — must fall back to `'document'`:
|
|
48
|
+
|
|
49
|
+
```
|
|
50
|
+
[BiDi viewport screenshot] The element dimensions (1400x800px) exceed the viewport (1280x720px).
|
|
51
|
+
You must use the default `biDiOrigin: 'document'` for this element.
|
|
52
|
+
Note: with `'document'` origin, composited layers such as scrollbars, fixed/sticky overlays,
|
|
53
|
+
and elements using `will-change` may not appear in the screenshot.
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
**Element not in the viewport at all** — needs scrolling:
|
|
57
|
+
|
|
58
|
+
```
|
|
59
|
+
[BiDi viewport screenshot] The element is not in the viewport
|
|
60
|
+
(element: x=0, y=900, 300x200px; viewport: 1280x720px).
|
|
61
|
+
Call `element.scrollIntoView()` before taking the screenshot, or set `autoElementScroll: true`.
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
**Element partially outside the viewport but fits** — needs to be scrolled fully into view:
|
|
65
|
+
|
|
66
|
+
```
|
|
67
|
+
[BiDi viewport screenshot] The element is not fully visible in the viewport
|
|
68
|
+
(element: x=-20, y=100, 300x200px; viewport: 1280x720px).
|
|
69
|
+
The element fits within the viewport — scroll it fully into view by calling
|
|
70
|
+
`element.scrollIntoView()` or setting `autoElementScroll: true`.
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### Committers: 1
|
|
74
|
+
|
|
75
|
+
- Wim Selles ([@wswebcreation](https://github.com/wswebcreation))
|
|
76
|
+
|
|
77
|
+
- Updated dependencies [c56e1ae]
|
|
78
|
+
- @wdio/image-comparison-core@1.2.3
|
|
79
|
+
|
|
3
80
|
## 9.2.2
|
|
4
81
|
|
|
5
82
|
### Patch Changes
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@wdio/visual-service",
|
|
3
3
|
"author": "Wim Selles - wswebcreation",
|
|
4
4
|
"description": "Image comparison / visual regression testing for WebdriverIO",
|
|
5
|
-
"version": "9.2.
|
|
5
|
+
"version": "9.2.4",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"homepage": "https://webdriver.io/docs/visual-testing",
|
|
8
8
|
"repository": {
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"@wdio/logger": "^9.18.0",
|
|
25
25
|
"@wdio/types": "^9.27.0",
|
|
26
26
|
"expect-webdriverio": "^5.6.5",
|
|
27
|
-
"@wdio/image-comparison-core": "1.2.
|
|
27
|
+
"@wdio/image-comparison-core": "1.2.4"
|
|
28
28
|
},
|
|
29
29
|
"scripts": {
|
|
30
30
|
"build": "run-s clean build:*",
|