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

[java][grid]: video file name set independently in dynamic grid via se:videoName #14148

Merged
merged 2 commits into from
Jun 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -373,13 +373,16 @@ private Map<String, String> getVideoContainerEnvVars(
// Capabilities set to env vars with higher precedence
setCapsToEnvVars(sessionRequestCapabilities, envVars);
envVars.put("DISPLAY_CONTAINER_NAME", containerIp);
Optional<String> testName = ofNullable(getTestName(sessionRequestCapabilities));
testName.ifPresent(name -> envVars.put("SE_VIDEO_FILE_NAME", String.format("%s.mp4", name)));
Optional<String> videoName =
ofNullable(getVideoFileName(sessionRequestCapabilities, "se:videoName"))
.or(() -> ofNullable(getVideoFileName(sessionRequestCapabilities, "se:name")));
videoName.ifPresent(name -> envVars.put("SE_VIDEO_FILE_NAME", String.format("%s.mp4", name)));
return envVars;
}

private String getTestName(Capabilities sessionRequestCapabilities) {
Optional<Object> testName = ofNullable(sessionRequestCapabilities.getCapability("se:name"));
private String getVideoFileName(Capabilities sessionRequestCapabilities, String capabilityName) {
Optional<Object> testName =
ofNullable(sessionRequestCapabilities.getCapability(capabilityName));
if (testName.isPresent()) {
String name = testName.get().toString();
if (!name.isEmpty()) {
Expand Down
Loading