pytest-dev / pytest-dev/pytest-html
pytest-html does not escape HTML in testId (v4.2.0)
Open
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 779
- Forks
- 260
- PR merge metrics
- No merged PRs in 30d
Description
Hello,
I created a parametrize test where testId contains the following text:
<span style="font-weight: bold; color: red; font-size: 2em;">text</span>
pytest-html generated the next report:
Is it an expected behaviour?
Test code:
import pytest
@pytest.mark.parametrize(
"data",
[
'<span style="font-weight: bold; color: red; font-size: 2em;">text</span>',
],
)
def test_unescape(data): print("ha-ha")
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by running the supplied parametrized Python test and inspecting the generated pytest-html report. The issue names no repository file or test to begin with, so trace how the testId is inserted into the report. Done means the report consistently renders the testId as literal text rather than interpreting its HTML markup.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- html, python
- Domain
- testing-qa
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100