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

Video Embed Possible? #43

Closed
parky128 opened this issue Jun 28, 2021 · 9 comments
Closed

Video Embed Possible? #43

parky128 opened this issue Jun 28, 2021 · 9 comments
Labels
enhancement New feature or request

Comments

@parky128
Copy link

Hi, is it possible to get video's embedded as links or something similar into the generated HTML report?

Thanks

@parky128 parky128 added the enhancement New feature or request label Jun 28, 2021
@LironEr
Copy link
Owner

LironEr commented Jul 2, 2021

Currently no, because we cant add context per suite/spec file.
Related issues: adamgruber/mochawesome-report-generator#124 adamgruber/mochawesome-report-generator#150

@SriSivaBatchu
Copy link

SriSivaBatchu commented Mar 13, 2022

Hi @LironEr

Instead of waiting for the context for suite. I thought of adding a test entry (provided below) in tests array, after cypress execution just like enhanceReport function updating the context, here I'm adding a test entry.
When using file name I'm able to see the video in the HTML file, but I had to share the video along with the html report.
Could you please suggest a way to add the video in the embedded format. I tried some ways they didn't worked.
suitesMap.forEach((suiteEntry) => { suiteEntry.tests.push({ title: "Execution Video", fullTitle: "Test Execution Video", timedOut: null, duration: 1, state: "passed", speed: "fast", pass: true, fail: false, pending: false, context: JSON.stringify({ title: "Execution video", value: videoDetails.embeddings.data }), code: "", err: {}, uuid: "f4c9b97d-f7cc-45e3-a383-852df0eec2d2", parentUUID: "b43632da-b240-4fe7-a130-c29065bd5f87", isHook: false, skipped: false }) })

@mudit94
Copy link

mudit94 commented Jun 20, 2022

hi @LironEr , any progress in this?

@LironEr
Copy link
Owner

LironEr commented Jun 23, 2022

Currently no, because we cant add context per suite/spec file. Related issues: adamgruber/mochawesome-report-generator#124 adamgruber/mochawesome-report-generator#150

@mudit94 unfortunately no

@DariuszM-DCX
Copy link

Hi,
Could we try again I see it is config for it
https://glebbahmutov.com/blog/the-awesome-battle/

@joakim-sch
Copy link
Contributor

So it seems that Bahmutov embeds the video file for the whole suite to the test(s) that fail.
👎 Same videofile might be embedded on several failed tests
👎 Videofile for failed tests will contain alot more tests than the one you are looking for
👍 Embedded videofile 👏🏼

@kris-luminar
Copy link

This feels like were making some progress at last!

@joakim-sch
Copy link
Contributor

joakim-sch commented Mar 28, 2023

Gave it a try with #137 , give it a look and let me know what you think 😸
Actually think its works quite well if you don't mind me saying so...

One of the challenges was that there is no Videos-api in Cypress from which to get the file locations from. This doesn't cause a problem in Bahmutov's example, but he also doesn't organized his tests into any subfolders. Once you have a folder-structure, it complicates things.
I found a way on rosettacode.org to extrapolate which folder is the supposed base spec folder, in order to subtract the base spec folder directories from the relative path to the spec files (which leaves the spec name with any sub-folders intact). Then just simply adding .mp4.

Also, I made the decision to add the spec-video files generated to all tests in the spec. Since it all links to the same file and the video shows the tests for the entire spec-file, I thought it to be less confusing that all the tests in the spec has the same video file, rather than just the failed ones...

Discuss guys 👂🏼

@LironEr
Copy link
Owner

LironEr commented Apr 22, 2023

@joakim-sch Great work!

Released in v3.4.0

@LironEr LironEr closed this as completed Apr 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

7 participants