@applitools/screenshoter 3.12.4 → 3.12.6

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 CHANGED
@@ -1,5 +1,28 @@
1
1
  # Changelog
2
2
 
3
+ ## [3.12.6](https://github.com/Applitools-Dev/sdk/compare/js/screenshoter@3.12.5...js/screenshoter@3.12.6) (2025-10-01)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * wait after scroll | FLD-3594 ([#3252](https://github.com/Applitools-Dev/sdk/issues/3252)) ([e452422](https://github.com/Applitools-Dev/sdk/commit/e4524229b64e40d9b9596a92bfa94daf5824286a))
9
+
10
+ ## [3.12.5](https://github.com/Applitools-Dev/sdk/compare/js/screenshoter@3.12.4...js/screenshoter@3.12.5) (2025-09-16)
11
+
12
+
13
+ ### Dependencies
14
+
15
+ * @applitools/logger bumped to 2.2.4
16
+ #### Bug Fixes
17
+
18
+ * remove duplicate tests on different sessions for same batch ([#3184](https://github.com/Applitools-Dev/sdk/issues/3184)) ([ede0d1f](https://github.com/Applitools-Dev/sdk/commit/ede0d1fd8018e14c19811903d78c273bce048f84))
19
+ * @applitools/driver bumped to 1.23.5
20
+
21
+ * @applitools/spec-driver-webdriver bumped to 1.4.5
22
+
23
+ * @applitools/test-server bumped to 1.3.3
24
+
25
+
3
26
  ## [3.12.4](https://github.com/Applitools-Dev/sdk/compare/js/screenshoter@3.12.3...js/screenshoter@3.12.4) (2025-09-09)
4
27
 
5
28
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applitools/screenshoter",
3
- "version": "3.12.4",
3
+ "version": "3.12.6",
4
4
  "description": "Applitools universal screenshoter for web and native applications",
5
5
  "keywords": [
6
6
  "applitools",
@@ -57,13 +57,13 @@
57
57
  },
58
58
  "dependencies": {
59
59
  "@applitools/image": "1.2.3",
60
- "@applitools/logger": "2.2.3",
60
+ "@applitools/logger": "2.2.4",
61
61
  "@applitools/snippets": "2.7.0",
62
62
  "@applitools/utils": "1.12.0"
63
63
  },
64
64
  "devDependencies": {
65
- "@applitools/driver": "^1.23.4",
66
- "@applitools/spec-driver-webdriver": "^1.4.4",
65
+ "@applitools/driver": "^1.23.5",
66
+ "@applitools/spec-driver-webdriver": "^1.4.5",
67
67
  "@applitools/test-utils": "^1.5.17",
68
68
  "appium": "^1.22.3",
69
69
  "pixelmatch": "^5.3.0",
@@ -1,3 +1,4 @@
1
+ const handleWait = require('./utils/wait-handler')
1
2
  const utils = require('@applitools/utils')
2
3
  const makeTakeViewportScreenshot = require('./take-viewport-screenshot')
3
4
 
@@ -16,9 +17,7 @@ async function takeSimpleScreenshot({
16
17
  const driver = context.driver
17
18
  const takeViewportScreenshot = await makeTakeViewportScreenshot({logger, driver, stabilization, debug})
18
19
 
19
- if (typeof wait === 'function') await wait()
20
- // using `wait` as a number should not happen with new core versions, but we still support it for backward copatability
21
- else await utils.general.sleep(wait)
20
+ await handleWait(wait)
22
21
 
23
22
  const image = await takeViewportScreenshot({captureStatusBar, keepNavigationBar})
24
23
 
@@ -1,3 +1,4 @@
1
+ const handleWait = require('./utils/wait-handler')
1
2
  const utils = require('@applitools/utils')
2
3
  const {makeImage} = require('@applitools/image')
3
4
  const makeTakeViewportScreenshot = require('./take-viewport-screenshot')
@@ -32,9 +33,7 @@ async function takeStitchedScreenshot({
32
33
  const postMoveOffset = await scroller.moveTo(initialOffset)
33
34
  const expectedRemainingOffset = utils.geometry.offsetNegative(initialOffset, postMoveOffset)
34
35
 
35
- if (typeof wait === 'function') await wait()
36
- // using `wait` as a number should not happen with new core versions, but we still support it for backward copatability
37
- else await utils.general.sleep(wait)
36
+ await handleWait(wait)
38
37
 
39
38
  const contentSize = await scroller.getContentSize({lazyLoad})
40
39
 
@@ -135,7 +134,7 @@ async function takeStitchedScreenshot({
135
134
  logger.verbose('Actual offset is', actualOffset, ', remaining offset is', remainingOffset)
136
135
  logger.verbose('cropPartRegion is', cropPartRegion)
137
136
 
138
- await utils.general.sleep(wait)
137
+ await handleWait(wait)
139
138
 
140
139
  if (utils.geometry.isEmpty(cropPartRegion) || !utils.geometry.isIntersected(cropRegion, cropPartRegion)) continue
141
140
 
@@ -0,0 +1,14 @@
1
+ const utils = require('@applitools/utils')
2
+
3
+ /**
4
+ * Handles waiting for a specified duration or until a condition is met.
5
+ * using `wait` as a number should not happen with new core versions, but we still support it for backward compatibility
6
+ * @param {*} wait - The wait duration (in milliseconds) or a function that returns a promise.
7
+ *
8
+ */
9
+ async function handleWait(wait) {
10
+ if (typeof wait === 'function') await wait()
11
+ else await utils.general.sleep(wait)
12
+ }
13
+
14
+ module.exports = handleWait