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

Set unique screenshot name for failed tests #299

Merged
merged 33 commits into from Dec 14, 2016

Conversation

Projects
None yet
3 participants
@APshenkin
Collaborator

APshenkin commented Nov 23, 2016

Hi!
During working I was faced with two issues with failed screenshots:

  1. Scenario name can't be so long as I want, because the failed screenshot name will be also very long and will not open correctly
  2. I can't use the same scenario names in different suites (files), because if they failed, then screenshot will be overrided.

So I add new option for WebdriverIO to use hashCode of title of scenario and file name for screenshot name

@DavertMik

This comment has been minimized.

Show comment
Hide comment
@DavertMik

DavertMik Nov 23, 2016

Member

Can you provide an example of hashed filename?
Also will it be recognizable to which test does screenshot belong?

Member

DavertMik commented Nov 23, 2016

Can you provide an example of hashed filename?
Also will it be recognizable to which test does screenshot belong?

@APshenkin

This comment has been minimized.

Show comment
Hide comment
@APshenkin

APshenkin Nov 23, 2016

Collaborator

Here is an example
1963136161-940277181.failed.png
There is no way to recognize to which test does screenshot belong, but if you use any html reporter You can set the same hash function to link screenshot to scenario. (I did it for mochawesome)

Please, share your thoughts, if you have any idea how we can set unique name for screenshot so that we will be able to understand to which test does screenshot belong.

Collaborator

APshenkin commented Nov 23, 2016

Here is an example
1963136161-940277181.failed.png
There is no way to recognize to which test does screenshot belong, but if you use any html reporter You can set the same hash function to link screenshot to scenario. (I did it for mochawesome)

Please, share your thoughts, if you have any idea how we can set unique name for screenshot so that we will be able to understand to which test does screenshot belong.

@DavertMik

This comment has been minimized.

Show comment
Hide comment
@DavertMik

DavertMik Dec 6, 2016

Member

How about prepending testname? Just to know what it is

testname-1963136161-940277181.failed.png
Member

DavertMik commented Dec 6, 2016

How about prepending testname? Just to know what it is

testname-1963136161-940277181.failed.png
@APshenkin

This comment has been minimized.

Show comment
Hide comment
@APshenkin

APshenkin Dec 7, 2016

Collaborator

If we will add testname in the screenshot name then this point will not be included to this feature:
Scenario name can't be so long as I want, because the failed screenshot name will be also very long and will not open correctly
Maybe we can try some workaround: wor this mode, get first 30-40 characters of testname and include them in screenshot name

Collaborator

APshenkin commented Dec 7, 2016

If we will add testname in the screenshot name then this point will not be included to this feature:
Scenario name can't be so long as I want, because the failed screenshot name will be also very long and will not open correctly
Maybe we can try some workaround: wor this mode, get first 30-40 characters of testname and include them in screenshot name

@DavertMik

This comment has been minimized.

Show comment
Hide comment
@DavertMik

DavertMik Dec 9, 2016

Member

Maybe we can try some workaround: wor this mode, get first 30-40 characters of testname and include them in screenshot name

Yep. That would be ok.

Member

DavertMik commented Dec 9, 2016

Maybe we can try some workaround: wor this mode, get first 30-40 characters of testname and include them in screenshot name

Yep. That would be ok.

@DavertMik

Ok, few more changes from me and it is ready to be merged

Show outdated Hide outdated lib/helper/WebDriverIO.js
Show outdated Hide outdated lib/helper/WebDriverIO.js
Show outdated Hide outdated lib/helper/WebDriverIO.js
Show outdated Hide outdated lib/helper/WebDriverIO.js
@APshenkin

This comment has been minimized.

Show comment
Hide comment
@APshenkin

APshenkin Dec 14, 2016

Collaborator

@DavertMik please check the changes after review and merge them :)

Collaborator

APshenkin commented Dec 14, 2016

@DavertMik please check the changes after review and merge them :)

@DavertMik

This comment has been minimized.

Show comment
Hide comment
@DavertMik

DavertMik Dec 14, 2016

Member

Thanks, looks good now. I will try it locally then I will release a new version

Member

DavertMik commented Dec 14, 2016

Thanks, looks good now. I will try it locally then I will release a new version

@DavertMik DavertMik merged commit fe4af1c into Codeception:master Dec 14, 2016

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment