Questions tagged [cucumberjs]

The Cucumber project is a Behavior Driven Development (BDD) tool originally designed to work with Ruby. However, since its inception its popularity has grown and there have been implementations of Cucumber written for different languages including Java, .Net, Flex, and JavaScript.

Cucumber understands a language named Gherkin which allows features and specs to be written in a plain text format. It is a Business Readable, Domain Specific Language that lets you describe software’s behaviour without detailing how that behaviour is implemented.

Gherkin serves two purposes — documentation and automated tests. The third is a bonus feature — when it yells in red it’s talking to you, telling you what code you should write.

Gherkin’s grammar is defined in the Treetop grammar that is part of the Cucumber codebase. The grammar exists in different flavours for many spoken languages (37 at the time of writing), so that your team can use the keywords in your own language.

848 questions
2
votes
0 answers

How to make API call work with jest-cucumber?

I have a react native application that needs to use jest-cucumber to write test steps using gherkin style syntax. I was able to write sample step definitions and run them successfully. Now, I need to write a test that makes an API GET call. How can…
iDan
  • 25
  • 3
2
votes
0 answers

how do I get cucumber-js to compile typescript files

I'm trying to refactor a Playwright test suite to use cucumber-js on top of it, but I keep getting C:\devl\js\nationwide-ways-to-pay\tests\page\test-support.page.ts:1 import { Locator, Page } from '@playwright/test'; ^^^^^^ SyntaxError: Cannot use…
Matt Westlake
  • 3,499
  • 7
  • 39
  • 80
2
votes
2 answers

Report is not fully displaying while using HTML publisher plugin in Jenkins

I am generating reports using protractor-multiple-cucumber-html-reporter-plugin in my local system and it is perfectly working.But when i am running this protractor script using Jenkins, I am not able to generate same report there using HTML…
2
votes
1 answer

CucumberJs : unable to find step definition file

When I am trying to run cypress it does detect the feature files but fails to get the step definitions file and below is the error I get to see. Sharing below my config: package json file snippet {... "cypress-cucumber-preprocessor": { …
Varun Sukheja
  • 6,170
  • 5
  • 51
  • 93
2
votes
2 answers

Running two user stories in the same Scenario in Cucumber Gherkin

I'm trying to create a scenario where two users would access the application, so I could simulate a sold-out product when one user has it on the cart (more or less). E.g. Given user1 access website Then user1 add a product to the cart Here comes the…
Renato G. Nunes
  • 278
  • 2
  • 4
  • 14
2
votes
0 answers

How can i click on a link in email through Protractor code

I am using protractor-cucmber frame work.I need to test Forgot password scenario. so when i am clicking on forgot password,it will ask for emailid and will get a link in that email.I need to click on that link.For that i have tried with…
Devleena
  • 453
  • 9
  • 25
2
votes
0 answers

Cucumber JS custom formatter

I am trying to learn how to write a simple custom formatter for Cucumber JS. I have read https://github.com/cucumber/cucumber-js/blob/master/docs/custom_formatters.md I tried this sample below. But it is not outputting anything. The documentation…
csalgo70
  • 21
  • 1
  • 4
2
votes
1 answer

How to test array of objects matches a pattern in Karate

I have an array of objects like below. "possibleValues": [ { "unitGroup": "A", "measurementUnitResource": [ { "unit": "1" }, …
Santosh Hegde
  • 3,420
  • 10
  • 35
  • 51
2
votes
2 answers

How do I use Hooks (before / after) with cucumber-js-tsflow?

I'm currently writing a proof of concept automation solution in Typescript using cucumber-js-tsflow, and I'm trying to replicate the Hooks setup that I have previously implemented in other solutions that used specflow. Firstly I thought I would add…
GarethG
  • 23
  • 1
  • 3
2
votes
2 answers

How to skip all remaining scenarios in Cucumberjs

I'm trying to implement some logic to skip the remaining cucumber scenarios if a certain number of tests fail. I'm wondering if there is a method from Cucumberjs that allows you to skip all remaining scenarios in a test run.
Larry
  • 226
  • 1
  • 2
  • 17
2
votes
2 answers

How to use intellij idea debugger with webdriverIO?

I have an issue on wdio test runner. I have set it up in IntelliJ Idea as described here: How to get wdio running through IntelliJ run/debug configurations? But, when I try to debug, nothing happens. The test is not stopping on a breakpoint, it just…
Alex
  • 31
  • 5
2
votes
1 answer

No working example available to demonstrate CucumberJS integration with TestCafe showing RestAPI test scenario, can somebody suggest an approach?

I have been exploring the projects on GitHub which demonstrates the capabilities of integrating TestCafe with CucumberJS, however, I am not able to find any reference to test the RestAPI through this integration and I need it as per my project…
curiousTester
  • 121
  • 1
  • 12
2
votes
1 answer

How to execute command lines TestCafe in a project with Cucumber JS?

I´m using Cucumber Js in a TestCafe project. I want to execute the cucumber feature and use testcafe's record function. In a TestCafe I execute tests with the command line interface "testcafe chrome test.js --video artifacts/videos". When use…
2
votes
1 answer

How to use cucumberSendSlack in Jenkins Pipeline

I want to send my Cucumber reports to Slack using Jenkins Declarative Pipeline. I have installed Cucumber+Slack+Notifier+Plugin. With this code, pipeline { agent any tools { maven 'M2' jdk 'JDK' nodejs 'NODEJS' …
2
votes
1 answer

Mock a Node Js Proxy

I'm working on a Node.js/express application in typescript that includes a proxy route that has some custom business logic to determine the proxy url: import proxy from "http-proxy-middleware"; const controller =…
Philip Pittle
  • 11,821
  • 8
  • 59
  • 123