You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
In dynamic grid, whenever capability se:name (which shows a test name instead of the session ID in the Grid UI) is set via binding, it is also used to set the output video record file name.
To solve a requirement is
People are setting the cap se:name. However, they don't want this name to be set to a video record file. Or they want an option to control the video record file name independently from the test name shown in the Grid UI.
Capability se:videoName will be used to set video record file name independently. If the capability se:videoName is not set, the se:name is still being used to set for the video record (without regression broken in part of #13907).
Possible Bug: The method getVideoFileName is used to fetch both se:videoName and se:name capabilities. However, the method name suggests it is specifically for getting video file names. Consider renaming the method to reflect its generalized use, such as getCapabilityAsString.
Code Duplication: The logic for sanitizing the name string is duplicated in the getVideoFileName method. Consider extracting this logic into a separate method to improve code maintainability and reduce duplication.
Why: This suggestion correctly identifies a way to simplify the code by combining two Optional checks into one, reducing redundancy and improving readability.
8
Possible bug
Add a null check for sessionRequestCapabilities before accessing its capabilities
Add a null check for sessionRequestCapabilities before calling getCapability to prevent potential NullPointerException.
Why: Adding a null check is a good practice to prevent NullPointerException, especially when dealing with external inputs or configurations. This suggestion enhances the robustness of the code.
7
Maintainability
Use a constant for the video file extension to improve maintainability
Use a constant for the video file extension to avoid hardcoding the ".mp4" string multiple times, which improves maintainability.
Why: Using a constant for repeated string literals like file extensions can improve maintainability and make future changes easier. This suggestion is valid and applicable to the new code in the PR.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
User description
Thanks for contributing to Selenium!
A PR well described will help maintainers to quickly review and merge it
Before submitting your PR, please check our contributing guidelines.
Avoid large PRs, help reviewers by making them as simple and short as possible.
Description
Motivation and Context
This is an improvement of #13907
In dynamic grid, whenever capability
se:name
(which shows a test name instead of the session ID in the Grid UI) is set via binding, it is also used to set the output video record file name.To solve a requirement is
Capability
se:videoName
will be used to set video record file name independently. If the capabilityse:videoName
is not set, these:name
is still being used to set for the video record (without regression broken in part of #13907).For example:
After a test is executed, under
/assets
you can see the video file name under/<sessionId>/video.mp4
Types of changes
Checklist
PR Type
enhancement
Description
se:videoName
capability.se:videoName
is not set, the existingse:name
capability will be used as a fallback to name the video file.Changes walkthrough 📝
DockerSessionFactory.java
Support independent video file naming via `se:videoName` capability.
java/src/org/openqa/selenium/grid/node/docker/DockerSessionFactory.java
se:videoName
capability.
se:name
capability ifse:videoName
is not provided.file naming.