Closed jancorvus closed 12 months ago
@Vorobeyko
The video file turned out to be not yet renamed by the time of reading. Its name is <browser_session>.mp4
. And this bug does not display on all environments. It was on CI agents only for me. It may be too fast or too slow for the relation between the framework and Selenoid.
Some waiter should be added before
allureReporter.addAttachment('Video', fs.readFileSync(path.join(global.output_dir, 'video', fileName)), 'video/mp4');
the file never gets renamed if restart: false
is used in the config. Instead what happens is that the video gets overwritten by each new test starting so it is only renamed when the tests finish so if you ran 10 tests you will have only one video for the last test that ran
@GSasu yes, it's a known behavior. My config has restart
set to true
. So, no issues with that, each video file is created per test.
So, adding a waiter does not help. The renaming itself happens when the next test has started. Even if I call allureReporter.addAttachment by then, the video gets attached to the running test but not to the previous one the video belongs to. And if I use a blocking sleep/delay, the renaming does not happen at all until the waiter is over time. I wonder when the renaming by Selenoid happens? on what event? how can we bind to it in the framework?
ok. I circumvented the issue by creating a script that attaches selenoid videos to the Allure XML when the whole suite is over. And I had to put waits in the script since by the end of a suite, last videos are still being renamed by Selenoid. The last video can be renamed in 5-10 secs after the suite is finished.
ok. I circumvented the issue by creating a script that attaches selenoid videos to the Allure XML when the whole suite is over. And I had to put waits in the script since by the end of a suite, last videos are still being renamed by Selenoid. The last video can be renamed in 5-10 secs after the suite is finished.
Hi @jancorvus I have the same problem, the video never adds to the Allure Report. And all test videos that have passed are never deleted.
Can you send to me, your solution to circumvent the issue.
Hi, I think I understand what happens, but I have no idea how to fix it.
Initially, we have a docker container running only Selenium on port 4444, I will named this container “selenoid”.
When Codeceptjs creates a new Selenium session, in Docker will happen:
1 - The Container “selenoid”, will create a new container, for example the chromedriver, I will named this container “selenoid/vnc_chrome”.
2 - If the video is active, the container “selenoid/vnc_chrome”, will create a new container for recording the video, I will named this container “video recorder”, this last container is responsible for recording and renaming the video. It is active while the “selenoid/vnc_chrome” container is running.
So, when codeceptjs deletes the Selenium session, in Docker will happen:
1 - The “video recorder” container will finish recording the video and rename, finishing up the container at last. 2 - Container “selenoid/vnc_chrome” is finished.
Then, the problem is that, we will only have the video, after the session in the selenium is deleted, and this occurs when everything is over, consequently, we have no more test running and allure will fail to add the attachments.
The same problem occurs with the deletion of videos from the tests that passed.
I hope I helped in analyzing the problem
best regards.
allure plugin is now maintained by allure team https://github.com/allure-framework/allure-js/tree/master/packages/allure-codeceptjs
What are you trying to achieve?
Run tests with Selenoid and Allure plugins enabled in the version 3.0.0-beta.4
What do you get instead?
Error
Details