-
Notifications
You must be signed in to change notification settings - Fork 60
Context file camera #185
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
Context file camera #185
Conversation
This looks great. I vote we remove the test attribute and bake in support for select test frameworks (mstest, nunit, xunit, fixie, mbunit to start). If there are any others people want we can respond to them raising an issue. You can just have a list of strings of their assembly and type name for comparison. I wonder if we can create an approval test that compares the image to an expected one?
|
I agree with you re: baking in support for other test frameworks. I'll look into the cleanest way to implement it. I like the idea of an approval test that compares images. Would need to create a test page and set |
Don't use google. Use a page on the acceptance tests web project so it's stable.
|
This looks really useful. |
Thanks @mwhelan. I showed it to @robdmoore and has encouraged me to contribute it back to the project. |
Yeah, things like this really add a lot of value for developers/testers and take a little bit more pain away from testing. It's always great to get more of those sorts of features. |
Hey @dennisroche what's the status on changing that test attribute? Do you think we should merge in the meantime regardless and do that in a separate PR? I also wonder if we can do an acceptance test of this with an image comparison - main tricky thing would be the date (maybe we can figure a way to fix it for the test?). |
@robdmoore I haven't made any progress on it. I did spike an idea, however it got left on the wayside months ago. I will have make time on Thursday night to revisit this and get it to merge ready state with test attribute removed and an acceptance test. For the acceptance test, I was going to use/create a page in the current test project and then fix the time using the |
Rebased with master. I've made the suggested changes to detecting the testing framework and added an acceptance test for the |
You are going to need to set the browser window size to a certain size otherwise it will vary based on the computer it's running on. For instance, that test failed on the build server. Don't make it more than 800x600 as a lowest common denominator.
|
Thanks @robdmoore. I thought that would happen as I had the test fail locally once with a image of different dimensions. |
FYI There are a bunch of broken acceptance tests on your latest commit in the build server. |
…tion baked into the image, e.g. PageTitle, Url, Current Callstack.
…ation that could be recorded in the screenshot.
Closing this PR as it over 3 years old. |
This is still incredibly useful. The main issue is that Seleno hasn't received any love for a long time. I'd prefer this is left open to it's clear if Seleno is ressurected at any point. |
Fair enough; it would be good to see Seleno live again. |
Hey Dennis I'm the original creator of Seleno and I would love to see it live again too. When I made it I was doing a lot of Selenium WebDriver work but it's been quite awhile since I've used Selenium and it's been hard to keep up with the project. It would be good to start off with supporting the latest version of WebDriver and investigate what might be involved with porting it to .Net Core. I think that would be possible with .Net Core 2.0. Thanks |
@mwhelan perhaps that is why it has dropped to the side as not many people are using Selenium UI testing, especially on ASP.NET MVC apps (it has been years since I last created one).
Porting to .NET Core 2 looks possible (see attached report). Probably would have some serious breaking changes for existing users because of ASPNET.Core |
A new file camera that bakes additional/contextual information into the image. I found this additional information useful when debugging why a test failed and where in the callstack the image was generated.
To make this information even more useful, I added
Exception
param to theICamera.TakeScreenshot
interface. It defaults tonull
.Example
Usage
I'm not too happy with the having to pass down the attribute type that decorate the test, i.e.
typeof(TestAttribute)
for NUnit. However I couldn't think of a generic way to handle this.