Skip to content

[mobile] Add photo#295

Open
lauty95 wants to merge 28 commits intomobile_v15from
issue-175-photo
Open

[mobile] Add photo#295
lauty95 wants to merge 28 commits intomobile_v15from
issue-175-photo

Conversation

@lauty95
Copy link
Copy Markdown
Collaborator

@lauty95 lauty95 commented Nov 17, 2025

Resolves

#175

Dependencies

No external library was used. This implementation uses the native navigator.mediaDevices.getUserMedia API.

How to test

To access the device camera, the app must be served over HTTPS. For this reason, I used ngrok like here #294

Demo

Screen_Recording_20251117_100803_Chrome.mp4
Screen.Recording.2025-11-17.at.10.08.47.AM.mov

@lauty95 lauty95 requested a review from agritheory November 17, 2025 13:17
@lauty95 lauty95 self-assigned this Nov 17, 2025
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Nov 17, 2025

Coverage

Coverage Report
FileStmtsMissCoverMissing
__init__.py10100% 
beam
   barcodes.py793456%20, 22, 24, 27, 38–39, 41–42, 47–48, 50–51, 53–55, 61, 71, 79, 86, 89–90, 96–97, 103, 109, 115, 121, 128, 131–134, 136–137
   handling_unit.py813754%26, 32, 64–66, 84, 95–96, 102–103, 105–106, 108–109, 111–112, 114, 116–119, 121–123, 125, 127, 129–130, 135, 137, 141, 143–144, 147, 149–150, 158
   printing.py826421%18–19, 32–43, 45–48, 57–61, 65–66, 68–69, 78–82, 85–86, 92–94, 101–102, 104–106, 108–109, 111, 116, 118–119, 134–139, 141–150
beam/demand
   demand.py3384486%51, 66, 123, 209, 243, 463–464, 483–485, 490–491, 493, 495–497, 499, 504, 543, 621, 625, 662, 667, 674, 695–696, 707, 713–729
   receiving.py1362184%76, 128, 151–154, 181, 222, 252, 257–268
   sqlite.py59198%40
   utils.py59689%56, 67, 73–75, 83
beam/doctype/beam_mobile_route
   beam_mobile_route.py30100% 
beam/doctype/beam_settings
   beam_settings.py281739%35–37, 40–41, 43, 50, 55–58, 66–68, 72–74
beam/doctype/handling_unit
   __init__.py9366%12–14
   handling_unit.py150100% 
beam/doctype/warehouse_types
   warehouse_types.py30100% 
beam/overrides
   sales_order.py10640%11–16
   stock_entry.py801778%80–81, 86–93, 99–100, 116, 131, 148, 151–152
   work_order.py10280%14, 16
beam/report/demand_map
   demand_map.py35350%4–5, 7–8, 11–12, 15–16, 103–111, 127, 129–143, 146–147
beam/report/handling_unit_traceability
   handling_unit_traceability.py44440%4–6, 9–11, 30–32, 34–35, 37–38, 41–42, 45–46, 48–49, 51–52, 54–55, 57, 63–65, 67–69, 71, 74–77, 79–81, 83–86, 89–90
beam/scan
   __init__.py1432681%21, 25, 31, 39, 71, 118–119, 129, 131–132, 136, 140–141, 144, 155–156, 160, 181, 185, 214, 216, 235–236, 242, 245, 248
   config.py28280%4, 6, 9–17, 19–21, 23–26, 28–30, 32–35, 38–39, 41
   user_login.py31310%4–6, 8, 11–13, 17–19, 21–22, 24–25, 27–29, 31–33, 35–38, 40–45, 47
www/beam
   __init__.py14140%4–7, 10–19
   index.py770%4, 6, 9–13
TOTAL129543766% 

@agritheory
Copy link
Copy Markdown
Owner

@lauty95 Nice! Let's add a very basic test.

@lauty95
Copy link
Copy Markdown
Collaborator Author

lauty95 commented Dec 10, 2025

@agritheory

I added the following tests:

  • test_camera.py
    • test_camera_button_visible
      Mocks a camera, so the button should be visible
    • test_camera_component_hidden_without_support
      Mocks no camera support, so the component should not be rendered
    • test_camera_opens_and_closes
      Tests the button actions: open should render the camera video, and close should hide the camera
  • test_attach_file.py
    • test_upload_photo_to_purchase_receipt
      Tests the complete workflow: navigates to a receive item, takes a photo, scans a barcode to add an item, saves the Purchase Receipt, and verifies (using Frappe) that the photo is attached to the created document.
      This test was funny, the photo that Playwright takes is a complete blue canvas haha.
Screenshot 2025-12-10 at 11 54 33 AM Screenshot 2025-12-10 at 11 54 29 AM

@lauty95
Copy link
Copy Markdown
Collaborator Author

lauty95 commented Feb 5, 2026

@agritheory

I added the setup_beam_mobile_user_permissions() function in install.py. This grants the required permissions for the BEAM Mobile User role and prevents some 403 errors we were seeing.

issue

@lauty95
Copy link
Copy Markdown
Collaborator Author

lauty95 commented Feb 12, 2026

@agritheory
this is ready!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants