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
7
votes
3 answers

How to get Scenario name from cucumber js?

In case of error I want to be able to log the scenario name. I'm using cucumber.js and node. Feature file Scenario: As me I can go to google Given that I have a computer When I go to google Then I see wondrous stuff I have tried the code below,…
rozza
  • 927
  • 2
  • 11
  • 24
7
votes
1 answer

cucumber-js: specify path for step-definitions file

I have multiple projects and I would like to implement cucumber-js E2E testing for all of them. I have a step definitions file which can be used for testing all of these projects, however I want to have multiple feature files with each project…
r.w.20
  • 71
  • 1
  • 2
7
votes
1 answer

Getting "is not a thenable" message while using "eventually" in protractor chai

When I tried to verify the condition as below. var val1 = "ONE"; var val2 = "TWO"; expect(val1==val2).to.eventually.equal(false) I'm getting false is not a thenable message, If I removed eventually condition as below then it working fine. var…
KAK
  • 905
  • 4
  • 14
  • 33
7
votes
2 answers

How to debug a CucumberJS script using Visual Studio Code

I am building cucumberjs tests using Visual Studio Code. I am able to run the tests using npm from the command-line, and I am able to run them from within VS Code using a launch configuration. However, I am unable to debug the test from within…
erich z
  • 125
  • 2
  • 7
7
votes
3 answers

What is the difference between Cucumber and Protractor?

So I have written an Angular app and I want to implement end-to-end testing, so I searched the internet for a tool. I found out that Protractor and Cucumber are two popular tools that do that, but I am confused as to what is the difference between…
iams0nus
  • 481
  • 3
  • 8
7
votes
1 answer

World object in cucumber.js or where to put state in cucumber tests

I'm trying to save the current navigation state in one step (the page on a platform with multiple websites) in cucumber.js so the following steps of a scenario can deal with it. I thought using the World object for it, but mysterious things are…
raichu
  • 688
  • 2
  • 8
  • 15
7
votes
7 answers

Setting up Protractor with Microsoft Edge

I use CucumberJs and Gulp to run my e2e tests; However, I need to run them against Microsoft Edge. When I do gulp protractor, it successfully opens up both Chrome and Firefox, since neither of them require any drivers like IEDriver.exe or…
pelican
  • 5,846
  • 9
  • 43
  • 67
7
votes
1 answer

How to use the tags in my function scenario Cucumber.js?

How to use the tags in my function scenario ? How to know the scenario that calls my function ? Actually I have one scenario : Feature: create module feature As a admin I want to use create module @createModule Given I am logged as 'ADMIN' …
Jérémie Chazelle
  • 1,721
  • 4
  • 32
  • 70
7
votes
3 answers

How can I run one particular CucumberJS feature using GruntJS?

I'm using CucumberJS to run tests on my NodeJS web app. At the moment, I can run all of my grunt tasks by executing grunt, or only the CucumberJS tasks, using grunt cucumberjs. But now I want to only execute particular features. For example, say I…
Jonathan
  • 32,202
  • 38
  • 137
  • 208
6
votes
2 answers

Error: Invalid Chai property: toBe. Did you mean "to"?

I am trying to check that an element is present in an angular website. I am using protractor 5.4.0. In the header of the my_steps.js file I have this: global.expect = require('chai').expect var chai = require('chai'); var chaiAsPromised =…
Alfredo Bazo Lopez
  • 323
  • 1
  • 4
  • 12
6
votes
3 answers

why cucumber protractor does not totally ignore the feature file that does not have the tag to run?

I am using a cucumber protractor framework to run feature files. In my config.js, i have: specs: [ "../../features/XXX1.feature", "../../features/XXX2.feature", ... "../../features/XXXn.feature", …
user1559625
  • 2,583
  • 5
  • 37
  • 75
6
votes
1 answer

Cucumber JS timeout won't work

Using the protractor-cucumber-framework, I'm trying to click a button a hundred times in one When-step. However, doing this would result in a timeout with the default 5000ms timeout value. I'd rather not change this default using: var config =…
Jusser
  • 69
  • 2
  • 6
6
votes
3 answers

CucumberJS - Error: Step timed out after 5000 milliseconds at Timer.listOnTimeout (timers.js:92:15)

I'm new to cucumberjs and just trying out my first attempt at running a feature. I've built the feature that is on the cucumber-js github page. I get this error when trying to run it: Benjamins-MBP:Features Ben$ cucumber.js example.feature…
Ben
  • 259
  • 1
  • 3
  • 14
6
votes
2 answers

Resolving promises in Protractor and Cucumber using Chai as Promised

Lately a colleague and I have had some disagreements on the "right" way to implement Cucumber step definitions using Protractor and Chai as Promised. Our contention comes from a mutual lack of understanding of precisely what is going with promise…
Andrew Yochum
  • 95
  • 1
  • 6
6
votes
2 answers

How can I get the step result in AfterStep hook of cucumber.js

As the title says, how can I find the result of a step in the AfterStep hook of cucumber.js?
Dr.Knowitall
  • 10,080
  • 23
  • 82
  • 133
1
2
3
56 57