Test: Control recording over session capability only#3136
Conversation
Review Summary by QodoControl video recording via session capability only
WalkthroughsDescription• Remove SE_RECORD_VIDEO environment variable from docker-compose files • Video recording now controlled solely by session capability se:recordVideo • Simplify test setup by always setting video recording capability • Eliminate conditional logic based on TEST_ADD_CAPS_RECORD_VIDEO flag Diagramflowchart LR
A["Docker Compose<br/>SE_RECORD_VIDEO env var"] -->|Remove| B["Session Capability<br/>se:recordVideo"]
C["Test Setup<br/>Conditional logic"] -->|Simplify| D["Always set capability<br/>in options"]
B --> E["Video Recording<br/>Controlled by capability"]
D --> E
File Changes1. tests/SeleniumTests/__init__.py
|
Code Review by Qodo
1. Record-video flag ignored
|
| options.add_argument('disable-features=DownloadBubble,DownloadBubbleV2') | ||
| if TEST_ADD_CAPS_RECORD_VIDEO: | ||
| options.set_capability('se:recordVideo', True) | ||
| options.set_capability('se:recordVideo', True) |
There was a problem hiding this comment.
1. Record-video flag ignored 🐞 Bug ≡ Correctness
tests/SeleniumTests/__init__.py still reads TEST_ADD_CAPS_RECORD_VIDEO but now unconditionally sets se:recordVideo=true, so TEST_ADD_CAPS_RECORD_VIDEO=false no longer changes behavior. This breaks Makefile/docker-compose flows that explicitly set TEST_ADD_CAPS_RECORD_VIDEO=false (e.g., test_video_dynamic_name) and forces video recording overhead even when intentionally disabled.
Agent Prompt
## Issue description
`TEST_ADD_CAPS_RECORD_VIDEO` is still read from the environment but is no longer used to control whether the test client sends `se:recordVideo`. Several CI/test entrypoints still set/pass this env var expecting it to change behavior.
## Issue Context
- The test module still defines `TEST_ADD_CAPS_RECORD_VIDEO`, but the capability is always set.
- The Makefile and docker-compose test harness still pass `TEST_ADD_CAPS_RECORD_VIDEO`, including a target that explicitly sets it to `false`.
## Fix Focus Areas
Choose one consistent direction:
1) **Keep the toggle**: restore the `if TEST_ADD_CAPS_RECORD_VIDEO:` guard around `options.set_capability('se:recordVideo', True)` for Chrome/Edge/Firefox.
2) **Remove the toggle** (if the new behavior is intended): delete `TEST_ADD_CAPS_RECORD_VIDEO` parsing + remove it from docker-compose/Makefile targets (including `test_video_dynamic_name`) so the repo doesn’t advertise a knob that does nothing.
### Fix Focus Areas (paths/lines)
- tests/SeleniumTests/__init__.py[33-35]
- tests/SeleniumTests/__init__.py[155-165]
- tests/SeleniumTests/__init__.py[216-224]
- tests/SeleniumTests/__init__.py[266-280]
- Makefile[1100-1102]
- tests/docker-compose-v3-test-video.yml[78-88]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
CI Feedback 🧐A test triggered by this PR failed. Here is an AI-generated analysis of the failure:
|
Signed-off-by: Viet Nguyen Duc <nguyenducviet4496@gmail.com>
Thanks for contributing to the Docker-Selenium project!
A PR well described will help maintainers to quickly review and merge it
Before submitting your PR, please check our contributing guidelines, applied for this repository.
Avoid large PRs, help reviewers by making them as simple and short as possible.
Description
Container env var no need to set
SE_RECORD_VIDEO=trueWhenever the session capability is set (
options.set_capability('se:recordVideo', True)- example in Python), video service will start recordingMotivation and Context
Types of changes
Checklist