Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Large img preview in self-contained mode#573

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
mganisin wants to merge1 commit intopytest-dev:master
base:master
Choose a base branch
Loading
frommganisin:self-contained-img-preview

Conversation

@mganisin
Copy link

"ful-screen" preview of extra images attached to results for self-contained mode. Unlike image preview in normal mode implemented as part of page with little bit of js+css (likely also possible to implement via , however adress line populated by base64 of the image would be really ugly in such case).

"ful-screen" preview of extra images attached to results forself-contained mode. Unlike image preview in normal mode implemented aspart of page with little bit of js+css (likely also possible toimplement via <a>, however adress line populated by base64 of the imagewould be really ugly in such case).
@BeyondEvil
Copy link
Contributor

Thanks for the PR!

Since we're about to release the first RC of v4 (aka next-gen) which is a complete rewrite of the plugin, let's put this on hold.

One of the things we've implemented in v4 is an image gallery, and I think this has been solved there.

mganisin reacted with thumbs up emoji

@BeyondEvil
Copy link
Contributor

Can you try4.0.0rc0 and see if it works as expected?

@mganisin
Copy link
Author

mganisin commentedApr 13, 2023
edited
Loading

Can you try4.0.0rc0 and see if it works as expected?

Could be a breaking change there? I get:

INTERNALERROR>     extra.append(pytest_html.extras.url(issue, name=issue_id))INTERNALERROR> AttributeError: 'function' object has no attribute 'url'

@BeyondEvil
Copy link
Contributor

Can you try4.0.0rc0 and see if it works as expected?

Could be a breaking change there? I get:

INTERNALERROR>     extra.append(pytest_html.extras.url(issue, name=issue_id))INTERNALERROR> AttributeError: 'function' object has no attribute 'url'

Can you try ”from pytest_html import extras” instead?

@mganisin
Copy link
Author

Can you try4.0.0rc0 and see if it works as expected?

Could be a breaking change there? I get:

INTERNALERROR>     extra.append(pytest_html.extras.url(issue, name=issue_id))INTERNALERROR> AttributeError: 'function' object has no attribute 'url'

Can you try ”from pytest_html import extras” instead?

Right, I found the problem (I used pluginmanager to get pytest-html). This doesn't seem to be only breaking change, At leastreport.extra is renamed toreport.extras without backward compatibility (my preference is to not break interfaces, but I understand that not everyone shares this approach).

screenshots in self-contained mode don't seem to work at all (same code used with old and new version, got these results):

  1. src attribute of<img> is different. current version addsdata:image/png;base64,${BASE64} version 4.0.0 adds just${BASE64}. Preview screenshot is not displayed in new version (while properly displayed in old)
  2. Clicking the preview (which is not displayed) opens URL with${BASE64} included (I tried this as well when working on images preview as this is easiest way to do that, but found base64 in URL pretty inconvenient; if I remember properly, my attempt worked, maybe because ofdata:... prefix which is missing in 4.0.0). That results in error:
Request-URI Too LongThe requested URL's length exceeds the capacity limit for this server.

Footnote: Personally I don't appreciate new data-jsonblob. pytest-html is amazing also because of the speed. This won't improve the speed (not to mention that such result is unprocessable).

@BeyondEvil
Copy link
Contributor

This is awesome feedback, thank you! 🙏

Can you try ”from pytest_html import extras” instead?

Right, I found the problem (I used pluginmanager to get pytest-html). This doesn't seem to be only breaking change, At leastreport.extra is renamed toreport.extras without backward compatibility (my preference is to not break interfaces, but I understand that not everyone shares this approach).

Correct. I'm exploring ways of keeping the "pluginmanager" functionality. But I'd like to at least warn when it's used. That type of usage makes future changes difficult. The proper way is to use what I recommended, a regular import.

As for "report.extra", that should be backwards compatible, but throws aDeprecationWarning when used. Could you please share how it's breaking for you?

screenshots in self-contained mode don't seem to work at all (same code used with old and new version, got these results):

  1. src attribute of<img> is different. current version addsdata:image/png;base64,${BASE64} version 4.0.0 adds just${BASE64}. Preview screenshot is not displayed in new version (while properly displayed in old)
  2. Clicking the preview (which is not displayed) opens URL with${BASE64} included (I tried this as well when working on images preview as this is easiest way to do that, but found base64 in URL pretty inconvenient; if I remember properly, my attempt worked, maybe because ofdata:... prefix which is missing in 4.0.0). That results in error:
Request-URI Too LongThe requested URL's length exceeds the capacity limit for this server.

I'm having trouble reproducing at least 1. In my testing I get previews in both regular and self-contained mode. Would you mind sharing some reproducible example code/test?

Footnote: Personally I don't appreciate new data-jsonblob. pytest-html is amazing also because of the speed. This won't improve the speed (not to mention that such result is unprocessable).

Would you mind elaborating on this a little bit?

How many tests does your report contain? Do all of them have extras in the form of images? In what way is the report slow? Rendering? Scrolling? etc.

Also, as for the unprocessable bit, what are you doing today that isn't possible with the new report?

My intent with v4 is that it should strive to be 1-to-1 with the old report as mush as possible. I'm trying my best to make as much as possible backwards compat. For things I want to change/remove I'm doing DeprecationWarnings so that I in v5 can remove them.

If you check the docs, all deprecations should be listed and have suggested mitigations.

Again, thank you for input - it's super valuable! 🙏

@BeyondEvil
Copy link
Contributor

Proper v4 is released now if you're interested in revisiting this@mganisin ?

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@mganisin@BeyondEvil

[8]ページ先頭

©2009-2025 Movatter.jp