@wdio/visual-service 9.1.6 → 9.2.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 +27 -0
- package/dist/types.d.ts +8 -5
- package/dist/types.d.ts.map +1 -1
- package/dist/utils.js +1 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,32 @@
|
|
|
1
1
|
# @wdio/visual-service
|
|
2
2
|
|
|
3
|
+
## 9.2.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 994f4da: ## #857 Support ignore regions for web screenshots
|
|
8
|
+
|
|
9
|
+
Add `ignore` support to all web screenshot methods (`saveScreen`/`checkScreen`, `saveElement`/`checkElement`, `saveFullPageScreen`/`checkFullPageScreen`) so that specified elements can be blocked out during visual comparison. This brings web parity with the native-app ignore-region support that already existed.
|
|
10
|
+
|
|
11
|
+
### Changes
|
|
12
|
+
|
|
13
|
+
- **Ignore regions for full-page screenshots:** new `determineWebFullPageIgnoreRegions` function that calculates ignore-region rectangles for full-page screenshots, including a `fullPageCropTopPaddingCSS` correction for mobile scroll-and-stitch scenarios where the address-bar shadow padding shifts element positions
|
|
14
|
+
- **Consolidated `ignoreRegionPadding`:** moved `ignoreRegionPadding` into `BaseWebScreenshotOptions` so it is inherited by all web methods instead of being duplicated per method
|
|
15
|
+
- **Fix `isAndroidNativeWebScreenshot` type:** ensure `nativeWebScreenshot` is always a boolean (was accidentally an object for LambdaTest capabilities), preventing ignore-region DPR scaling failures
|
|
16
|
+
- **Fix viewport rounding for mobile:** restore `Math.round()` in `injectWebviewOverlay` and remove `Math.min` clamping in `getMobileViewPortPosition` to prevent 1-pixel crop shifts during full-page stitching
|
|
17
|
+
- **Fix `scrollElementIntoView` for scrolled pages:** account for `currentPosition` (existing scroll offset) when computing the target scroll position, so elements are scrolled into view correctly when the page is already scrolled
|
|
18
|
+
- **Dismiss Chrome Start Surface on Android:** when Chrome's tab-overview UI blocks the webview overlay, automatically press the Android Back button (up to 4 retries) to restore the active tab before measuring the viewport
|
|
19
|
+
- **Add hybrid status bar blockout:** on hybrid apps the statusbar was not blocked out which could result in flaky tests regarding battery and reception
|
|
20
|
+
|
|
21
|
+
# Committers: 1
|
|
22
|
+
|
|
23
|
+
- Wim Selles ([@wswebcreation](https://github.com/wswebcreation))
|
|
24
|
+
|
|
25
|
+
### Patch Changes
|
|
26
|
+
|
|
27
|
+
- Updated dependencies [994f4da]
|
|
28
|
+
- @wdio/image-comparison-core@1.2.0
|
|
29
|
+
|
|
3
30
|
## 9.1.6
|
|
4
31
|
|
|
5
32
|
### Patch Changes
|
package/dist/types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { ScreenshotOutput, ImageCompareResult, CheckScreenMethodOptions, SaveScreenMethodOptions, CheckElementMethodOptions, SaveElementMethodOptions, CheckFullPageMethodOptions, SaveFullPageMethodOptions, ClassOptions, DeviceRectangles, TestContext, InstanceData, InternalSaveScreenMethodOptions, InternalCheckTabbablePageMethodOptions, InternalSaveElementMethodOptions, InternalSaveFullPageMethodOptions, InternalSaveTabbablePageMethodOptions, InternalCheckScreenMethodOptions, InternalCheckElementMethodOptions, InternalCheckFullPageMethodOptions } from '@wdio/image-comparison-core';
|
|
2
|
-
import type { ChainablePromiseElement } from 'webdriverio';
|
|
1
|
+
import type { ScreenshotOutput, ImageCompareResult, CheckScreenMethodOptions, SaveScreenMethodOptions, CheckElementMethodOptions, SaveElementMethodOptions, CheckFullPageMethodOptions, SaveFullPageMethodOptions, ClassOptions, DeviceRectangles, TestContext, InstanceData, InternalSaveScreenMethodOptions, InternalCheckTabbablePageMethodOptions, InternalSaveElementMethodOptions, InternalSaveFullPageMethodOptions, InternalSaveTabbablePageMethodOptions, InternalCheckScreenMethodOptions, InternalCheckElementMethodOptions, InternalCheckFullPageMethodOptions, ElementIgnore } from '@wdio/image-comparison-core';
|
|
2
|
+
import type { ChainablePromiseElement, ChainablePromiseArray } from 'webdriverio';
|
|
3
3
|
import type { ContextManager } from './contextManager.js';
|
|
4
4
|
import type { WaitForStorybookComponentToBeLoaded } from './storybook/Types.js';
|
|
5
5
|
type MultiOutput = {
|
|
@@ -49,17 +49,20 @@ export interface WdioIcsCommonOptions {
|
|
|
49
49
|
export interface WdioIcsScrollOptions extends WdioIcsCommonOptions {
|
|
50
50
|
hideAfterFirstScroll?: (WebdriverIO.Element | ChainablePromiseElement)[];
|
|
51
51
|
}
|
|
52
|
+
export interface WdioIcsIgnoreOptions {
|
|
53
|
+
ignore?: (ElementIgnore | ElementIgnore[] | WebdriverIO.ElementArray | ChainablePromiseArray)[];
|
|
54
|
+
}
|
|
52
55
|
export interface WdioSaveScreenMethodOptions extends Omit<SaveScreenMethodOptions, keyof WdioIcsCommonOptions>, WdioIcsCommonOptions {
|
|
53
56
|
}
|
|
54
57
|
export interface WdioSaveElementMethodOptions extends Omit<SaveElementMethodOptions, keyof WdioIcsCommonOptions>, WdioIcsCommonOptions {
|
|
55
58
|
}
|
|
56
59
|
export interface WdioSaveFullPageMethodOptions extends Omit<SaveFullPageMethodOptions, keyof WdioIcsScrollOptions>, WdioIcsScrollOptions {
|
|
57
60
|
}
|
|
58
|
-
export interface WdioCheckScreenMethodOptions extends Omit<CheckScreenMethodOptions, keyof WdioIcsCommonOptions>, WdioIcsCommonOptions {
|
|
61
|
+
export interface WdioCheckScreenMethodOptions extends Omit<CheckScreenMethodOptions, keyof WdioIcsCommonOptions | keyof WdioIcsIgnoreOptions>, WdioIcsCommonOptions, WdioIcsIgnoreOptions {
|
|
59
62
|
}
|
|
60
|
-
export interface WdioCheckElementMethodOptions extends Omit<CheckElementMethodOptions, keyof WdioIcsCommonOptions>, WdioIcsCommonOptions {
|
|
63
|
+
export interface WdioCheckElementMethodOptions extends Omit<CheckElementMethodOptions, keyof WdioIcsCommonOptions | keyof WdioIcsIgnoreOptions>, WdioIcsCommonOptions, WdioIcsIgnoreOptions {
|
|
61
64
|
}
|
|
62
|
-
export interface WdioCheckFullPageMethodOptions extends Omit<CheckFullPageMethodOptions, keyof WdioIcsScrollOptions>, WdioIcsScrollOptions {
|
|
65
|
+
export interface WdioCheckFullPageMethodOptions extends Omit<CheckFullPageMethodOptions, keyof WdioIcsScrollOptions | keyof WdioIcsIgnoreOptions>, WdioIcsScrollOptions, WdioIcsIgnoreOptions {
|
|
63
66
|
}
|
|
64
67
|
export interface VisualServiceOptions extends ClassOptions {
|
|
65
68
|
}
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,gBAAgB,EAChB,kBAAkB,EAClB,wBAAwB,EACxB,uBAAuB,EACvB,yBAAyB,EACzB,wBAAwB,EACxB,0BAA0B,EAC1B,yBAAyB,EACzB,YAAY,EACZ,gBAAgB,EAChB,WAAW,EACX,YAAY,EACZ,+BAA+B,EAC/B,sCAAsC,EACtC,gCAAgC,EAChC,iCAAiC,EACjC,qCAAqC,EACrC,gCAAgC,EAChC,iCAAiC,EACjC,kCAAkC,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,gBAAgB,EAChB,kBAAkB,EAClB,wBAAwB,EACxB,uBAAuB,EACvB,yBAAyB,EACzB,wBAAwB,EACxB,0BAA0B,EAC1B,yBAAyB,EACzB,YAAY,EACZ,gBAAgB,EAChB,WAAW,EACX,YAAY,EACZ,+BAA+B,EAC/B,sCAAsC,EACtC,gCAAgC,EAChC,iCAAiC,EACjC,qCAAqC,EACrC,gCAAgC,EAChC,iCAAiC,EACjC,kCAAkC,EAClC,aAAa,EAChB,MAAM,6BAA6B,CAAA;AACpC,OAAO,KAAK,EAAE,uBAAuB,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAA;AACjF,OAAO,KAAK,EAAE,c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AAyB,EAAE,MAAM,oBAAoB,GAAG,MAAM,oBAAoB,CAAC,EAAE,oBAAoB,EAAE,oBAAoB;CAAG;AAC9L,MAAM,WAAW,8BAA+B,SAAQ,IAAI,CAAC,0BAA0B,EAAE,MAAM,oBAAoB,GAAG,MAAM,oBAAoB,CAAC,EAAE,oBAAoB,EAAE,oBAAoB;CAAG;AAEhM,MAAM,WAAW,oBAAqB,SAAQ,YAAY;CAAI;AAE9D,MAAM,WAAW,UAAU;IACvB,UAAU,EAAE,CAAC,OAAO,EAAE,+BAA+B,KAAK,OAAO,CAAC,MAAM,CAAC,CAAA;IACzE,WAAW,EAAE,CAAC,OAAO,EAAE,gCAAgC,KAAK,OAAO,CAAC,MAAM,CAAC,CAAA;IAC3E,kBAAkB,EAAE,CAAC,OAAO,EAAE,iCAAiC,KAAK,OAAO,CAAC,MAAM,CAAC,CAAA;IACnF,gBAAgB,EAAE,CAAC,OAAO,EAAE,qCAAqC,KAAK,OAAO,CAAC,MAAM,CAAC,CAAA;IACrF,WAAW,EAAE,CAAC,OAAO,EAAE,gCAAgC,KAAK,OAAO,CAAC,MAAM,CAAC,CAAA;IAC3E,YAAY,EAAE,CAAC,OAAO,EAAE,iCAAiC,KAAK,OAAO,CAAC,MAAM,CAAC,CAAA;IAC7E,mBAAmB,EAAE,CAAC,OAAO,EAAE,kCAAkC,KAAK,OAAO,CAAC,MAAM,CAAC,CAAA;IACrF,iBAAiB,EAAE,CAAC,OAAO,EAAE,sCAAsC,KAAK,OAAO,CAAC,MAAM,CAAC,CAAA;IAEvF,mCAAmC,EAAE,CAAC,OAAO,EAAE,mCAAmC,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;CACvG"}
|
package/dist/utils.js
CHANGED
|
@@ -188,7 +188,7 @@ export async function getInstanceData({ browserInstance, initialDeviceRectangles
|
|
|
188
188
|
const ltOptions = getLtOptions(requestedCapabilities);
|
|
189
189
|
// @TODO: Figure this one out in the future when we know more about the Appium capabilities from LT
|
|
190
190
|
// 20241216: LT doesn't have the option to take a ChromeDriver screenshot, so if it's Android it's always native
|
|
191
|
-
const nativeWebScreenshot = isAndroid && ltOptions || !!getRequestedAppiumCapability(requestedCapabilities, 'nativeWebScreenshot');
|
|
191
|
+
const nativeWebScreenshot = !!(isAndroid && ltOptions) || !!getRequestedAppiumCapability(requestedCapabilities, 'nativeWebScreenshot');
|
|
192
192
|
const platformVersion = (rawPlatformVersion === undefined || rawPlatformVersion === '') ? NOT_KNOWN : rawPlatformVersion.toLowerCase();
|
|
193
193
|
const { devicePixelRatio: mobileDevicePixelRatio, deviceRectangles, } = await getMobileInstanceData({ browserInstance, initialDeviceRectangles, isNativeContext, nativeWebScreenshot });
|
|
194
194
|
devicePixelRatio = isMobile ? mobileDevicePixelRatio : devicePixelRatio;
|
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.
|
|
5
|
+
"version": "9.2.0",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"homepage": "https://webdriver.io/docs/visual-testing",
|
|
8
8
|
"repository": {
|
|
@@ -22,9 +22,9 @@
|
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"@wdio/globals": "^9.23.0",
|
|
24
24
|
"@wdio/logger": "^9.18.0",
|
|
25
|
-
"@wdio/types": "^9.
|
|
26
|
-
"expect-webdriverio": "^5.6.
|
|
27
|
-
"@wdio/image-comparison-core": "1.
|
|
25
|
+
"@wdio/types": "^9.25.0",
|
|
26
|
+
"expect-webdriverio": "^5.6.4",
|
|
27
|
+
"@wdio/image-comparison-core": "1.2.0"
|
|
28
28
|
},
|
|
29
29
|
"scripts": {
|
|
30
30
|
"build": "run-s clean build:*",
|