Hi Kazooie

LiveServerTestCase is a bit more lightweight than tools for using specific
drivers. It doesn't tie into Selenium, or Playwright, or any other
particular web browser library. Therefore I don't think there's going to be
any way for LiveServerTestCase to know what the current page is, in order
to save its contents.

I think, at this time, it would be interesting to see a third party package
that implements what you're suggesting, for a particular web browser
library. This way you can be more specific about what you support, and how.

Thanks,

Adam

On Sun, Aug 14, 2022 at 7:48 AM Kazooie <kazooiebomb...@gmail.com> wrote:

> Hey,
>
> Would it be possible to add a feature to LiveServerTestCase class to take
> a screenshot of the web page and store the HTML somewhere in case of test
> failure? I had to recently do this for one of my projects. This can be
> helpful when debugging stuff for example when test fails in CI pipeline.
>
> This is something Rails does by default (
> https://guides.rubyonrails.org/testing.html#screenshot-helper) and it
> would be good to have this in Django as well, so users don't need to
> manually code this for every project they have. Of course this would need
> to also expect some default driver to be used like Chrome in Rails case.
>
> What are your thoughts? I'd be able to take a stab at this if this is
> something that is considered useful.
>
> Best regards,
>
> Mauri Mustonen
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django developers (Contributions to Django itself)" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-developers+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-developers/0caab9b2-4dcc-4082-9893-dd6c78c3f53cn%40googlegroups.com
> <https://groups.google.com/d/msgid/django-developers/0caab9b2-4dcc-4082-9893-dd6c78c3f53cn%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/CAMyDDM3sp9Xwq5vO0pmRC6Bn%2B_351N2UadhUGjH3sUoYPxeQXA%40mail.gmail.com.
  • Fea... Kazooie
    • ... 'Adam Johnson' via Django developers (Contributions to Django itself)

Reply via email to