pytest-dev / pytest-dev/pytest-html

Possible to have --self-contained-html extra.image open in new tab

Open
#294 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Python
Stars
779
Forks
260
PR merge metrics
No merged PRs in 30d

Description

Hi,

So currently I would like to pass images from web driver as base 64 encoded straight into your extra.image helper.

When setting to --self-contained-html. This works great, the only downside is that the images are no longer clickable. They don't open in a new tab.

Would it be possible to embed a little bit of JS on an onClick handler so that the image can open in a new tab? I'd love to submit a pull request but Im not Pythonic enough just yet!

This would be the icing on the cake for the self contained option!

Thanks

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the extra.image helper and the --self-contained-html output path in the pytest-html codebase. Check how embedded images are rendered, then verify that clicking an image opens it in a new tab while preserving self-contained output.

Written by the indexing model from the issue text.

Assessment

Tech stack
html, javascript, python
Domain
testing-qa
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.