Commit Graph

121 Commits

Author SHA1 Message Date
Gleb Nikonorov 5e4950b6f4
Allow for redacting of environment table values (#431)
* Add untested change

* Add tests

* Add documentation

* Add the changelog entry

* remove debug code from test

* Change wording of documentation
2021-01-22 22:26:17 -05:00
Gleb Nikonorov c9f442b127
split plugin.py into smaller files (#427) 2020-12-18 17:54:41 -05:00
Jim Brännlund a0a5916bd7
Handle flaky windows test by rerunning (#414) 2020-12-14 00:02:47 +01:00
Jim Brännlund bbcc0f214f
Bump Black and Flake8 deps (#416)
Co-authored-by: Gleb Nikonorov <gleb.i.nikonorov@gmail.com>
2020-12-13 23:52:19 +01:00
Gleb Nikonorov e26097224a
Make the report tab title reflect the report name (#420)
* Make the report tab title reflect the report name

* refactor test_report_title test
2020-12-13 17:21:54 -05:00
Gleb Nikonorov 727b305a57
Enable camelcase eslint rule (#410) 2020-12-12 17:19:19 +01:00
Prakhar Gurunani 8b7bdc1fc5
Better error on missing CSS files. (#390)
Co-authored-by: Gleb Nikonorov <gleb.i.nikonorov@gmail.com>
2020-12-09 16:25:14 +01:00
Gleb Nikonorov 2bb20108c6
Stop attaching test reruns to final test report entries (#387)
* treat rerun entries as seperate test runs

* Add changelog entry

* fix a typo

* remove debug code

* fix flaky test on mac
2020-11-30 21:40:18 -05:00
Jan Kowalleck 3f6368693f
Move sources to `src` dir (#384) 2020-11-27 15:14:03 +00:00
Gleb Nikonorov b57ca0bcf2
Allow for report duration formatting (#380)
* first attempt at a working solution

* final solution, no tests

* Update README.rst

Add documentation on how to provide a custom display value for duration formatters

* temp

* finalize the change

* undo test report changes

* fixup tests

* Clarify default duration column data formatting

* fix failing tests

Co-authored-by: Sorin Sbarnea <ssbarnea@redhat.com>
2020-11-27 12:10:43 +00:00
Gleb Nikonorov d971d0065d
Respect --show-capture=no flag (#359) 2020-10-29 15:57:27 +00:00
Charles Machalow b9bb5a9b4d
Enable testing on Windows and MacOS (#357)
Co-authored-by: Gleb Nikonorov <gleb.i.nikonorov@gmail.com>
2020-10-24 14:52:57 +01:00
Gleb Nikonorov b609a1d914
Respect pytest --capture=no and -s flags (#353) 2020-10-23 14:44:31 +01:00
Charles Machalow f2d41db105
Post process html to include teardown in log (#271) 2020-09-18 09:51:15 +01:00
Gleb Nikonorov c5a82636be
Sync .pre-commit-config.yaml with pytest (#335) 2020-09-17 08:41:10 +01:00
Sorin Sbarnea cbfc38d4c7
Consolidate tox environments (#328) 2020-08-11 13:54:34 +01:00
Sorin Sbarnea 955eb440cc
Merge branch 'master' into fix-ansi-in-report 2020-08-10 13:16:46 +01:00
Gleb Nikonorov 4dfec1cdec
Make the links column in the results table sortable (#324)
* Make the links column sortable
2020-08-04 16:41:42 +02:00
Michał Bielawski 4556076800
Make the maximum asset filename length configurable. (#313)
* Make the maximum asset filename length configurable.
2020-07-27 14:16:00 +02:00
Jim Brännlund 3a4efa1d18 Strip ANSI escape sequences when ansi2html is missing
Fixes: #314
2020-07-16 19:15:44 +02:00
Zac-HD 97f275f47d Rename for xdist compatibility
Fixes #305
2020-06-14 18:10:35 +10:00
Dan Halperin 9e06ccb376 Improve testing for images in html
This is for pytest-dev/pytest-selenium#237.

My original change was redundant with pytest-dev/pytest-html#277, so just
update tests and acknowledgements for the author of #277, the author of #287,
and the reporters of #265 and pytest-dev/pytest-selenium#237.
2020-05-14 13:52:54 -07:00
Jim Brännlund fe7b622cc0
Merge branch 'master' into fix-missing-image 2020-05-14 20:51:55 +02:00
Jim Brännlund 599693b729 Better fix for TerminalReporter issue 2020-05-14 13:38:52 +02:00
Christian Sandberg fea4eb3f3d Fix image missing when using Base64 content 2020-03-21 19:39:32 +01:00
Christian Sandberg 27be3f5d29 Temporary hack to solve test failures 2020-03-18 19:32:04 +01:00
Christian Sandberg 145c746a07 Add extra fixture 2020-02-29 19:50:21 +01:00
werdeil 966228c3ea Add hook to change report main title 2020-02-28 13:41:01 +01:00
Jim Brännlund 301d52f150 Fix collapsable bug 2020-02-20 12:12:12 -05:00
Jim Brännlund ac30b65c34 Control render using configuration 2020-02-15 02:46:49 +01:00
Maxime Jacob e63d5ca02b Remove forgotten debug output that was poluting the test outputs. 2020-02-05 19:20:05 -05:00
Maxime Jacob d6bc3ab6cf Added an extra test to cover the case where a href would be contained in the dictionary.
Dictionary string generation now uses json.dumps instead of the handmade json.dumps.
2020-02-05 18:09:18 -05:00
Maxime Jacob 753ca944ea Merge branch 'master' of https://github.com/pytest-dev/pytest-html 2020-02-05 17:15:36 -05:00
Maxime Jacob 27b9051970 Added support for ordering metadata dictionaries by key. This compare requires casting the keys to string, as
far as I know.
2020-02-04 20:03:23 -05:00
Maxime Jacob f03b9d9a4b Added the CSS specification for the video class. It is pretty much a duplicate of the image css.
Code for the video extra has been extracted to a function to clean up a bit the if/elif/elif that is starting to
get pretty big. Maybe the other conditions could be extracted to their own method to clean up a bit. Once again,
there seems to be a lot of code duplication with image, so we may want to refactor images, videos, and audio as
a media type and have some kind of template method.

Basic unit tests were added to make sure that the extra was correctly added to the report when the extra was
requested.
2020-02-01 21:01:19 -05:00
Jim Brännlund 97267a2523 Release v2.0.1 2019-11-05 14:15:06 -08:00
Andy.Yang 3d5e3340aa
Merge branch 'master' into master 2019-11-05 14:48:52 +08:00
Andy.Yang 618af9e072
Support utf8 display 2019-11-05 13:44:08 +08:00
Krzysztof Pawlik 7166364ad4 Close opened resource. (#235)
* Close opened resource.

* Update pytest_html/plugin.py

Co-Authored-By: Bruno Rocha <rochacbruno@users.noreply.github.com>

* Use `f""` instead of `.format()` call.

* Add validation for raised warnings to tests.
2019-11-03 04:58:59 +01:00
Hugo van Kemenade e6e5ef2585 Drop support for legacy Python 2.7 (#230)
* Drop support for legacy Python 2.7

* Upgrade Python syntax with pyupgrade --py36-plus

* Require pytest 5+, supports only Python 3

* Format with Black
2019-09-09 10:10:07 +02:00
Wanam b69dde56a3 Keep sort preference for previously sorted columns (#220)
* Keep sort preference for previously sorted columns
2019-08-07 23:44:02 +02:00
Jim Brännlund 9dd249f200
Fix assets file naming to work across both *nix and windows (#223)
* Fix assets file naming to work across both *nix and windows

Fixes #214
Fixes #213

* Better replacement strategy for test id

* Update markers
2019-08-06 13:57:05 +02:00
Jim Brännlund 6abbbff3e4
Remove unused and undocumented markers (#224) 2019-08-05 18:34:11 +02:00
Jim Brännlund 8e96c6ed94
Migrate to 'black' for consistent styling and formatting (#218)
* Migrate to 'black' for consistent styling and formatting

* Add black to tox and travis
2019-08-04 14:09:46 +02:00
Michał Bielawski 623efc6198 Truncate long test names in assets. 2019-06-19 15:40:12 +01:00
Jim Brännlund 582c29fb5a Handle when report title is stored as an environment variable
When the --html flag is used in pytest.ini with "addopts" and the
report title is stored in an environment variable, the name of the
environment variable was used as the report title.

In other words, the environment variable was never expanded.

Fixes: #201
2019-04-26 11:08:20 +02:00
Iulia Liakh 27b6e77ab1 Change assets naming method (#199)
* added assets name hashing option

* from command line option to config option

* new naming strategy

* fix

* Flake8 issues fixed

* more Flake8 issues fixed
2019-02-19 06:34:01 -03:00
Ana Ribeiro 6f9b14c7eb Fixed tests that were failing due Pytest updates (#190)
* Corrected Rerun failures - from 4ec74311cd (diff-c3a581865b7c0be4e6b5d5fa60d6aed5)

* Removed ENV

* Changed funcarg to pytest fixture

* Removed some comments

* Style matter

* Style

* Reversed rerunfailures to 4.1

* Style

* added comment about issue 77

* Removed rerunfailures version due launch of rerunfailures 6.0
2019-01-11 10:00:33 +00:00
Anthony Sottile 79e1d7d53f Fix invalid escape sequences 2018-06-30 08:41:17 -07:00
Jace Browning 13a299f28f Add implementation of 'includes' for PhantomJS
https://stackoverflow.com/a/31361163/429533
2018-06-01 10:42:26 +01:00
Jace Browning fb6a456415 Disable sort on environment table when metadata is ordered 2018-05-22 11:31:53 +01:00
Dave Hunt 51c77d5c3f
Finish up the custom CSS support including docs and tests 2018-04-05 13:29:13 +01:00
Dave Hunt ebebda43dd
Report collection errors in HTML report. (#154)
Fixes #148
2018-04-05 11:31:56 +01:00
Joep Schuurkes d5031769b6 Add hook for modifying summary section (#152)
Closes #109
2018-04-05 11:31:20 +01:00
Joep Schuurkes abf8f15e4e adds filename of report as title to html body 2018-03-26 16:22:57 +01:00
Jeffry Pincus c61dc5bbe0 Fix for including a screenshot bug on Windows (#136)
Fixes #124
2018-01-04 12:48:33 +00:00
Dave Hunt e7b1f6e4d3
Fix regular expression for duration in tests 2017-09-19 09:22:16 +01:00
Rasmus Pedersen 950b889108 Improve rendering of collections in metadata (#132)
Render metadata collection values as comma seperated strings.
2017-09-19 04:04:34 -04:00
Dave Hunt 0c442e43ae Minor style improvements 2017-08-15 09:16:32 +01:00
Chingiz_Toimbetov 708369a6db Change 'passed tests' numeration in tests 2017-08-15 09:06:09 +01:00
Chingiz_Toimbetov e9b2433549 Decode all bytes strings in extra text. 2017-08-15 09:06:09 +01:00
Tomasz Gajewski a0cade6e0c
Fixed handling unicode longrepr values. Fixes #114. 2017-06-09 15:47:25 +01:00
Jim Brännlund f19a86d1e3
Add ability to specify images as file or URL
Fixes #77
2017-06-06 14:31:19 +01:00
Dave Hunt 4c81503c69
Always encode content for data URI
Fixes #106
2017-03-08 16:23:38 +00:00
Dave Hunt a1413ed734
Restore environment heading, fix tests, and document pytest-metadata changes 2017-02-27 13:04:36 +00:00
Dave Hunt 2817ac5077
Encode all non-binary assets as utf-8. Fixes #98 2017-02-24 12:54:40 +00:00
Dave Hunt e0c147db22
Add some tolerance to test_durations 2017-02-24 11:35:59 +00:00
Dave Hunt 67e8f28bbd
Escape log sections in HTML report. Fixes #100 2017-02-24 11:29:23 +00:00
Nicolas 98e9abb4cf Add support for JPG and SVG (#87)
Fixes #89
2016-11-30 09:23:34 +00:00
Prem Karat 24e169d9a4
Add ANSI support to report
ANSI codes used for color logging is not retained in html report
This patch adds that support. Fixes/implements issue#74.

Signed-off-by: Prem Karat <pkarat@mvista.com>
2016-11-08 11:40:42 +00:00
Ana Ribeiro 972058bb60 Add JavaScript tests (#73)
Fixes #49
2016-10-06 15:14:09 +01:00