Code Monkey home page Code Monkey logo

Comments (15)

pupssman avatar pupssman commented on August 18, 2024

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.

SergeyPirogov avatar SergeyPirogov commented on August 18, 2024

@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.

just-boris avatar just-boris commented on August 18, 2024

@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.

pupssman avatar pupssman commented on August 18, 2024

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.

SergeyPirogov avatar SergeyPirogov commented on August 18, 2024

@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.

pupssman avatar pupssman commented on August 18, 2024

Please do provide the XML files formed after test run.
Also, what attachment type have you used?

from allure-pytest.

SergeyPirogov avatar SergeyPirogov commented on August 18, 2024

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.

pupssman avatar pupssman commented on August 18, 2024

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.

SergeyPirogov avatar SergeyPirogov commented on August 18, 2024

@pupssman please find live XML report in project below https://github.com/SergeyPirogov/video_recorder_python

See folder reports

from allure-pytest.

pupssman avatar pupssman commented on August 18, 2024

@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>

https://github.com/SergeyPirogov/video_recorder_python/blob/master/reports/5b9f150a-3737-4ad0-8750-4724e412bc28-testsuite.xml#L33-L35

That looks properly formed.

Also, @SergeyPirogov , what report tool version do you use?

from allure-pytest.

just-boris avatar just-boris commented on August 18, 2024

From the point of XML everything is fine.

I tested with my mp4 video, and it works like this:
image

The problem probably somewhere else

from allure-pytest.

SergeyPirogov avatar SergeyPirogov commented on August 18, 2024

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.

SergeyPirogov avatar SergeyPirogov commented on August 18, 2024

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.

pupssman avatar pupssman commented on August 18, 2024

Good

from allure-pytest.

alecyeli avatar alecyeli commented on August 18, 2024

@SergeyPirogov How did you do the implamentation in Java?

from allure-pytest.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.