@wdio/ocr-service 1.0.1 → 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 +8 -2
- package/dist/service.d.ts.map +1 -1
- package/dist/service.js +4 -5
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @wdio/ocr-service
|
|
2
2
|
|
|
3
|
+
## 1.0.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 6e1e478: Fix contrast and languages
|
|
8
|
+
|
|
3
9
|
## 1.0.1
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
|
@@ -30,6 +36,6 @@
|
|
|
30
36
|
- `ocrClickOnText`
|
|
31
37
|
- `ocrSetValue`
|
|
32
38
|
|
|
33
|
-
|
|
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
|
|
34
40
|
|
|
35
|
-
|
|
41
|
+
https://github.com/webdriverio/visual-testing/assets/11979740/af001bd8-3068-43f5-8b44-b320174883a8
|
package/dist/service.d.ts.map
CHANGED
|
@@ -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;
|
|
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.
|
|
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
|
|
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
|
|
88
|
+
contrast: options?.contrast || self._ocrContrast,
|
|
90
89
|
isTesseractAvailable,
|
|
91
|
-
language: options
|
|
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.
|
|
5
|
+
"version": "1.0.2",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"homepage": "https://webdriver.io/docs/visual-testing",
|
|
8
8
|
"repository": {
|