View in #general on Slack
@Vasyl_Yurkovych: @davert Hello, is there a way to attach playwright video recording to the allure report in jenkins?
@davert: not yet. There is tricky moment that video is processed at the very end of execution.
Path to video is added to test.attachments
So you can access it from a helper or a plugin.
@Aliaksei_Fesun: I’ve done for my project via listener
const { event } = require("codeceptjs");
const allure = codeceptjs.container.plugins("allure");
event.dispatcher.on(event.test.after, (test) => {
const FORMAT = "video/webm";
const TITLE = "Video of failed test:";
if (test.artifacts != undefined && test.artifacts.video != undefined) {
allure.addAttachment(TITLE, fs.readFileSync(test.artifacts.video), FORMAT);
} else if (test._retriedTest != undefined && test._retriedTest.artifacts.video != undefined) {
allure.addAttachment(TITLE, fs.readFileSync(test._retriedTest.artifacts.video), FORMAT);
}
it works for me