allure-framework / allure-ruby

Allure integrations for Ruby test frameworks
Apache License 2.0
57 stars 22 forks source link

Sending artifacts does not work for Cucumber on Ruby out of the box #560

Open cheshi-mantu opened 1 month ago

cheshi-mantu commented 1 month ago

Current behaviour

Sending artifacts does not work for Cucumber on Ruby from the box

“ERROR -- : Can't add attachment, no test, step or fixture is running” during running the method “Allure.add_attachment(name: "Attachment Video", source: video_log_path, type: Allure::ContentType::TXT, test_case: true)” - just trying to send the text with name and link as txt content type

I am running a test with: “--format AllureCucumber::CucumberFormatter” and use the latest Allure gem version

Expected behaviour

artefacts are attached to test results

andrcuns commented 3 weeks ago

Would You be able to provide an example that reproduces it? From the error it seems you are trying to add attachment before a test case is actually started.

I was not able to reproduce it via example repo: https://github.com/allure-examples/allure-cucumber-example/blob/master/features/step_definitions/common_steps.rb#L41

agileseph commented 3 weeks ago

Originally, I could reproduce the issue within our project. Let me try with the demo example: it could be the case that we use a customized Cucumber framework on our project and some allure internal code requires minor adoption or patch within our project. I will try first with the demo project, then continue with debugging on our project, and come back to you guys with the results. Thank you for providing the example code.