Comments (15)
That will technically work, but instead of video a text dump of it will be displayed.
A proper AttachmentType
should help, but only if the allure-core itself allows video attachment.
Please check with allure-core docs or group in Gitter about proper content-type and video attachment capabilities.
from allure-pytest.
@pupssman It's already implemented. From Java I'm able to to attach video and play it from report. But in python it differs
See example. https://www.youtube.com/watch?v=74zD5q9DKTw
from allure-pytest.
@pupssman, videos are supported in core since 1.2.24, see allure-framework/allure1#777
You just need to provide proper mime-type, to make it work. The possible types are listed here:
https://github.com/allure-framework/allure-core/blob/master/allure-report-face/src/util/attachmentType.js#L29-L31
from allure-pytest.
Then you should be able to make that from python via proper attachment_type
, like with PNG:
allure.attach('Attach with PNG type', 'FooBar', allure.attach_type.PNG)
C https://github.com/allure-framework/allure-python/blob/master/demo/test_attaches.py#L36 for examples
The case is there is no content-type for video -- you will have to submit a PR to this repo to add that.
from allure-pytest.
@pupssman I created demo to show how video behaves now https://www.youtube.com/watch?v=MMJzbPWKk-s
Somehow it attaches, but on click it downloads instead of playing inside report. Any suggestions?
from allure-pytest.
Please do provide the XML files formed after test run.
Also, what attachment type have you used?
from allure-pytest.
Please find code below:
class AttachmentTypeExtended(Enum):
def __init__(self, mime_type, extension):
self.mime_type = mime_type
self.extension = extension
MP4 = ("video/mp4", "mp4")
Video attaches this way:
allure.attach('Video attach', open(path, "rb").read(), AttachmentTypeExtended.MP4)
from allure-pytest.
That looks fine, but to debug the actual problem we'd need a live XML report.
Also, what version of the report generator do you use?
from allure-pytest.
@pupssman please find live XML report in project below https://github.com/SergeyPirogov/video_recorder_python
See folder reports
from allure-pytest.
@just-boris please take a look at the XML:
<attachments>
<attachment source="458f40c5-2ebe-4b70-91e4-a55c21f9e3fe-attachment.mp4" title="Video attach" type="video/mp4"/>
</attachments>
That looks properly formed.
Also, @SergeyPirogov , what report tool version do you use?
from allure-pytest.
From the point of XML everything is fine.
I tested with my mp4 video, and it works like this:
The problem probably somewhere else
from allure-pytest.
Ok I will investigate deeper, because in java version everything works fine, I faced this issue in python implementation. I guess from allure side it's clear that everything work properly
from allure-pytest.
I've checked. Thank you guys. Question is closed. Video attaches properly. Problems described above connected with Chrome version 52 on Ubuntu 14.04. On other systems everything works fine
from allure-pytest.
Good
from allure-pytest.
@SergeyPirogov How did you do the implamentation in Java?
from allure-pytest.
Related Issues (20)
- Allure doesn't make a screenshot on a mobile device during the autotests with pyTest uiAutomator on Android HOT 8
- How to make allure plugin dependent on another plugin? HOT 2
- Can I see log trace of a passed test case, currently the debug trace is only for failed test cases HOT 2
- @Attachment for video having .webm is not attaching to the allure report in Ubuntu HOT 3
- seeing some os.error too many files.. any known issue here ? HOT 1
- Plugin already registered HOT 5
- I am looking to add a attachment in one of the tabs , not to a test case HOT 3
- Got ImportError: cannot import name 'unicodify' error after updating to version allure-pytest 2.0.0b2 HOT 31
- Unable to execute test cases specifying --allure_features or --allure stories attribute HOT 5
- Support tags: HOST, FEATURE and etc via LabelType class HOT 1
- Teardown function's logs not captured in allure report HOT 3
- Providing a responsive UI HOT 1
- Incompatible with pytest 3.2.0 HOT 1
- getting ValueError: option names set(['--alluredir']) already added" while trying to build a job on jenkins with allure-pytest plugin HOT 1
- Cyrillic symbols display like unicode in test's title HOT 1
- Multiple flow test xml-report counldn't be generated if one or more tests failed HOT 2
- Is it possible to rename test suits and test cases names? HOT 8
- why?How to solve this error? HOT 1
- Warnings during generating of allure report - RemovedInPytest4Warning HOT 3
- good!
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from allure-pytest.