This repository has been archived by the owner on Sep 21, 2021. It is now read-only.
Ability to customize Test File Name Template #737 #738
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.
Thanks for contributing to Zalenium! Please give us as much information as possible to merge this PR
quickly.
Description
This feature will allow to customize "test file name template" adding a new capability to the browser named "testFileNameTemplate".
How this works?
Template accepts variables like:
{proxyName} - Zalenium|SauceLabs|BrowserStack
{testName} - The one added as "name" on capabilities, otherwise a session key
{browser} - The browser name
{platform} - OS where test runs
{timestamp} - Timestamp of test inizialitation
{testStatus} - Test result: COMPLETED|TIMEOUT|SUCCESS|FAILED
You can add a string to the capability adding static text and any of the variables above mentioned.
Default template:
{proxyName}_{testName}_{browser}_{platform}_{timestamp}_{testStatus}
Motivation and Context
When you want to store on a Data Base the link to the video and logs files it is not possible to get them from the tests code because they contain variables that can be defined but they also contain a timestamp, which exactly value can't be defined.
How Has This Been Tested?
The changes have been tested by following steps from Zalenium home page, section Contributing & Building and Testing.
Docker version: Docker version 18.02.0-ce-rc2, build f968a2c
System Version: macOS 10.13.6
Browser driver: chrome 69.0.3497.100, LINUX
After building the modified version of Zalenium locally and creating a docker image we ran a test with new capability and without the new capability (capability name=testFileNameTemplate)
Types of changes
Checklist: