webdriverio 8.16.3 → 8.16.5

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.
@@ -12,6 +12,13 @@
12
12
  });
13
13
  * </example>
14
14
  *
15
+ * When running from a hook, make sure to explicitly define the hook as async:
16
+ * <example>
17
+ :wdio.conf.js
18
+ afterTest: async function(test) {
19
+ await browser.saveScreenshot('./some/path/screenshot.png');
20
+ }
21
+ * </example>
15
22
  * @alias browser.saveScreenshot
16
23
  * @param {String} filepath path to the generated image (`.png` suffix is required) relative to the execution directory
17
24
  * @return {Buffer} screenshot buffer
@@ -1 +1 @@
1
- {"version":3,"file":"saveScreenshot.d.ts","sourceRoot":"","sources":["../../../src/commands/browser/saveScreenshot.ts"],"names":[],"mappings":";AAGA;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAsB,cAAc,CAChC,IAAI,EAAE,WAAW,CAAC,OAAO,EACzB,QAAQ,EAAE,MAAM,mBA0BnB"}
1
+ {"version":3,"file":"saveScreenshot.d.ts","sourceRoot":"","sources":["../../../src/commands/browser/saveScreenshot.ts"],"names":[],"mappings":";AAGA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAsB,cAAc,CAChC,IAAI,EAAE,WAAW,CAAC,OAAO,EACzB,QAAQ,EAAE,MAAM,mBA0BnB"}
@@ -13,6 +13,13 @@ import { getAbsoluteFilepath, assertDirectoryExists } from '../../utils/index.js
13
13
  });
14
14
  * </example>
15
15
  *
16
+ * When running from a hook, make sure to explicitly define the hook as async:
17
+ * <example>
18
+ :wdio.conf.js
19
+ afterTest: async function(test) {
20
+ await browser.saveScreenshot('./some/path/screenshot.png');
21
+ }
22
+ * </example>
16
23
  * @alias browser.saveScreenshot
17
24
  * @param {String} filepath path to the generated image (`.png` suffix is required) relative to the execution directory
18
25
  * @return {Buffer} screenshot buffer
@@ -1 +1 @@
1
- {"version":3,"file":"scrollIntoView.d.ts","sourceRoot":"","sources":["../../../src/commands/element/scrollIntoView.ts"],"names":[],"mappings":"AAsBA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAsB,cAAc,CAChC,IAAI,EAAE,WAAW,CAAC,OAAO,EACzB,OAAO,GAAE,qBAAqB,GAAG,OAA+C,iBA0EnF"}
1
+ {"version":3,"file":"scrollIntoView.d.ts","sourceRoot":"","sources":["../../../src/commands/element/scrollIntoView.ts"],"names":[],"mappings":"AAsBA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAsB,cAAc,CAChC,IAAI,EAAE,WAAW,CAAC,OAAO,EACzB,OAAO,GAAE,qBAAqB,GAAG,OAA+C,iBA2EnF"}
@@ -48,6 +48,8 @@ export async function scrollIntoView(options = { block: 'start', inline: 'neares
48
48
  let [windowX, windowY] = await browser.execute(() => [
49
49
  window.scrollX, window.scrollY
50
50
  ]);
51
+ const origScrollX = windowX;
52
+ const origScrollY = windowY;
51
53
  const origin = windowX === 0 && windowY === 0 ? this : undefined;
52
54
  windowX = elemRect.x <= viewport.width ? elemRect.x - 10 : viewport.width / 2;
53
55
  windowY = elemRect.y <= viewport.height ? elemRect.y - 10 : viewport.height / 2;
@@ -81,8 +83,8 @@ export async function scrollIntoView(options = { block: 'start', inline: 'neares
81
83
  windowY = 0;
82
84
  }
83
85
  else {
84
- deltaX = Math.round(deltaX - windowX);
85
- deltaY = Math.round(deltaY - windowY);
86
+ deltaX = Math.round(deltaX - origScrollX);
87
+ deltaY = Math.round(deltaY - origScrollY);
86
88
  windowX = Math.round(windowX);
87
89
  windowY = Math.round(windowY);
88
90
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "webdriverio",
3
3
  "description": "Next-gen browser and mobile automation test framework for Node.js",
4
- "version": "8.16.3",
4
+ "version": "8.16.5",
5
5
  "homepage": "https://webdriver.io",
6
6
  "author": "Christian Bromann <mail@bromann.dev>",
7
7
  "license": "MIT",
@@ -70,7 +70,7 @@
70
70
  "@types/node": "^20.1.0",
71
71
  "@wdio/config": "8.16.3",
72
72
  "@wdio/logger": "8.11.0",
73
- "@wdio/protocols": "8.14.6",
73
+ "@wdio/protocols": "8.16.5",
74
74
  "@wdio/repl": "8.10.1",
75
75
  "@wdio/types": "8.16.3",
76
76
  "@wdio/utils": "8.16.3",
@@ -90,7 +90,7 @@
90
90
  "resq": "^1.9.1",
91
91
  "rgb2hex": "0.2.5",
92
92
  "serialize-error": "^11.0.1",
93
- "webdriver": "8.16.3"
93
+ "webdriver": "8.16.5"
94
94
  },
95
95
  "peerDependencies": {
96
96
  "devtools": "^8.14.0"
@@ -100,5 +100,5 @@
100
100
  "optional": true
101
101
  }
102
102
  },
103
- "gitHead": "2c05558b0e4d6ecdca5eb7b0ed37d4a4e733b5a5"
103
+ "gitHead": "ca2069d80b7804bd4680850b92a6cd7b4fa4499f"
104
104
  }