Contributions
Re: Cucumber Puppeteer Node JS: error trying to call step function with arguments
Cucumber step definitions take a matcher, (some options - which we'll ignore for now) and a function. This example defines an anonymous function inline with the step definition: When('step matcher', () => { // function to run when the step matches }); It is also possible to use a named function and pass the function to the step definition, e.g.: function stepFunction() { // function to run when the step matches } When('step matcher', stepFunction); You can define steps so that they will extract part of the step text and pass it as an argument to the function that Cucumber executes when it runs, e.g. When('step matches {string}', (theMatchedString) => { // function to run when the step matches }); You can of course extract a named function which takes an argument and pass that to Cucumber: stepFunctionWithArgument(theMatchedString) { // function to run when the step matches } When('step matches {string}', stepFunctionWithArgument); If we look at your example you are calling the confirmSheetCreated functionwhen you are creating the step definition, not when you are executing your Gherkin specification. You probably need to capture the arguments you want to pass to the function in the step matcher, something like: async function confirmSheetCreated(folderName,sheetName) { await this.page.waitFor(1500); let sheetExists=await this.sheetExists(folderName,sheetName) await this.page.isTrue(sheetExists); } // this will match: I confirm in folder: "Revenue" new sheet created: "Test Sheet 1" // and pass the folderName and sheetName parameters at runtime Then( 'I confirm in folder: {string} new sheet created: {string}',{ timeout: 5*1000 }, confirmSheetCreated); Alternatively, if those folder and sheet details are always the same you could push them into the function: async function confirmSheetCreated() { await this.page.waitFor(1500); let sheetExists=await this.sheetExists('Revenue','Test Sheet 1') await this.page.isTrue(sheetExists); } Then( 'I confirm new sheet created',{ timeout: 5*1000 }, confirmSheetCreated);4 years agoPlace Cucumber OpenCucumber Open1.7KViews1like0CommentsRe: How to test multiple conditions in the 'Then' step of a CucumberBDD test?
Cucumber has been designed to fail on first failure - so if a `Then` step fails it will not continue and run the next steps. I think what you are describing is trying to check multiple related things at the same time? You want to see if any or all of the outcomes pass or fail in one place? It might be easier to talk about a concrete example. Would it be possible for you to post a simple example of the Gherkin?4 years agoPlace Cucumber OpenCucumber Open6KViews0likes1CommentRe: After changing Feature file description test executing twice one with new and old description
Is there any chance you duplicated the file to a new path rather than modified the file? Its very hard to offer any concrete advice here without seeing the file structure, code, etc.4 years agoPlace Cucumber OpenCucumber Open982Views0likes0CommentsRe: Choice of Plugin between CucumberStudio and Cucumber for JIRA natively
Hiracchouhan12 I'm sorry about the confusion! Based on what you have said I think the Cucumber for Jira plugin is the right one for you. It will allow you to bring your features and scenarios out of your Git repository into your Jira project. The CucumberStudio - BDD plugin is for connecting CucumberStudio projects to Jira projects, so its only useful if you are a CucumberStudio user. Hope that helps, Steve4 years agoPlace Cucumber for JiraCucumber for Jira2.5KViews2likes1Comment