diff --git a/.changeset/fix-await-element-before-execute.md b/.changeset/fix-await-element-before-execute.md deleted file mode 100644 index 438bdf32..00000000 --- a/.changeset/fix-await-element-before-execute.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -"@wdio/image-comparison-core": patch ---- - -## #1129 Fix `TypeError: element.getBoundingClientRect is not a function` when a `ChainablePromiseElement` is passed to `checkElement` - -When `checkElement` (or `saveElement`) was called with a `ChainablePromiseElement`, the lazy promise-based element reference that WebdriverIO's `$()` returns, the element was passed directly as an argument to `browser.execute()` without being awaited first. `browser.execute()` serializes its arguments for transfer to the browser context and cannot handle a pending Promise, so it arrived in the browser as a plain empty object `{}` instead of a WebElement reference. This caused `element.getBoundingClientRect is not a function` because the browser-side `scrollElementIntoView` script received `{}` rather than a DOM element. - -# Committers: 1 - -- Wim Selles ([@wswebcreation](https://github.com/wswebcreation)) diff --git a/packages/image-comparison-core/CHANGELOG.md b/packages/image-comparison-core/CHANGELOG.md index e202523c..54d6b5e5 100644 --- a/packages/image-comparison-core/CHANGELOG.md +++ b/packages/image-comparison-core/CHANGELOG.md @@ -1,5 +1,17 @@ # @wdio/image-comparison-core +## 1.2.1 + +### Patch Changes + +- d5afb54: ## #1129 Fix `TypeError: element.getBoundingClientRect is not a function` when a `ChainablePromiseElement` is passed to `checkElement` + + When `checkElement` (or `saveElement`) was called with a `ChainablePromiseElement`, the lazy promise-based element reference that WebdriverIO's `$()` returns, the element was passed directly as an argument to `browser.execute()` without being awaited first. `browser.execute()` serializes its arguments for transfer to the browser context and cannot handle a pending Promise, so it arrived in the browser as a plain empty object `{}` instead of a WebElement reference. This caused `element.getBoundingClientRect is not a function` because the browser-side `scrollElementIntoView` script received `{}` rather than a DOM element. + + # Committers: 1 + + - Wim Selles ([@wswebcreation](https://github.com/wswebcreation)) + ## 1.2.0 ### Minor Changes diff --git a/packages/image-comparison-core/package.json b/packages/image-comparison-core/package.json index ff37ef6c..f6d0e163 100644 --- a/packages/image-comparison-core/package.json +++ b/packages/image-comparison-core/package.json @@ -1,6 +1,6 @@ { "name": "@wdio/image-comparison-core", - "version": "1.2.0", + "version": "1.2.1", "author": "Wim Selles - wswebcreation", "description": "Image comparison core module for @wdio/visual-service - WebdriverIO visual testing framework", "keywords": [ diff --git a/packages/visual-service/CHANGELOG.md b/packages/visual-service/CHANGELOG.md index 57ec0d6a..803ad8c6 100644 --- a/packages/visual-service/CHANGELOG.md +++ b/packages/visual-service/CHANGELOG.md @@ -1,5 +1,19 @@ # @wdio/visual-service +## 9.2.1 + +### Patch Changes +- d5afb54: ## #1129 Fix `TypeError: element.getBoundingClientRect is not a function` when a `ChainablePromiseElement` is passed to `checkElement` + + When `checkElement` (or `saveElement`) was called with a `ChainablePromiseElement`, the lazy promise-based element reference that WebdriverIO's `$()` returns, the element was passed directly as an argument to `browser.execute()` without being awaited first. `browser.execute()` serializes its arguments for transfer to the browser context and cannot handle a pending Promise, so it arrived in the browser as a plain empty object `{}` instead of a WebElement reference. This caused `element.getBoundingClientRect is not a function` because the browser-side `scrollElementIntoView` script received `{}` rather than a DOM element. + + # Committers: 1 + + - Wim Selles ([@wswebcreation](https://github.com/wswebcreation)) + +- Updated dependencies [d5afb54] + - @wdio/image-comparison-core@1.2.1 + ## 9.2.0 ### Minor Changes diff --git a/packages/visual-service/package.json b/packages/visual-service/package.json index 70594ebd..8d6822df 100644 --- a/packages/visual-service/package.json +++ b/packages/visual-service/package.json @@ -2,7 +2,7 @@ "name": "@wdio/visual-service", "author": "Wim Selles - wswebcreation", "description": "Image comparison / visual regression testing for WebdriverIO", - "version": "9.2.0", + "version": "9.2.1", "license": "MIT", "homepage": "https://webdriver.io/docs/visual-testing", "repository": {