(sandbox: Sandbox)
| 20 | |
| 21 | |
| 22 | def test_right_click(sandbox: Sandbox): |
| 23 | # Capture the initial screenshot |
| 24 | time.sleep(5) # Wait for UI to load |
| 25 | |
| 26 | initial_screenshot_bytes = sandbox.screenshot() |
| 27 | initial_image = Image.open(io.BytesIO(initial_screenshot_bytes)) |
| 28 | |
| 29 | # Get cursor position and perform right click |
| 30 | cursor_pos = sandbox.get_cursor_position() |
| 31 | sandbox.right_click() |
| 32 | time.sleep(5) # Wait for UI to respond |
| 33 | |
| 34 | # Capture and process the second screenshot |
| 35 | post_click_screenshot_bytes = sandbox.screenshot() |
| 36 | post_click_image = Image.open(io.BytesIO(post_click_screenshot_bytes)) |
| 37 | |
| 38 | # Crop both images around the cursor position |
| 39 | cropped_image_1 = crop_around_point(initial_image, cursor_pos) |
| 40 | cropped_image_2 = crop_around_point(post_click_image, cursor_pos) |
| 41 | |
| 42 | # Compare the cropped images |
| 43 | assert not images_are_equal(cropped_image_1, cropped_image_2), ( |
| 44 | "The image around the cursor did not change after right-click." |
| 45 | ) |
| 46 | |
| 47 | |
| 48 | def test_screenshot(sandbox: Sandbox): |
nothing calls this directly
no test coverage detected