-
-
Notifications
You must be signed in to change notification settings - Fork 218
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
chore(#6669): Search by barcode e2e test #8732
Conversation
I'm still trying to figure out a couple of things. In |
/*In this case the upload file button is hidden, | ||
then we need to manipulate the DOM of the respective webelement to make it interactable.*/ | ||
browser.execute(function () { | ||
document.getElementsByClassName('barcode-scanner-input')[0].style.display = 'block'; |
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.
Not a fain of this either, because it will definitely obscure if the actual button that makes the input selection no longer works, or is not displayed. So the test only validates the functionality partially.
Is there no way to use the elements that are displayed on the page to upload the image?
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.
If you click on the barcode icon, the OS upload file dialog appears, and Webdriverio has no control over it. I'm investigating how to setValue to a web element that is not interactable without modifying the DOM.
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.
Yea, I went through that search as well and in the end I couldn't find anything. The idea is that wdio really wants to simulate as close to user interaction as possible.
Maybe we should just leave it like this.
document.getElementsByClassName('barcode-scanner-input')[0].style.display = 'block'; | ||
}); | ||
await (await barcodeSearchInput()).setValue(barcodeImagePath); | ||
await browser.pause(1000); |
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.
What is the reason for the 1s delay?
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.
We experienced some delay when uploading and processing the barcode image. But I only tried the e2e test with the wait; It may be unnecessary.
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.
I try without the wait, and the test fails because it doesn't have time to process the search and show results. This validation fails.
I need help to make the test work on CI. I have tried various formats to set the emulated device capability, each working on my local machine but not on CI. On CI, you can tell it is not charging the capability because of the screenshot (the barcode scanner icon isn't shown). The icon is shown when it is on mobile. @tatilepizs @dianabarsan can you please give it a try running this test locally? to confirm what I'm experiencing. |
Hi @lorerod, I was trying to run the test locally but it is failing for me, it is not seeing the barcode scanner icon, the same thing that happened on the CI. Let me know if there is anything else can do to help. |
…into 6669-search-by-barcode-e2e-test--weird-issue
…into 6669-search-by-barcode-e2e-test
This reverts commit 8ac8efb.
This reverts commit 4c22f3a.
This reverts commit cf7592a.
…//github.com/medic/cht-core into 6669-search-by-barcode-e2e-test
…anging permissions
The Barcode Scanner API is not supported on Linux, which means this test will not work on CI. |
Description
Closes #8716
Code review checklist
Compose URLs
If Build CI hasn't passed, these may 404:
License
The software is provided under AGPL-3.0. Contributions to this project are accepted under the same license.