@wdio/ocr-service 2.2.4 → 2.2.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,29 @@
1
1
  # @wdio/ocr-service
2
2
 
3
+ ## 2.2.6
4
+
5
+ ### Patch Changes
6
+
7
+ - 42956e4: 🔧 Other
8
+
9
+ - 🆙 Updated dependencies
10
+
11
+ ***
12
+
13
+ ## Committers: 1
14
+
15
+ - Wim Selles ([@wswebcreation](https://github.com/wswebcreation))
16
+
17
+ ## 2.2.5
18
+
19
+ ### Patch Changes
20
+
21
+ - 09dbc2d: update deps
22
+
23
+ ### Committers: 1
24
+
25
+ - Wim Selles ([@wswebcreation](https://github.com/wswebcreation))
26
+
3
27
  ## 2.2.4
4
28
 
5
29
  ### Patch Changes
@@ -7,6 +31,7 @@
7
31
  - 69d25fe: Multiple fixes:
8
32
 
9
33
  - update deps
34
+
10
35
  ## 2.2.3
11
36
 
12
37
  ### Patch Changes
@@ -1,6 +1,6 @@
1
1
  import logger from '@wdio/logger';
2
2
  import { getNodeOcrData, getSystemOcrData } from './tesseract.js';
3
- import { adjustElementBbox, getScreenshotSize, isRectanglesObject } from './index.js';
3
+ import { adjustElementBbox, getBase64ScreenshotSize, isRectanglesObject } from './index.js';
4
4
  import { drawHighlightedWords, processImage } from './imageProcessing.js';
5
5
  const log = logger('@wdio/ocr-service:getData');
6
6
  export default async function getData(browser, options) {
@@ -11,7 +11,7 @@ export default async function getData(browser, options) {
11
11
  if (!cliFile) {
12
12
  const screenSize = await browser.getWindowSize();
13
13
  screenshot = await browser.takeScreenshot();
14
- const { width } = getScreenshotSize(screenshot);
14
+ const { width } = getBase64ScreenshotSize(screenshot);
15
15
  dpr = width / screenSize.width;
16
16
  }
17
17
  else {
@@ -1,6 +1,6 @@
1
1
  import type { ChainablePromiseElement } from 'webdriverio';
2
2
  import type { ClickPoint, DetermineClickPointOptions, Rectangles, RectReturn, ScreenshotSize } from '../types.js';
3
- export declare function getScreenshotSize(screenshot: string): ScreenshotSize;
3
+ export declare function getBase64ScreenshotSize(screenshot: string): ScreenshotSize;
4
4
  export declare function getDprPositions(values: Rectangles, dpr: number): Rectangles;
5
5
  /**
6
6
  * Determine the click point
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAA;AAC1D,OAAO,KAAK,EAAE,UAAU,EAAE,0BAA0B,EAAE,UAAU,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAEjH,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,MAAM,GAAG,cAAc,CAKpE;AAED,wBAAgB,eAAe,CAAC,MAAM,EAAE,UAAU,EAAE,GAAG,EAAE,MAAM,GAAG,UAAU,CAO3E;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,0BAA0B,GAAG,UAAU,CAMnF;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,UAAU,EAAE,WAAW,EAAE,UAAU,GAAG,UAAU,CAOvF;AAED,wBAAgB,YAAY,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAKvD;AAED,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,WAAW,CAAC,OAAO,GAAG,uBAAuB,GAAG,UAAU,GAAG,OAAO,CAM3G"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAA;AAC1D,OAAO,KAAK,EAAE,UAAU,EAAE,0BAA0B,EAAE,UAAU,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAEjH,wBAAgB,uBAAuB,CAAC,UAAU,EAAE,MAAM,GAAG,cAAc,CAK1E;AAED,wBAAgB,eAAe,CAAC,MAAM,EAAE,UAAU,EAAE,GAAG,EAAE,MAAM,GAAG,UAAU,CAO3E;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,0BAA0B,GAAG,UAAU,CAMnF;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,UAAU,EAAE,WAAW,EAAE,UAAU,GAAG,UAAU,CAOvF;AAED,wBAAgB,YAAY,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAKvD;AAED,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,WAAW,CAAC,OAAO,GAAG,uBAAuB,GAAG,UAAU,GAAG,OAAO,CAM3G"}
@@ -1,6 +1,6 @@
1
1
  import { join } from 'node:path';
2
2
  import { mkdirSync } from 'node:fs';
3
- export function getScreenshotSize(screenshot) {
3
+ export function getBase64ScreenshotSize(screenshot) {
4
4
  return {
5
5
  height: Math.round(Buffer.from(screenshot, 'base64').readUInt32BE(20)),
6
6
  width: Math.round(Buffer.from(screenshot, 'base64').readUInt32BE(16)),
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@wdio/ocr-service",
3
3
  "author": "Wim Selles - wswebcreation",
4
4
  "description": "A WebdriverIO service that is using Tesseract OCR for Desktop/Mobile Web and Mobile Native App tests.",
5
- "version": "2.2.4",
5
+ "version": "2.2.6",
6
6
  "license": "MIT",
7
7
  "homepage": "https://webdriver.io/docs/visual-testing",
8
8
  "repository": {
@@ -22,11 +22,11 @@
22
22
  "type": "module",
23
23
  "types": "./dist/index.d.ts",
24
24
  "dependencies": {
25
- "@wdio/globals": "^9.7.1",
25
+ "@wdio/globals": "^9.12.6",
26
26
  "@wdio/logger": "^9.4.4",
27
- "@wdio/types": "^9.6.3",
28
- "fuse.js": "^7.0.0",
29
- "@inquirer/prompts": "7.2.3",
27
+ "@wdio/types": "^9.12.6",
28
+ "fuse.js": "^7.1.0",
29
+ "@inquirer/prompts": "7.4.1",
30
30
  "jimp": "^1.6.0",
31
31
  "node-tesseract-ocr": "^2.2.1",
32
32
  "tesseract.js": "^5.1.1",