Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
3a90f87
feat: add new package @wdio/image-comparison-core
wswebcreation Jun 8, 2025
17f13e9
feat: update getMobileViewPortPosition
wswebcreation Jun 8, 2025
788379b
chore: replaced takeBase64Screenshot implementation
wswebcreation Jun 8, 2025
64a70fd
chore: fixed afterScreenshot
wswebcreation Jun 8, 2025
656b605
chore: updated beforeScreenshot
wswebcreation Jun 8, 2025
e7d24be
chore: clean saveWebScreen from methods
wswebcreation Jun 8, 2025
ea534d1
chore: update checkScreen
wswebcreation Jun 8, 2025
d45788d
chore: fix checkWebScreen
wswebcreation Jun 8, 2025
ce2924c
chore: fix saveElement and checkElement
wswebcreation Jun 8, 2025
465c237
chore: add full/tabbable page
wswebcreation Jun 8, 2025
b77d64a
chore: remove methods
wswebcreation Jun 8, 2025
fd08bab
chore: adjust the visual service to use the new core
wswebcreation Jun 8, 2025
4c02e6f
chore: migrated the service to the new module
wswebcreation Jun 8, 2025
bf53f12
chore: add browserInstance to the commands
wswebcreation Jun 8, 2025
e95aa5c
chore: added the browserinstance back and fix UTs
wswebcreation Jun 8, 2025
95dc2ae
fix UT's
wswebcreation Jun 8, 2025
90dfbef
fix tests
wswebcreation Jun 8, 2025
744ac3f
chore: cleanup methods
wswebcreation Jun 8, 2025
2ab6c0a
chore: remove webdriver-image-comparison
wswebcreation Jun 8, 2025
0f3c866
chore: multiple fixes
wswebcreation Jun 9, 2025
e955cdc
chore: fix UT's
wswebcreation Jun 9, 2025
816a4bb
chore: optimize types
wswebcreation Jun 9, 2025
e602d03
test: add tests vor checkAppElement
wswebcreation Jun 13, 2025
f90448c
chore: make private package public
wswebcreation Jun 13, 2025
9e3fe35
test: add checkAppScreen tests
wswebcreation Jun 13, 2025
8982a13
tesT: add new tests
wswebcreation Jun 13, 2025
90f61b3
chore: refactor mocks
wswebcreation Jun 13, 2025
bb4b1be
chore: simplify checks
wswebcreation Jun 13, 2025
3b00a1c
test: add checkScreen tests
wswebcreation Jun 13, 2025
812c15e
test: add checkTabbablePage
wswebcreation Jun 14, 2025
640dbe2
test: add checkWebElement
wswebcreation Jun 14, 2025
9e2f582
chore: revert Sauce tests
wswebcreation Jun 14, 2025
bb85362
test: add checkWebScreen
wswebcreation Jun 14, 2025
1f71dd7
test: add checkWebScreen tests
wswebcreation Jun 14, 2025
22db712
chore: update eslint
wswebcreation Jun 14, 2025
024ea95
test: add saveAppElement
wswebcreation Jun 14, 2025
8ecca36
chore: fix folders
wswebcreation Jun 14, 2025
0598825
chore: fix some tests
wswebcreation Jun 14, 2025
2271efa
test: add saveAppScreen
wswebcreation Jun 14, 2025
07a158c
test: add saveElement
wswebcreation Jun 14, 2025
c29a0d2
tesT: add saveFullPageScreen test
wswebcreation Jun 14, 2025
a4a55b6
test: add saveScreen tests
wswebcreation Jun 16, 2025
161fb34
test: add saveTabbablePage tests
wswebcreation Jun 16, 2025
25217ae
test: add saveWebElement tests
wswebcreation Jun 16, 2025
76af390
test: add saveWebScreen tests
wswebcreation Jun 16, 2025
103e869
chore: create BEFORE_SCREENSHOT_MOCK
wswebcreation Jun 16, 2025
d412d9b
chore: optimize mocks
wswebcreation Jun 16, 2025
9d22581
test: add drawTabbableOnCanvas tests
wswebcreation Jun 17, 2025
2ec9c98
test: add more tests drawTabbableOnCanvas
wswebcreation Jun 17, 2025
b54cf3d
test: add more tests for drawTabbableOnCanvas
wswebcreation Jun 17, 2025
9e90993
test: update drawTabbableOnCanvas
wswebcreation Jun 17, 2025
c2acf1a
chore: added todo's
wswebcreation Jun 17, 2025
4f1d58f
test: add scrollElementIntoView tests
wswebcreation Jun 17, 2025
ba3af64
test: add scrollToPosition tests
wswebcreation Jun 17, 2025
a5435e4
test: add createCompareReport tests
wswebcreation Jun 17, 2025
a6505b6
test: add processDiffPixels
wswebcreation Jun 18, 2025
ffcc1ca
test: add makeCroppedBase64Image tests
wswebcreation Jun 19, 2025
120e16d
test: add executeImageCompare tests
wswebcreation Jun 19, 2025
effd60e
test: add makeFullPageBase64Image tests
wswebcreation Jun 19, 2025
adbcf31
test: add takeResizedBase64Screenshot tests
wswebcreation Jun 19, 2025
61fecd0
fix: fix object comparison and add proper logging for takeBase64Eleme…
wswebcreation Jun 19, 2025
6484d58
test: add more tests for takeBase64ElementScreenshot
wswebcreation Jun 19, 2025
78e9899
fix: fix images tests
wswebcreation Jun 19, 2025
629fdc8
chore: use snapshots
wswebcreation Jun 20, 2025
cfcc1f2
test: add takeWebElementScreenshot tests
wswebcreation Jun 21, 2025
9a9a189
test: add logHiddenRemovedError
wswebcreation Jun 23, 2025
ef15aa9
test: add getDesktopFullPageScreenshotsData
wswebcreation Jun 23, 2025
1970366
test: add getAndroidChromeDriverFullPageScreenshotsData
wswebcreation Jun 23, 2025
36bf36f
test: add getMobileFullPageNativeWebScreenshotsData
wswebcreation Jun 24, 2025
37bb47a
chore: some small fixes
wswebcreation Jun 24, 2025
a7ec171
Refactor code (#987)
wswebcreation Jul 17, 2025
bc57beb
chore: update deps
wswebcreation Jul 18, 2025
63738a7
chore: add release notes
wswebcreation Jul 18, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 76 additions & 0 deletions .changeset/shy-coins-drive.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
---
"@wdio/image-comparison-core": major
"@wdio/visual-service": major
"@wdio/visual-reporter": patch
"@wdio/ocr-service": patch
---

## πŸ’₯ Major Release: New @wdio/image-comparison-core Package

### πŸ—οΈ Architectural Refactor

This release introduces a **completely new core architecture** with the dedicated `@wdio/image-comparison-core` package, replacing the generic `webdriver-image-comparison` module with a WDIO-specific solution.

#### What was the problem?
- The old `webdriver-image-comparison` package was designed for generic webdriver usage
- Complex integration between generic and WDIO-specific code
- Limited test coverage (~58%) making maintenance difficult
- Mixed responsibilities between core logic and service integration

#### What changed?
βœ… **New dedicated core package**: `@wdio/image-comparison-core` - purpose-built for WebdriverIO
βœ… **Cleaner architecture**: Modular design with clear separation of concerns
βœ… **Enhanced test coverage**: Improved from ~58% to ~90% across all metrics
βœ… **Better maintainability**: Organized codebase with comprehensive TypeScript interfaces
βœ… **WDIO-specific dependencies**: Only depends on `@wdio/logger`, `@wdio/types`, etc.

### πŸ§ͺ Testing Improvements

- **100% branch coverage** on critical decision points
- **Comprehensive unit tests** for all major functions
- **Optimized mocks** for complex scenarios
- **Better test isolation** and reliability

| Before/After | % Stmts | % Branch | % Funcs | % Lines |
| ------------ | ------- | -------- | ------- | ------- |
| **Previous** | 58.59 | 91.4 | 80.71 | 58.59 |
| **After refactor** | 90.55 | 96.38 | 93.99 | 90.55 |

### πŸ”§ Service Integration

The `@wdio/visual-service` now imports from the new `@wdio/image-comparison-core` package while maintaining the same public API and functionality for users.

### πŸ“ˆ Performance & Quality

- **Modular architecture**: Easier to maintain and extend
- **Type safety**: Comprehensive TypeScript coverage
- **Clean exports**: Well-defined public API
- **Internal interfaces**: Proper separation of concerns

### πŸ”„ Backward Compatibility

βœ… **No breaking changes** for end users
βœ… **Same public API** maintained
βœ… **Existing configurations** continue to work
βœ… **All existing functionality** preserved

### 🎯 Future Benefits

This refactor sets the foundation for:
- Easier addition of new features
- Better bug fixing capabilities
- Enhanced mobile and native app support
- More reliable MultiRemote functionality

### πŸ“¦ Dependency Updates
- Updated most dependencies to their latest versions
- Improved security with latest package versions
- Better compatibility with current WebdriverIO ecosystem
- Enhanced performance through updated dependencies

---

**Note**: This is an architectural improvement that modernizes the codebase while maintaining full backward compatibility. All existing functionality remains unchanged for users.

---

1 change: 1 addition & 0 deletions eslint.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ module.exports = [
'**/dist/*',
'**/build/*',
'**/.next/*',
'**/.vitest-ui/*',
]
},
{
Expand Down
57 changes: 26 additions & 31 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,50 +51,45 @@
"prepare": "husky",
"watch": "pnpm run -r --parallel watch"
},
"dependencies": {
"@wdio/ocr-service": "workspace:*",
"@wdio/visual-service": "workspace:*",
"webdriver-image-comparison": "workspace:*"
},
"devDependencies": {
"@changesets/cli": "^2.29.4",
"@tsconfig/node20": "^20.1.5",
"@changesets/cli": "^2.29.5",
"@tsconfig/node20": "^20.1.6",
"@types/eslint": "^9.6.1",
"@types/inquirer": "^9.0.8",
"@types/jsdom": "~21.1.7",
"@types/node": "^22",
"@types/node": "^24",
"@types/xml2js": "~0.4.14",
"@typescript-eslint/eslint-plugin": "^8.32.0",
"@wdio/globals": "^9.13.0",
"@wdio/mocha-framework": "^9.14.0",
"@typescript-eslint/parser": "^8.32.0",
"@typescript-eslint/utils": "^8.31.1",
"@vitest/coverage-v8": "^3.1.1",
"@vitest/ui": "^3.1.1",
"@wdio/appium-service": "^9.13.0",
"@wdio/browserstack-service": "^9.14.0",
"@wdio/cli": "^9.14.0",
"@wdio/local-runner": "^9.14.0",
"@wdio/sauce-service": "^9.14.0",
"@wdio/shared-store-service": "^9.14.0",
"@wdio/spec-reporter": "^9.14.0",
"@wdio/types": "^9.14.0",
"@typescript-eslint/eslint-plugin": "^8.37.0",
"@wdio/globals": "^9.17.0",
"@wdio/mocha-framework": "^9.18.0",
"@typescript-eslint/parser": "^8.37.0",
"@typescript-eslint/utils": "^8.37.0",
"@vitest/coverage-v8": "^3.2.4",
"@vitest/ui": "^3.2.4",
"@wdio/appium-service": "^9.18.1",
"@wdio/browserstack-service": "^9.18.1",
"@wdio/cli": "^9.18.1",
"@wdio/local-runner": "^9.18.1",
"@wdio/sauce-service": "^9.18.1",
"@wdio/shared-store-service": "^9.18.1",
"@wdio/spec-reporter": "^9.18.0",
"@wdio/types": "^9.16.2",
"cross-env": "^7.0.3",
"eslint": "^9.27.0",
"eslint-plugin-import": "^2.31.0",
"eslint": "^9.31.0",
"eslint-plugin-import": "^2.32.0",
"eslint-plugin-unicorn": "^56.0.1",
"eslint-plugin-wdio": "^9.9.1",
"eslint-plugin-wdio": "^9.16.2",
"husky": "^9.1.7",
"jsdom": "^26.1.0",
"npm-run-all2": "^7.0.2",
"release-it": "^18.1.2",
"npm-run-all2": "^8.0.4",
"release-it": "^19.0.4",
"rimraf": "^6.0.1",
"saucelabs": "^9.0.2",
"ts-node": "^10.9.2",
"typescript": "^5.8.3",
"vitest": "^3.1.1",
"webdriverio": "^9.14.0",
"vitest": "^3.2.4",
"webdriverio": "^9.18.1",
"wdio-lambdatest-service": "^4.0.0"
},
"packageManager": "[email protected]+sha256.cf86a7ad764406395d4286a6d09d730711720acc6d93e9dce9ac7ac4dc4a28a7"
}
}
12 changes: 12 additions & 0 deletions packages/image-comparison-core/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
WebdriverIO Image Comparison Core
==========================

