Skip to content
This repository has been archived by the owner on Dec 18, 2019. It is now read-only.

Screenshots path #82

Open
AndreyYevtukhov opened this issue Jan 26, 2018 · 4 comments
Open

Screenshots path #82

AndreyYevtukhov opened this issue Jan 26, 2018 · 4 comments

Comments

@AndreyYevtukhov
Copy link

Hi guys!

I have a question about screenshots path in generated .xml report

Is there any option to insert links to screenshots files in XML / path to folder with saved screens, so QA can just click on such link in Jenkins and download / open it in browser?

@christian-bromann
Copy link
Contributor

@AndreyYevtukhov not sure, probably yes. Feel free to propose a PR with such a feature.

@jukafah
Copy link

jukafah commented Feb 8, 2018

You can do this with the junit-attachments jenkins plugin here: https://wiki.jenkins.io/display/JENKINS/JUnit+Attachments+Plugin

You write out a filename to standard in or out and the plugin can publish them as direct test attachments in Jenkins rather than build artifacts. I recently forked this repo to work on that specific feature, but I wound up changing the logic for cucumber / jenkins reporting as well.

            if (testData.state === 'fail') {
                const screenshot = screenshots.find(function (item) { return item.toLowerCase().indexOf(test.title.toLowerCase()) > 0 });
                testCase.failure();
                testCase.standardError(`\n[[ATTACHMENT|${screenshot}]]\n\n${testData.error.stack}`);
            }

@christian-bromann thoughts on this? It requires a separate plugin to work correctly. At least for Jenkins, anyway.

@goatsy
Copy link

goatsy commented Feb 13, 2018

Can I access the junit reporter in the afterTest hook?
I would just like to add some content to the "Standard Error" (for example embed a screenshot/iframe via html) but I don't know how to access the reporter.

@jukafah @AndreyYevtukhov

@christian-bromann
Copy link
Contributor

Can I access the junit reporter in the afterTest hook?

No. Not sure how to pull this off. Reporter usually should not block the test execution in any way.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants