Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/issue 234 add scenario attach method #329

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

kenhosr
Copy link

@kenhosr kenhosr commented Sep 17, 2019

Description:

An example usage:

  1. update your conftest.py by implementing the hook: pytest_bdd_after_scenario
    https://gist.github.com/kenhosr/3cb60efce5481d25967479e67f7edb76

  2. run your test using: pytest --cucumber-json=cucumber_report.json

  3. convert the .json to .html by following instructions here:
    https://github.com/gkushang/cucumber-html-reporter

Sample Report:

comments

khvirtru and others added 4 commits September 17, 2019 09:49
* ISSUE-234 add scenario attach method
* ISSUE-234 add scenario attach method

* add embeddings to logreport

* add missing data

* add media type

* add to the end of the test

* add embeddings
* fix unit tests/linting issues
* fixed lint issues of feature.py
@codecov-io
Copy link

codecov-io commented Sep 17, 2019

Codecov Report

Merging #329 into master will decrease coverage by 0.12%.
The diff coverage is 50%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #329      +/-   ##
==========================================
- Coverage   95.64%   95.51%   -0.13%     
==========================================
  Files          57       57              
  Lines        2202     2208       +6     
  Branches      184      184              
==========================================
+ Hits         2106     2109       +3     
- Misses         65       68       +3     
  Partials       31       31
Impacted Files Coverage Δ
tests/feature/test_cucumber_json.py 96.96% <ø> (ø) ⬆️
pytest_bdd/reporting.py 92.42% <ø> (ø) ⬆️
pytest_bdd/cucumber_json.py 92.85% <ø> (ø) ⬆️
tests/feature/test_report.py 82.5% <ø> (ø) ⬆️
pytest_bdd/feature.py 98.14% <50%> (-1.1%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c6b16b6...4a09095. Read the comment docs.

@kenhosr
Copy link
Author

kenhosr commented Sep 17, 2019

found out an issue that when use Scenario Outline, it will attach data multiple times depending on the Examples table size. I will fix it later.

@robsonpolicarpo
Copy link

Hi! This branch will go to merged with master? Any prevision?

@david-vankampen
Copy link

david-vankampen commented Apr 15, 2024

@kenhosr is it possible to revisit this one and freshen it up for merging? It seems like a very useful feature.

Also, the gist linked here seems incorrect/unrelated:

update your conftest.py by implementing the hook: pytest_bdd_after_scenario
https://gist.github.com/kenhosr/3cb60efce5481d25967479e67f7edb76

could you freshen that up as well? Thank you!

And finally, an additional thought: pytest-nunit also has the add_nunit_attachment feature here... is it possible/beneficial to piggyback off of that if it exists, so as to reduce duplication?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Embedding made screenshot into cucumber json report
5 participants