Closed samplehub closed 2 months ago
Describe the bug How to add video as an attachement to allure cucumber-js report.
To Reproduce Steps to reproduce the behavior: Create BDD cucumber Playwright framework Add allure-reporter . Ref : https://github.com/allure-framework/allure-js/blob/master/packages/allure-cucumberjs/README.md Create Hooks.ts file where the tests are invoked from a context with record video parameter
Before Hooks this.context = await global.browser.newContext({ storageState: path.join(workingDir, test/testData/storageStates/xyz.json), recordVideo: { dir: ${global.videosPath}/${global.testName} }
test/testData/storageStates/xyz.json
${global.videosPath}/${global.testName}
After Hooks this.attach(${global.videosPath}/${global.testName}, 'video/webm');
Expected behaviour Shall be able to add and play videos as an attachment in BDD framework .
Screenshots Empty video files are attached to the report I am able to attach screenshots & json files fine
Desktop (please complete the following information):
Additional context Please can you provide quick example how to attach videos in the above scenarios. Thanks in advance
Issue has been resolved. Solution : const videoPath = await this.page?.video().path(); this.attach(fs.readFileSync(videoPath), 'video/webm');
Describe the bug How to add video as an attachement to allure cucumber-js report.
To Reproduce Steps to reproduce the behavior: Create BDD cucumber Playwright framework Add allure-reporter . Ref : https://github.com/allure-framework/allure-js/blob/master/packages/allure-cucumberjs/README.md Create Hooks.ts file where the tests are invoked from a context with record video parameter
Before Hooks this.context = await global.browser.newContext({ storageState: path.join(workingDir,
test/testData/storageStates/xyz.json
), recordVideo: { dir:${global.videosPath}/${global.testName}
}After Hooks this.attach(
${global.videosPath}/${global.testName}
, 'video/webm');Expected behaviour Shall be able to add and play videos as an attachment in BDD framework .
Screenshots Empty video files are attached to the report I am able to attach screenshots & json files fine
Desktop (please complete the following information):
Additional context Please can you provide quick example how to attach videos in the above scenarios. Thanks in advance