@wdio/ocr-service 1.0.0 → 1.0.2

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,17 @@
1
1
  # @wdio/ocr-service
2
2
 
3
+ ## 1.0.2
4
+
5
+ ### Patch Changes
6
+
7
+ - 6e1e478: Fix contrast and languages
8
+
9
+ ## 1.0.1
10
+
11
+ ### Patch Changes
12
+
13
+ - 083ad82: Fixed OCR cli
14
+
3
15
  ## 1.0.0
4
16
 
5
17
  ### Major Changes
@@ -24,6 +36,6 @@
24
36
  - `ocrClickOnText`
25
37
  - `ocrSetValue`
26
38
 
27
- A CLI command will also be provided to pre-check text received from the image. For a demo check this video
39
+ A CLI command will also be provided to pre-check text received from the image, this can be run by using the command `npx ocr-service`. For a demo check this video
28
40
 
29
- https://github.com/webdriverio/visual-testing/assets/11979740/6e4677ba-1463-4d6e-98b0-9a3bf70b702f
41
+ https://github.com/webdriverio/visual-testing/assets/11979740/af001bd8-3068-43f5-8b44-b320174883a8
package/dist/cli.d.ts CHANGED
@@ -1,2 +1,3 @@
1
+ #!/usr/bin/env node
1
2
  export declare const CONFIG_HELPER_INTRO = "\n=============================\n\uD83E\uDD16 WDIO OCR-Service Wizard \uD83E\uDDD9\n=============================\n";
2
3
  //# sourceMappingURL=cli.d.ts.map
package/dist/cli.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,mBAAmB,wHAI/B,CAAA"}
1
+ {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAUA,eAAO,MAAM,mBAAmB,wHAI/B,CAAA"}
package/dist/cli.js CHANGED
@@ -1,3 +1,4 @@
1
+ #!/usr/bin/env node
1
2
  import inquirer from 'inquirer';
2
3
  import { existsSync, readdirSync, readFileSync } from 'node:fs';
3
4
  import { join, resolve } from 'node:path';
@@ -1 +1 @@
1
- {"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../src/service.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAgB5C,MAAM,CAAC,OAAO,OAAO,cAAc;;IAC/B,OAAO,CAAC,QAAQ,CAAC,CAAsD;IACvE,OAAO,CAAC,OAAO,CAAQ;IACvB,OAAO,CAAC,YAAY,CAAQ;IAC5B,OAAO,CAAC,YAAY,CAAQ;gBAEhB,OAAO,EAAE,UAAU;IAM/B;;OAEG;IACG,WAAW,CAAC,OAAO,EAAE,WAAW,CAAC,OAAO,GAAG,WAAW,CAAC,kBAAkB;IAIzE,MAAM,CACR,YAAY,EAAE,WAAW,CAAC,YAAY,EACtC,MAAM,EAAE,MAAM,EAAE,EAChB,OAAO,EAAE,WAAW,CAAC,OAAO,GAAG,WAAW,CAAC,kBAAkB;CA2EpE"}
1
+ {"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../src/service.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAgB5C,MAAM,CAAC,OAAO,OAAO,cAAc;;IAC/B,OAAO,CAAC,QAAQ,CAAC,CAAsD;IACvE,OAAO,CAAC,OAAO,CAAQ;IACvB,OAAO,CAAC,YAAY,CAAQ;IAC5B,OAAO,CAAC,YAAY,CAAQ;gBAEhB,OAAO,EAAE,UAAU;IAM/B;;OAEG;IACG,WAAW,CAAC,OAAO,EAAE,WAAW,CAAC,OAAO,GAAG,WAAW,CAAC,kBAAkB;IAIzE,MAAM,CACR,YAAY,EAAE,WAAW,CAAC,YAAY,EACtC,MAAM,EAAE,MAAM,EAAE,EAChB,OAAO,EAAE,WAAW,CAAC,OAAO,GAAG,WAAW,CAAC,kBAAkB;CA0EpE"}
package/dist/service.js CHANGED
@@ -53,15 +53,14 @@ export default class WdioOcrService {
53
53
  }
54
54
  /**
55
55
  * Add all OCR commands to the global browser object that will execute
56
- * on each browser in the Multi Remote. This involves mapping through both the visualElementCommands,
57
- * visualPageCommands, and ocrCommands.
56
+ * on each browser in the Multi Remote.
58
57
  */
59
58
  for (const command of Object.keys(ocrCommands)) {
60
59
  browser.addCommand(command, async function (...args) {
61
60
  const returnData = {};
62
61
  if (typeof args[0] === 'object' && args[0] !== null) {
63
62
  const options = args[0];
64
- options.contrast = options.contrast || self._ocrContrast;
63
+ options.contrast = options?.contrast || self._ocrContrast;
65
64
  args[0] = options;
66
65
  }
67
66
  for (const browserName of browserNames) {
@@ -86,9 +85,9 @@ export default class WdioOcrService {
86
85
  currentBrowser.addCommand(commandName, function (options) {
87
86
  return command({
88
87
  ...options,
89
- contrast: options.contrast || self._ocrContrast,
88
+ contrast: options?.contrast || self._ocrContrast,
90
89
  isTesseractAvailable,
91
- language: options.language || self._ocrLanguage,
90
+ language: options?.language || self._ocrLanguage,
92
91
  ocrImagesPath: self._ocrDir,
93
92
  });
94
93
  });
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": "1.0.0",
5
+ "version": "1.0.2",
6
6
  "license": "MIT",
7
7
  "homepage": "https://webdriver.io/docs/visual-testing",
8
8
  "repository": {