allure-js
allure-js copied to clipboard
[allure-js] Cannot start new step using v.2.0.0-beta.18 with cucumber-js
currentExecutable throws "No executable!" error when trying to execute startStep function.
Error: No executable!
at CucumberAllureInterface.get currentExecutable [as currentExecutable] (/Users/fguidobaldi/Repositorios/fury_qaautomation/node_modules/allure-cucumberjs/dist/src/CucumberAllureInterface.js:65:15)
at CucumberAllureInterface.startStep (/Users/fguidobaldi/Repositorios/fury_qaautomation/node_modules/allure-cucumberjs/dist/src/CucumberAllureInterface.js:74:33)
at attachRequestAndResponse (/Users/fguidobaldi/Repositorios/fury_qaautomation/features/steps/when.js:410:33)
at World.<anonymous> (/Users/fguidobaldi/Repositorios/fury_qaautomation/features/steps/when.js:176:7)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
I added plain Reporter code following the docs (https://github.com/allure-framework/allure-js/blob/master/packages/allure-cucumberjs/README.md), but it doesn't work out.
const { CucumberJSAllureFormatter } = require('allure-cucumberjs');
const { AllureRuntime } = require('allure-cucumberjs');
function Reporter(options) {
return new CucumberJSAllureFormatter(
options,
new AllureRuntime({ resultsDir: './allure-results' }),
{},
);
}
Reporter.prototype = Object.create(CucumberJSAllureFormatter.prototype);
Reporter.prototype.constructor = Reporter;
exports.default = Reporter;
This code was working with v.2.0.0-beta.9 and Cucumber 6
Expected behavior I should be able to create new steps using newer versions of allure-js.
Hi @baev! Sorry to tag you, but since you were working on Cucumber integration, do you have any thoughts about this?
I'm glad to contribute with some PR, but I'm not sure about this error I'm getting. In fact, that currentExecutable
getter is explicitly throwing an error, there's no additional code inside that function (https://github.com/allure-framework/allure-js/blob/master/packages/allure-cucumberjs/src/CucumberAllureInterface.ts#L88).
Am I using this library the wrong way?
Hey, @fguidobaldi! Thank you for the issue! Could you please try next code for your reporter?
const { CucumberJSAllureFormatter } = require("allure-cucumberjs");
const { AllureRuntime } = require("allure-cucumberjs");
class Reporter extends CucumberJSAllureFormatter {
constructor(options) {
super(
options,
new AllureRuntime({ resultsDir: "./allure-results" }),
{}
);
}
}
module.exports = Reporter;
class
supports widely even in early node.js version, there shouldn't be any problem to use them.
Hi @lamartire! I tried the snippet you shared, but I'm getting the same error. This is my code, working just fine with v.2.0.0-beta.9
function attachRequestAndResponse(world, response) {
const testStep = world.allure.startStep(`Test #${world.count}`);
const step = world.allure.startStep('Request');
world.attach(JSON.stringify(response.request._data), 'application/json');
step.endStep();
attachResponse(world, response);
testStep.endStep();
world.count += 1;
}
Currently, when execution reaches world.allure.startStep('Request')
, it throws the "No executable" error mentioned above.
Is it possible to share the repository code or create an example where I can reproduce the problem?
I'm working on PoC to reproduce this issue, I'll send it as soon as I finish it.
Hi @lamartire! I created this repo with the minimum code to reproduce the issue. I created two branches to compare expected (with cucumber 6 and allure-cucumberjs beta.9) and actual (cucumber 8 and allure-cucumberjs beta.18) behaviors.
Please let me know if I can help you with anything else!
Thank you! Will check it as soon as it possible
I can' reproduce the problem on my local machine. Which environment do you have?

Hi @lamartire! Yes, in master
branch, with older versions of cucumber and allure-js, it works just fine.
If you switch to test/allure_v2.0.0-beta.18
branch (which only has a dependency update to cucumber 8 and allure-js beta 18), you should be able to reproduce the issue.
Please let me know!
Hi @lamartire! Were you able to reproduce the issue in branch test/allure_v2.0.0-beta.18
?
Yes, I've reproduced the issue, still working on that. Will notify you as soon as I get any working result
So, I found the problem. The reporter broke after we had merged commit introducing ability to keep all the running tests for parallel mode in the reporter. Need some time to understand, how I can solve the problem
Glad to know that you were able to find the problem! Let me know if I can help with anything, I'll be looking forward for this!
Hi @epszaw! Are there any news on this?
Hey, @fguidobaldi! It's almost ready. After a long break I returned back to the issue
@fguidobaldi the latest release contains the fix. Please, write updated documentation before use :)
Hi @epszaw! Great news! I'll give it a try as soon as I can, thank you!
Hi @epszaw! I was trying to implement the same structure, with nested steps like these, but I didn't find any reference in docs.

My code looks like this:
await world.step(`Test 1`, async () => {
await world.step(`Request`, (step) => {
step.attach(JSON.stringify(request.data), 'application/json');
});
await world.step(`Response`, (step) => {
step.attach(JSON.stringify(response.data), 'application/json');
});
});
But the steps are created all at the same level, not "Request" and Response inside "Test 1". The fix includes any limitation related to sub-steps? Or am I implementing it the wrong way?