Closed OhadR closed 4 years ago
Hi OhadR, the step specific timeout can actually be set now, for when/then/given, but not for the before/after hookd.
@given(/^some step to be executed$/, undefined, 1000)
public someGiven(){
}
here, we set the timeout to be 1000ms.
note the undefined
before the timeout argument; it is for tag.
can you verify this works for u? if not i have have further check.
Added support for timeout in before/after hooks now.
superb! thanks @wudong
tried to check it now. working perfectly.
I would add it also to the docs :-)
How can I add a 'timeout' to the 'before/after hooks'?
Can you give me an example, the documentation does not provide one. Thank you.
Do I need a specific version ?
I have set a default timeout until I have a more elegant solution. Just in case it helps:
// test-setup.js
require('ts-node').register({
transpileOnly : true ,
compilerOptions : {
"module" : "commonjs" ,
"resolveJsonModule" : true ,
},
});
require('@cucumber/cucumber').setDefaultTimeout(30 * 1000);
// cucumber.js
let common = [
'--require tests.setup.js', // Config ts-node
'features/**/*.feature', // Specify our feature files
'--require-module ts-node/register', // Load TypeScript module
'--require step-definitions/**/*.ts', // Load step definitions
'--format progress-bar', // Load custom formatter
].join(' ');
module.exports = {
siglo: common
};
Hi,
maybe I miss something, but does this (great) package supports timeouts in a step level? I use the code below to set the "global" timeout, i.e. for ALL steps:
So far so good, but now I have a single step which take a lot of time so I want to allow specifically only this step to run 5 minutes without getting timeout error.
How can I achieve that?
currently I see no choice but to use "plain" cucumber again:
is there a more elegant way, using tsflow?
(related to #29 )