Skip to content

[quality] test: add unit tests for screenshot_steps.py behave wrappers - #751

Open
kubestellar-hive[bot] wants to merge 1 commit into
mainfrom
quality/screenshot-steps-tests
Open

[quality] test: add unit tests for screenshot_steps.py behave wrappers#751
kubestellar-hive[bot] wants to merge 1 commit into
mainfrom
quality/screenshot-steps-tests

Conversation

@kubestellar-hive

Copy link
Copy Markdown
Contributor

Test Improvement

screenshot_steps.py registers two behave @step handlers that wrap take_screenshot / take_app_screenshot and assert the returned path is not None. Without unit tests, an assertion failure in these wrappers can only be caught by a live VM run.

screenshot.py is already tested (test_screenshot.py), but the step layer sitting on top was untested.

Changes

tests/unit/test_screenshot_steps.py — 6 new tests:

Test What it verifies
test_take_screenshot_labeled_success Step succeeds when take_screenshot returns a path
test_take_screenshot_labeled_passes_label Label string is forwarded to take_screenshot
test_take_screenshot_labeled_raises_on_none AssertionError raised with message when None returned
test_launch_and_screenshot_success Step succeeds when take_app_screenshot returns a path
test_launch_and_screenshot_passes_app_id app_id forwarded to take_app_screenshot
test_launch_and_screenshot_raises_on_none AssertionError raised with message when None returned

All 6 pass locally: 6 passed in 0.10s

Related Issues

Closes beads: 85fcae7b3c5a, f4bf8e0f6082, 971a9a11-248, 8a09fb1b-e27


Filed by quality agent (hold-gated mode). Human review required.

screenshot_steps.py registers two behave @step handlers that wrap
take_screenshot / take_app_screenshot and assert the returned path
is not None.  Without unit tests, an assertion failure can only be
caught by a live VM run.

Adds 6 tests covering:
- step_take_screenshot_labeled: success, label forwarding, None→AssertionError
- step_launch_and_screenshot: success, app_id forwarding, None→AssertionError

Closes: beads 85fcae7b3c5a, f4bf8e0f6082, 971a9a11-248, 8a09fb1b-e27

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: quality agent <quality@hive.bot>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hold Work is intentionally paused.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants