Skip to content
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

test: add playwright tests #237

Open
wants to merge 16 commits into
base: mobile_v15
Choose a base branch
from
Open

test: add playwright tests #237

wants to merge 16 commits into from

Conversation

Alchez
Copy link
Collaborator

@Alchez Alchez commented Nov 27, 2024

Closes #193


Test locally inside a virtualenv using pytest ./beam/tests/mobile/test_mobile.py --browser firefox --headed --disable-warnings

@Alchez Alchez requested a review from agritheory November 27, 2024 11:43
@Alchez Alchez force-pushed the mobile_v15_playwright branch from c6aef7d to c733f54 Compare November 28, 2024 10:16
@Alchez Alchez linked an issue Dec 2, 2024 that may be closed by this pull request
16 tasks
@Alchez Alchez force-pushed the mobile_v15_playwright branch from 42ef71c to f2b2295 Compare December 2, 2024 10:36
@Alchez Alchez force-pushed the mobile_v15_playwright branch from f2b2295 to 9581f38 Compare December 2, 2024 10:50
Copy link

github-actions bot commented Dec 2, 2024

Coverage

Coverage Report
FileStmtsMissCoverMissing
__init__.py10100% 
beam
   barcodes.py331457%18, 27, 29, 31, 34, 45–46, 48–49, 54–56, 60–61
   handling_unit.py813754%25, 31, 63–65, 83, 94–95, 101–102, 104–105, 107–108, 110–111, 113, 115–118, 120–122, 124, 126, 128–129, 134, 136, 140, 142–143, 146, 148–149, 157
   printing.py61610%4–6, 8, 11–12, 15–16, 18–21, 24–25, 34–45, 47–54, 58–59, 61–62, 71–75, 78–79, 85–87, 90–91, 94–95, 97–99, 101–102, 104, 109, 111–112
beam/demand
   demand.py3227776%51, 66, 123, 209, 243, 290, 293, 425–426, 428–429, 432–433, 435, 439–444, 446, 448–449, 452, 457, 459–464, 466, 468, 471, 474, 479, 483–485, 490–491, 493, 495–497, 499, 505, 507–510, 512–515, 517, 519, 522–523, 525–526, 529, 543, 560–561, 563–565, 621, 625, 662, 667, 674, 695–696, 708, 837
   receiving.py111496%79, 131, 173, 214
   sqlite.py59198%40
   utils.py59788%56, 67, 72–75, 83
beam/doctype/beam_mobile_route
   beam_mobile_route.py30100% 
beam/doctype/beam_settings
   beam_settings.py281739%33–35, 38–39, 41, 48, 53–56, 64–66, 70–72
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.py671774%61–62, 67–74, 80–81, 97, 112, 129, 132–133
   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__.py1322283%21, 25, 30, 38, 70, 117–118, 128, 130–131, 135, 139–140, 143, 154–155, 159, 180, 209, 211, 229, 232
   config.py26260%4, 6, 9–17, 19–21, 23–26, 28–30, 32–35, 37
   user_login.py31310%1–4, 7–9, 13–15, 17–18, 20–21, 23–25, 27–29, 31–34, 36–41, 43
www/beam
   __init__.py14140%4–7, 10–19
   index.py770%4, 6, 9–13
TOTAL116142563% 


# find the first item in the list
item = page.locator("css=.box .beam_list-item").first
item_name, *others = item.inner_text().split("\n")
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@agritheory this only works cause the first thing in each list is the item name, but we could maybe tag the item name with a class to identify it more reliably in tests?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd prefer a data attribute, but I agree.

@agritheory agritheory marked this pull request as ready for review December 18, 2024 15:29
@agritheory agritheory marked this pull request as draft December 18, 2024 15:30
@Alchez Alchez marked this pull request as ready for review December 19, 2024 08:40
@Alchez Alchez force-pushed the mobile_v15_playwright branch from abf7ae7 to 00b860f Compare December 20, 2024 10:59
@Alchez Alchez force-pushed the mobile_v15_playwright branch from 43e2e24 to 521c59f Compare January 30, 2025 10:10
@Alchez
Copy link
Collaborator Author

Alchez commented Jan 30, 2025

@agritheory I'm seeing some weird behaviour that I'm not sure if you've faced before. While running the tests locally, I'm scanning and saving the record and it creates an entry in the database. However, the pytest runner can't seem to fetch that record for assertions.

Have you seen something like this?

Repository owner deleted a comment from github-actions bot Feb 20, 2025
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.

[mobile] Test Suite
2 participants