CodeceptJS icon indicating copy to clipboard operation
CodeceptJS copied to clipboard

[BUG] Video option with CodeceptJS and Playwright

Open Miriambnzdn opened this issue 3 years ago • 6 comments

Hello, I'm using CodeceptJS with Playwright as helper. When I activate the "video" option and my scenarios are played, I can see a .webm file in the "output/video" folder. But when my scenario ends with a failure, the file disappears and it is impossible to find it again.

Does anyone have any idea what is going on?

Miriambnzdn avatar Aug 24 '22 10:08 Miriambnzdn

Don't you have a teardown script or similar that is deleting the ouput?

I use CodeceptJS with Playwright and I see videos after tests have failed.

nicostubi avatar Aug 24 '22 19:08 nicostubi

Hi, Nope I don't have anything. And it's strange because I didn't have this problem before the upgrade from 3.3.3 to 3.3.4.

Miriambnzdn avatar Sep 01 '22 06:09 Miriambnzdn

How do you implement this option?

Miriambnzdn avatar Sep 02 '22 10:09 Miriambnzdn

No answer ?

Miriambnzdn avatar Sep 08 '22 07:09 Miriambnzdn

???

Miriambnzdn avatar Sep 22 '22 07:09 Miriambnzdn

can you clarify your latest question ? Which option do you want to implement ?

nicostubi avatar Sep 22 '22 08:09 nicostubi

Hi, as I say previously, I ask for video option. Can you please explain me how you implement this option because that doesn't work for me

Miriambnzdn avatar Sep 22 '22 13:09 Miriambnzdn

As specified in the documentation: https://codecept.io/playwright/#video

Sorry, we can only imagine you have the proper config. But we don't know the configuration you are using, nor we have a repro project.

The minimum would be to follow the template when creating a new issue, this would save us a lot of time and this would help us to help you.

BR Nicolas

nicostubi avatar Sep 22 '22 15:09 nicostubi

I don't share my config because she's lambda. This is my config : Capture d’écran 2022-09-23 à 09 07 58

Where can I find the template you talking about ?

Miriambnzdn avatar Sep 23 '22 07:09 Miriambnzdn

Your configuration is incomplete. On mine, I have the setting "tests:" above the output. And I don't know what you have within your variable process.env.profile.

Assuming your configuration is correct (but with a partial example and no repro project, not easy to say), this is exactly what I am using as well to have output videos. But I doubt your config is correct. When I remove this line on my config (the one just above output):

tests: './tests/*/**_test.ts',

I have 0 tests passed.

When you have a failed test, do you see any screenshots within your output folder ?

Here is the template. As you will see, the template is asking for your config file. If you follow (I recommend you to start from scratch with a brand new issue and a clear title about what the problem actually is, or what you think it is):

image

Also remember you have the code source here on github, so you may implement your configuration in a test/repro project (that you could share here if really not working). There is even a "CodeceptJS TypeScript Boilerplate" project to speed up things: https://github.com/codeceptjs/typescript-boilerplate

nicostubi avatar Sep 24 '22 08:09 nicostubi

Hi, my config isn't complete. It's a partial example tu show you how I implement the option.
I have an output folder with screenshots. You can see my entire config just here : Capture d’écran 2022-09-26 à 09 09 17

I use Gherkin for my tests. Ok thank you for all thus information.

Miriambnzdn avatar Sep 26 '22 07:09 Miriambnzdn

where is your video configuration?

nicostubi avatar Sep 28 '22 20:09 nicostubi

This is my configuration without option video, this is my configuration with video option : Capture d’écran 2022-09-30 à 09 04 22

I also tried with Trace option and that work very well. I don't understand why video option doesn't.

Miriambnzdn avatar Sep 30 '22 07:09 Miriambnzdn

@Miriambnzdn try my simple test with playwright to see if video is generated for you. I could see video generated from my end.

https://github.com/PeterNgTr/codeceptjs-playwright-fun

kobenguyent avatar Sep 30 '22 07:09 kobenguyent

maybe I create a duplicate of this bug: https://github.com/codeceptjs/CodeceptJS/issues/3614

ua1wcz avatar Mar 13 '23 12:03 ua1wcz

Closed for now! Feel free to reopen if you still encounter the issue with latest version and would be nice to provide a sample code to reproduce the issue.

kobenguyent avatar Oct 19 '23 12:10 kobenguyent