Refactor code#987
Merged
wswebcreation merged 30 commits intoJul 17, 2025
Merged
Conversation
- update saveFullPageScreen and tests
|
- implemented for saveWebScreen
was broken due to incorrect calculation, also fixed UT's
- afterscreenshot for readability
- make takeElementScreenshot more readable - fix UT for afterscreenshot - add check on calling logger for afterscreenshot
- adjust files - create UT's
- adjust methods - add and adjust UTs
- added buildBaseExecuteCompareOptions - added and adjusted UT's
- updated interfaces - made code more dry and maintainable - updated UTs
wswebcreation
marked this pull request as ready for review
July 17, 2025 15:32
wswebcreation
added a commit
that referenced
this pull request
Jul 22, 2025
* feat: add new package @wdio/image-comparison-core Started - migrating code - optimize types - remove executor and replace by wdio methods * feat: update getMobileViewPortPosition - fix tests * chore: replaced takeBase64Screenshot implementation - updated tests * chore: fixed afterScreenshot - updated tests * chore: updated beforeScreenshot - fixed and added UT's * chore: clean saveWebScreen from methods - fix UT's * chore: update checkScreen * chore: fix checkWebScreen * chore: fix saveElement and checkElement * chore: add full/tabbable page * chore: remove methods * chore: adjust the visual service to use the new core * chore: migrated the service to the new module - fixed UTs and imports * chore: add browserInstance to the commands * chore: added the browserinstance back and fix UTs * fix UT's * fix tests * chore: cleanup methods * chore: remove webdriver-image-comparison * chore: multiple fixes - fix BiDi check - fix determining iOS currentOffsets - fix calculating remaining content for mobile fullpage screenshots - add extra debug logging when the fullpage scroll becomes negative - updated baselines * chore: fix UT's * chore: optimize types * test: add tests vor checkAppElement * chore: make private package public * test: add checkAppScreen tests * tesT: add new tests * chore: refactor mocks * chore: simplify checks * test: add checkScreen tests * test: add checkTabbablePage * test: add checkWebElement fix some styling * chore: revert Sauce tests * test: add checkWebScreen * test: add checkWebScreen tests - some linting shit * chore: update eslint * test: add saveAppElement * chore: fix folders * chore: fix some tests * test: add saveAppScreen * test: add saveElement * tesT: add saveFullPageScreen test * test: add saveScreen tests * test: add saveTabbablePage tests * test: add saveWebElement tests * test: add saveWebScreen tests * chore: create BEFORE_SCREENSHOT_MOCK * chore: optimize mocks - saveWebElement - saveAppScreen - saveAppElement - saveWebScreen - saveTabbablePage - saveElement - mocks file * test: add drawTabbableOnCanvas tests * test: add more tests drawTabbableOnCanvas * test: add more tests for drawTabbableOnCanvas * test: update drawTabbableOnCanvas - add comments for whats's not properly testable * chore: added todo's * test: add scrollElementIntoView tests - fix screendimentions test * test: add scrollToPosition tests * test: add createCompareReport tests * test: add processDiffPixels * test: add makeCroppedBase64Image tests * test: add executeImageCompare tests * test: add makeFullPageBase64Image tests * test: add takeResizedBase64Screenshot tests * fix: fix object comparison and add proper logging for takeBase64ElementScreenshot - add new UT's for takeBase64ElementScreenshot part 1 * test: add more tests for takeBase64ElementScreenshot * fix: fix images tests * chore: use snapshots * test: add takeWebElementScreenshot tests * test: add logHiddenRemovedError * test: add getDesktopFullPageScreenshotsData * test: add getAndroidChromeDriverFullPageScreenshotsData * test: add getMobileFullPageNativeWebScreenshotsData * chore: some small fixes * Refactor code (#987) * feat: refactor getBase64FullPageScreenshotsData router - update ut's * chore: update tests * chore: refactor beforeOptions - update saveFullPageScreen and tests * feat: adjust saveWebScreen with createBeforeScreenshotOptions * feat: adjust saveWebElement for createBeforeScreenshotOptions * chore: optimise saveWebElement * chore: restructure interface * chore: refactor afterScreenshot options - implemented for saveWebScreen * chore: refactor for saveWebElement * chore: refactor saveFullPageScreen * chore: refactor saveAppScreen * chore: refactor saveAppElement * chore: refactor saveWebScreen * chore: refactor screenshot interfaces * chore: and the rest * chore: use snapshots for tests * fix: fallback for elementscreeshots was broken due to incorrect calculation, also fixed UT's * chore: fix local desktop run * chore: fix some comments * chore: code optimisation - afterscreenshot for readability * chore: optimisations - make takeElementScreenshot more readable - fix UT for afterscreenshot - add check on calling logger for afterscreenshot * chore: then also commit the afterscreenshot stuff * chore: refactor a CommonCheckVariables - adjust files - create UT's * chore: refactor to use buildFolderOptions - adjust methods - add and adjust UTs * chore: refactor methods options - added buildBaseExecuteCompareOptions - added and adjusted UT's * chore: refactor checkAppElement and checkAppScreen * chore: refactored images and report code - updated interfaces - made code more dry and maintainable - updated UTs * chore: fix linting * chore: fix build * Chore: remove comments * chore: update deps * chore: add release notes
wswebcreation
added a commit
that referenced
this pull request
Jul 22, 2025
* feat: add new package @wdio/image-comparison-core Started - migrating code - optimize types - remove executor and replace by wdio methods * feat: update getMobileViewPortPosition - fix tests * chore: replaced takeBase64Screenshot implementation - updated tests * chore: fixed afterScreenshot - updated tests * chore: updated beforeScreenshot - fixed and added UT's * chore: clean saveWebScreen from methods - fix UT's * chore: update checkScreen * chore: fix checkWebScreen * chore: fix saveElement and checkElement * chore: add full/tabbable page * chore: remove methods * chore: adjust the visual service to use the new core * chore: migrated the service to the new module - fixed UTs and imports * chore: add browserInstance to the commands * chore: added the browserinstance back and fix UTs * fix UT's * fix tests * chore: cleanup methods * chore: remove webdriver-image-comparison * chore: multiple fixes - fix BiDi check - fix determining iOS currentOffsets - fix calculating remaining content for mobile fullpage screenshots - add extra debug logging when the fullpage scroll becomes negative - updated baselines * chore: fix UT's * chore: optimize types * test: add tests vor checkAppElement * chore: make private package public * test: add checkAppScreen tests * tesT: add new tests * chore: refactor mocks * chore: simplify checks * test: add checkScreen tests * test: add checkTabbablePage * test: add checkWebElement fix some styling * chore: revert Sauce tests * test: add checkWebScreen * test: add checkWebScreen tests - some linting shit * chore: update eslint * test: add saveAppElement * chore: fix folders * chore: fix some tests * test: add saveAppScreen * test: add saveElement * tesT: add saveFullPageScreen test * test: add saveScreen tests * test: add saveTabbablePage tests * test: add saveWebElement tests * test: add saveWebScreen tests * chore: create BEFORE_SCREENSHOT_MOCK * chore: optimize mocks - saveWebElement - saveAppScreen - saveAppElement - saveWebScreen - saveTabbablePage - saveElement - mocks file * test: add drawTabbableOnCanvas tests * test: add more tests drawTabbableOnCanvas * test: add more tests for drawTabbableOnCanvas * test: update drawTabbableOnCanvas - add comments for whats's not properly testable * chore: added todo's * test: add scrollElementIntoView tests - fix screendimentions test * test: add scrollToPosition tests * test: add createCompareReport tests * test: add processDiffPixels * test: add makeCroppedBase64Image tests * test: add executeImageCompare tests * test: add makeFullPageBase64Image tests * test: add takeResizedBase64Screenshot tests * fix: fix object comparison and add proper logging for takeBase64ElementScreenshot - add new UT's for takeBase64ElementScreenshot part 1 * test: add more tests for takeBase64ElementScreenshot * fix: fix images tests * chore: use snapshots * test: add takeWebElementScreenshot tests * test: add logHiddenRemovedError * test: add getDesktopFullPageScreenshotsData * test: add getAndroidChromeDriverFullPageScreenshotsData * test: add getMobileFullPageNativeWebScreenshotsData * chore: some small fixes * Refactor code (#987) * feat: refactor getBase64FullPageScreenshotsData router - update ut's * chore: update tests * chore: refactor beforeOptions - update saveFullPageScreen and tests * feat: adjust saveWebScreen with createBeforeScreenshotOptions * feat: adjust saveWebElement for createBeforeScreenshotOptions * chore: optimise saveWebElement * chore: restructure interface * chore: refactor afterScreenshot options - implemented for saveWebScreen * chore: refactor for saveWebElement * chore: refactor saveFullPageScreen * chore: refactor saveAppScreen * chore: refactor saveAppElement * chore: refactor saveWebScreen * chore: refactor screenshot interfaces * chore: and the rest * chore: use snapshots for tests * fix: fallback for elementscreeshots was broken due to incorrect calculation, also fixed UT's * chore: fix local desktop run * chore: fix some comments * chore: code optimisation - afterscreenshot for readability * chore: optimisations - make takeElementScreenshot more readable - fix UT for afterscreenshot - add check on calling logger for afterscreenshot * chore: then also commit the afterscreenshot stuff * chore: refactor a CommonCheckVariables - adjust files - create UT's * chore: refactor to use buildFolderOptions - adjust methods - add and adjust UTs * chore: refactor methods options - added buildBaseExecuteCompareOptions - added and adjusted UT's * chore: refactor checkAppElement and checkAppScreen * chore: refactored images and report code - updated interfaces - made code more dry and maintainable - updated UTs * chore: fix linting * chore: fix build * Chore: remove comments * chore: update deps * chore: add release notes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request includes various updates to the
image-comparison-corepackage, including enhancements to folder and file path interfaces, improvements to test readability by removing redundant comments, and minor configuration updates. Below are the most important changes grouped by theme:Enhancements to Interfaces:
FolderPathsandFilePathsinterfaces inbase.interfaces.tsto provide clear definitions for folder and file paths used in image comparison workflows. These interfaces include properties for actual, baseline, and diff paths.Test Code Simplifications:
drawTabbableOnCanvastest file to improve readability and maintainability. This includes removing comments explaining mocked properties, DOM resets, and verification steps. [1] [2] [3]hideRemoveElements.test.tsby removing unnecessary comments that described straightforward assertions. [1] [2]Mocking and Configuration Updates:
rmSyncinbase.test.tsto streamline the mocking process while retaining the actual implementations of otherfsmethods..vitest-uito the ESLint ignore patterns ineslint.config.cjsto exclude Vitest UI artifacts from linting.These changes collectively enhance code clarity, maintainability, and functionality across the package.