## Installation

The easiest way is to keep `@wdio/image-comparison-core` as a dev-dependency in your `package.json`, via:

```sh
npm install @wdio/image-comparison-core --save-dev
```

Instructions on how to get started can be found in the [visual testing](https://webdriver.io/docs/visual-testing) docs on the WebdriverIO project page.
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
{
"name": "webdriver-image-comparison",
"version": "9.0.4",
"name": "@wdio/image-comparison-core",
"version": "0.0.1",
"author": "Wim Selles - wswebcreation",
"description": "An image compare module that can be used for different NodeJS Test automation frameworks that support the webdriver protocol",
"keywords": [],
"description": "Image comparison core module for @wdio/visual-service - WebdriverIO visual testing framework",
"keywords": [
"webdriverio",
"wdio",
"visual-testing",
"image-comparison",
"screenshot",
"visual-regression",
"testing",
"automation"
],
"license": "MIT",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
Expand All @@ -27,10 +36,14 @@
"dependencies": {
"fs-extra": "^11.3.0",
"jimp": "^1.6.0",
"@wdio/logger": "^9.4.4"
"@wdio/logger": "^9.18.0",
"@wdio/types": "^9.16.2"
},
"devDependencies": {
"@types/fs-extra": "^11.0.4",
"webdriverio": "^9.14.0"
"webdriverio": "^9.18.1"
},
"publishConfig": {
"access": "public"
}
}
}
Loading