Skip to content
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

Merged
merged 2 commits into from
Oct 10, 2018
Merged

Ability to customize Test File Name Template #737 #738

merged 2 commits into from
Oct 10, 2018

Conversation

gaiquelsf
Copy link
Contributor

@gaiquelsf gaiquelsf commented Oct 9, 2018

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

  • New feature (non-breaking change which adds functionality)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • All new and existing tests passed.

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}
@codecov-io
Copy link

codecov-io commented Oct 9, 2018

Codecov Report

Merging #738 into master will increase coverage by 0.01%.
The diff coverage is 90%.

@@             Coverage Diff              @@
##             master     #738      +/-   ##
============================================
+ Coverage      62.4%   62.41%   +0.01%     
  Complexity      543      543              
============================================
  Files            47       47              
  Lines          3394     3403       +9     
  Branches        295      296       +1     
============================================
+ Hits           2118     2124       +6     
- Misses         1079     1081       +2     
- Partials        197      198       +1

@diemol
Copy link
Contributor

diemol commented Oct 9, 2018

Hi @gaiquelsf, thanks for the PR, I just added a comment where I request also an example of the capability in the docs.

@gaiquelsf
Copy link
Contributor Author

Hi @diemol, thank you for checking the PR.
I will add how the capability should look like and an example on the documentation

@gaiquelsf
Copy link
Contributor Author

Hi @diemol I have added the new feature information to the documentation, if it is necessary to add or fix something just let me know.
Thank you

@diemol
Copy link
Contributor

diemol commented Oct 10, 2018

Thanks @gaiquelsf!

@diemol diemol merged commit 0eb8544 into zalando:master Oct 10, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants