Short overview
The timeout error thrown for waitFor() could contain more details (similar to find() errors).
Use case
To debug issues more easily.
Detailed description
Currently, when I handle an error thrown by a waitFor call, the only message shown is:
Action timed out after XXXX ms
This message itself is vague, not to mention the absence of the stack trace in the error log.
I think giving a bit of context for where and what this error is, would be extremely helpful.
This is a very simple script which illustrates the point:
const nut = require('@nut-tree/nut-js');
const utils = require('./scripts/utilities');
require('@nut-tree/nl-matcher');
(async () => {
try {
nut.screen.config.resourceDirectory = utils.getImagesPath()
await nut.screen.waitFor(nut.imageResource('continue_btn.png'), 1000);
} catch (err) {
console.error(err);
}
})();
utils.getImagesPath() simply returns the path of my resource directory
- assuming 'continue_btn.png' is present in the resource directory, but isn't on screen, this code should print the error message "Action timed out after XXXX ms"
Short overview
The timeout error thrown for
waitFor()could contain more details (similar tofind()errors).Use case
To debug issues more easily.
Detailed description
Currently, when I handle an error thrown by a
waitForcall, the only message shown is:This message itself is vague, not to mention the absence of the stack trace in the error log.
I think giving a bit of context for where and what this error is, would be extremely helpful.
This is a very simple script which illustrates the point:
utils.getImagesPath()simply returns the path of my resource directory