-
Couldn't load subscription status.
- Fork 6
Ocr tool for appium driver #153
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| logger | ||
| .labeled("CODE") | ||
| .info(`Running code:`, matchingEntry.value.code); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also, we might want to extract the log to some function (const logCodeExec = (code: string) => { ...), since we're using this on line 117 as well. Also I think we should color the code in grey so it won't be very annoying on the logs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this log enough? https://github.com/wix-incubator/pilot/blob/master/packages/core/src/common/CodeEvaluator.ts#L20-L24
It is needed in cases where the code fails to execute and there is no indication of what code was actually trying to run.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| ], | ||
|
|
||
| logLevel: "info", | ||
| logLevel: "warn", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
info is for logging the view hierarchy. I don't think it's needed.
packages/drivers/appium/index.ts
Outdated
| const tempImagePath = path.join(__dirname, "temp_screenshot.png"); | ||
| writeFileSync(tempImagePath, base64Image, { encoding: "base64" }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it saves the temp file in the current directory, always under the same name.
it will be a problem when running in parallel, also it should be stored under the temp dir (os.tmpdir()). and use a unique name for each snapshot.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
futhermore, it might be better to use the existing method for taking snapshot from the testing framework driver. WDYT?
| /** | ||
| * Removes near-duplicate coordinates based on a small epsilon threshold | ||
| */ | ||
| function deduplicateCoordinates( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
was it needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In case of 2 images returns the same location.
Co-authored-by: Asaf Korem <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.



No description provided.