# HG changeset patch # User Edouard Tisserant # Date 1691425032 -7200 # Node ID 3922024076b3da446834c86549475a93ed9ccbfa # Parent 02fa0f8484d7d44f4bebad463a3686956a0769a9 Tests: revert Teseract to less perforant legacy mode, but more repeatable. Compensate with zoom in edit_project and filter noise out of OCR text. diff -r 02fa0f8484d7 -r 3922024076b3 tests/ide_tests/edit_project.sikuli/edit_project.py --- a/tests/ide_tests/edit_project.sikuli/edit_project.py Tue Aug 01 23:07:39 2023 +0200 +++ b/tests/ide_tests/edit_project.sikuli/edit_project.py Mon Aug 07 18:17:12 2023 +0200 @@ -23,6 +23,9 @@ app.type(Key.DOWN * 10, Key.CTRL) + # Zoom in to allow OCR + app.type("+") + app.WaitIdleUI() app.doubleClick("Hello") diff -r 02fa0f8484d7 -r 3922024076b3 tests/ide_tests/sikuliberemiz.py --- a/tests/ide_tests/sikuliberemiz.py Tue Aug 01 23:07:39 2023 +0200 +++ b/tests/ide_tests/sikuliberemiz.py Mon Aug 07 18:17:12 2023 +0200 @@ -211,7 +211,11 @@ """ self.ocropts = sikuli.OCR.globalOptions() self.ocropts.dataPath(tessdata_path) - self.ocropts.oem(2) + + # 0 use legacy Tesseract (not so good, but repeatable) + # 1 use RNN Tesseract (better but non-repeatable) + # 2 use both + self.ocropts.oem(0) self.ocropts.smallFont() self.imgnum = 0 @@ -318,7 +322,7 @@ for m in matches: mText = m.getText().encode('ascii', 'ignore') for arg in args: - if arg in mText: + if arg in mText or arg in mText.translate(None, "\"`'|-. "): if match is None: match = m if mText == arg: