-
Notifications
You must be signed in to change notification settings - Fork 14
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
Screenshot added via NUnit TestContext.AddTestAttachment is displayed twice in GHPReport #61
Comments
Hi @Steffx115 ! Can you please clarify how do you take screenshots in your tests? These details will help me to reproduce the issue. Thank you |
Hi, We have a class called |
Hi @Steffx115, I've tried to reproduce the issue on my side and there are no duplicates. The report has only one screenshot in this case. |
Did u let the Test fail so the Screenshot is taken from the TearDown method? |
Hi @Steffx115 ! Sorry, my bad. I've tried to reproduce it once again with the correct repro steps - failing test with screenshot taken in the But still one screenshot is taken: Please note that I'm using the prepared base64 string instead of the real screenshot for tests to work faster: Thank you |
The only difference i notice now is, that we use .bmp as file extension for saving the screenshot EDIT: i changed the file extension to .png, but this had no effect on this issue |
additional Info: Opening the test result via the VS Test explorer also only shows one Screenshot as test attachment |
Hi @Steffx115 ! Thank you |
hi @elv1s42 , i just noticed that you didnt reproduce this with the class structure that I use So then you would have |
Ok, let me try once again |
@Steffx115 , still works fine for me with this structure: The latest commit with the test is in the |
In our test solution we have 2 TestFixtures defined for TestBase, is it possible that the screenshot is duplicated because of this? EDIT: we only execute 1 TestFixture per testrun |
hi, is there any update on this? |
Hi @Steffx115! Sorry for the delay, I still was not able to reproduce the issue. Thank you |
Hi @elv1s42, I am also having the same double screenshot issue. Following is my code:
static public byte[] TakeScreenshot(IWebDriver driver) Many Thanks. |
Also, When using TestContext as well it is having double image
|
Hi @lagori, Can you please provide me some more information about the environment you are using? Are you using NUnit console with |
Hi @elv1s42 , The way its installed is the Nunit3 Console runner is downloaded and the path is added to Environment variables. relative path to the addin is added Environment VS 2019 .NETFramework 4.72 class library GHP reports and logs as zipped Also one more observation - there is a screenshot saved at the execution directory. Not sure if its meant to be saved. Hope this helps. |
Thank you @lagori! |
Hello @Steffx115 and @lagori! This issue is now fixed in Thank you |
Steps to reproduce
Add screenshot to NUnit TestContext via AddtestAttachment method
Expected behavior
Screenshot should only be displayed once
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: