Fixed Optical Character Recognition and added tests

This commit is contained in:
n1474335 2024-06-21 14:12:28 +01:00
parent c23a8de5a0
commit ab37c1e562
No known key found for this signature in database
GPG key ID: D15457B7B4AF3F37
4 changed files with 34 additions and 24 deletions

View file

@ -180,15 +180,16 @@ function loadRecipe(browser, opName, input, args) {
* @param {Browser} browser - Nightwatch client
* @param {string|RegExp} expected - The expected output value
* @param {boolean} [waitNotNull=false] - Wait for the output to not be empty before testing the value
* @param {number} [waitWindow=1000] - The number of milliseconds to wait for the output to be correct
*/
function expectOutput(browser, expected, waitNotNull=false) {
function expectOutput(browser, expected, waitNotNull=false, waitWindow=1000) {
if (waitNotNull && expected !== "") {
browser.waitUntil(async function() {
const output = await this.execute(function() {
return window.app.manager.output.outputEditorView.state.doc.toString();
});
return output.length;
}, 1000);
}, waitWindow);
}
browser.execute(expected => {