Open
Conversation
Owner
|
@lauty95 How can we add tests for this? Does Playwright offer a way to mock the camera? |
Collaborator
Author
|
Playwright offers a way to mock the browser's I added tests for:
What I haven’t found a way to test with Playwright:
What I tried but didn't work:
|
Owner
|
@lauty Getting an error on when I try to navigate to a PO/PR. Update: this is a fixturing issue. The employee users that are fixtured don't have the "Purchase User" Role.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Resolves
#293
Dependency
I chose to use the
html5-qrcodedependency based on its download count and documentation quality.I also reviewed
vue-barcode-readerand@zxing/browser. The first one has only ~5k downloads compared tohtml5-qrcode's~248k, and it does not seem to have the same level of support.@zxing/browsercould also be a good alternative, but I decided to proceed withhtml5-qrcode.How to test
To access the device camera, the app must be served over HTTPS. For this reason, I used ngrok (I believe we used it before): https://dashboard.ngrok.com/get-started/setup/windows
Once ngrok is installed, open a new terminal and run:
ngrok http 8000(in my case I used port 8004)Demo
For now, I only implemented the camera on the Move page.
On my computer, I do not have a camera installed, so the button to open the camera does not appear:
On my phone:
Live Demo
Screen_Recording_20251114_134313_Chrome.mp4