How can we attach the screenshots to the selenium unittests ?

Rifat Erdem Sahin's Avatar

Rifat Erdem Sahin

25 Nov, 2014 02:04 PM

We need to be able to see the screenshots of our failing acceptance tests. How can we achieve that ? Should we use Appveyor Artifacts?

  1. Support Staff 1 Posted by Feodor Fitsner on 25 Nov, 2014 06:56 PM

    Feodor Fitsner's Avatar
  2. 2 Posted by Rifat Erdem Sah... on 26 Nov, 2014 09:22 AM

    Rifat Erdem Sahin's Avatar

    I tried it without the Yml but from the Appveyor UI without success.

  3. 3 Posted by Rifat Erdem Sah... on 26 Nov, 2014 12:38 PM

    Rifat Erdem Sahin's Avatar

    Ok I got it work but the thing is, it only works is the tests pass. *

    * there could be a logic behind this.

    But I would like to get my artifacts even though the tests are failing.

  4. 4 Posted by Rifat Erdem Sah... on 26 Nov, 2014 02:51 PM

    Rifat Erdem Sahin's Avatar

    I am getting "The build job does not contain any artifacts." when the tests fail.

    The thing is I need the screenshots when the tests fail.

  5. Support Staff 5 Posted by Feodor Fitsner on 26 Nov, 2014 03:45 PM

    Feodor Fitsner's Avatar

    You can collect artifacts using script on "On build finish script" (General tab of project settings) on in YAML:

    on_finish:
      - ps: Push-AppveyorArtifact <path-to-png>
    

    Take a look at some examples how to push a list of files: http://www.appveyor.com/docs/packaging-artifacts

  6. 6 Posted by Rifat Erdem Sah... on 27 Nov, 2014 11:15 AM

    Rifat Erdem Sahin's Avatar

    You can collect artifacts using script on "On build finish script"

    > The thing is I would like to collect the artifacts after the failure. I added after the failure but I can not see the artifacts.*

    *I need to artifacts to debug the system.

  7. Support Staff 7 Posted by Feodor Fitsner on 27 Nov, 2014 07:09 PM

    Feodor Fitsner's Avatar

    You don't get artifacts because they are probably not in build root folder. Add -Recurse:

    on_finish:
    - ps: Get-ChildItem .\*.png -Recurse | % { Push-AppveyorArtifact $_.FullName -FileName $_.Name }
    

    Results with artifacts uploaded: https://ci.appveyor.com/project/FeodorFitsner/selenium-tests/build/...

  8. 8 Posted by Rifat Erdem Sah... on 03 Dec, 2014 03:39 PM

    Rifat Erdem Sahin's Avatar

    Ok I got this one. Thank you.

  9. Rifat Erdem Sahin closed this discussion on 26 Dec, 2014 01:35 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac