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

browser.get returning before the given URL completely loads using Protractor

I'm using Protractor with Cucumber to write some tests but I'm stuck at some point. In step after login, I'm rerouting to another page using browser.get(url) function provided by protractor. But it always returns before the page is completely…
Hassan Mehmood
  • 1,414
  • 1
  • 14
  • 22
0
votes
1 answer

Chai assertion error if in text are hyphen

There are uncaught assertion error in Chai with Cucumber-js. If in the DocString there are a hyphen - assertion does not work. So if I have scenario DocString, like Then I see message: ''' somewhat1 somewhat2 somewhat3 - somewhat4 ''' I cannot use…
Valentina
  • 584
  • 1
  • 9
  • 25
0
votes
1 answer

Tests run with cucumberjs but not with karma

When I launch my tests with ./node_modules/.bin/cucumberjs tests/features they run ok, but when I launch tests with npm test I get the following error: 20 06 2016 10:40:37.610:INFO [Firefox 44.0.0 (Ubuntu 0.0.0)]: Connected on socket…
Alvaro Maceda
  • 604
  • 1
  • 7
  • 21
0
votes
1 answer

Cucumber JS step definition timeout not working

My step times out always at 15ms even though I have set the limit to be 30ms. Here's the code: this.Then(/^The "(.*)" page is displayed$/, {timeout: 30 * 1000}, async (name) => { let result; switch (name.toLowerCase()) { case…
Kamran Khan
  • 77
  • 1
  • 8
0
votes
1 answer

CucumberJs skipping step definition - maybe callback last parameter in step definition?

I just started working with cucumberJs, gulp and protractor for an angular app and noticed, luckily as all my steps were passing, that if you don't pass in and use that 'callback' parameter in the step definition, cucumberJs might NOT know when this…
pelican
  • 5,846
  • 9
  • 43
  • 67
0
votes
1 answer

How to press an link with zombie.js?

I am using behavior driven development with cucumber-js, and trying to write a test to follow a link, and I have the following code: When I click "Add page" this.When(/^I click "([^"]*)"$/, function(link, callback) { …
Alexandru Olaru
  • 6,842
  • 6
  • 27
  • 53
0
votes
2 answers

How to check broken links with Cucumber.js

I need to check links on page for 404 using Cucumber.js. So I am guessing out on two things. How to implement loop in scenario. Because user should click on links and return back to page multiple times Feature: Check broken links Scenario: User…
romansh
  • 33
  • 5
0
votes
2 answers

Cucumber + Mongoose is giving me Schema hasn't been registered for model

The error message: MissingSchemaError: Schema hasn't been registered for model "User". Use mongoose.model(name, schema) at Mongoose.model (/Users/JimBarrows/Desktop/TaskVelocity/cucubmer/node_modules/mongoose/lib/index.js:349:13) at…
Jim Barrows
  • 3,634
  • 1
  • 25
  • 36
0
votes
2 answers

How to bypass repetitive step execution in cucumber feature files?

In Scenario outlines, if there are 2 or more scenarios, then all the steps of feature will execute for both of the 2 more scenarios. But I need to execute one of the step only once i.e. login step. For Example: Scenario Outline: Acceptance page…
Hemanshu
  • 39
  • 2
0
votes
1 answer

Grunt + Protractor + CucumberJs

I'm trying to use Grunt for my Protractor+Cucumber tests, I was using grunt-protractor-runner plugin, but I realized that it was not running my After steps, therefore my test fails. Which plugin do you recommend? I was trying to use…
Bruno Soko
  • 624
  • 6
  • 20
0
votes
1 answer

Timeout on cucumber-boilerplate

I am trying to run auto testing tool called cucumber-boilerplate. My issue us that I set all what needed but I am getting always Error: timeout of 5000ms exceeded. Ensure the done() callback is being called in this test. the code is simple…
Vitaly Menchikovsky
  • 7,684
  • 17
  • 57
  • 89
0
votes
2 answers

Gherkin - maintaining state between scenarios

Although I have been writing unit tests for 20-odd years, I am new to Gherkin, and haven been given the task of implementing a story for a .feature file that reduces to something like this: Scenario: a Given that the app is open When I open…
Lee Goddard
  • 10,680
  • 4
  • 46
  • 63
0
votes
1 answer

Error when execute cucumberjs with same step definition for different features

// signin.test.js ... this.Then(/^I should be redirected to my dashboard$/, function() { var self = this; return this.browser .getUrl().then(function(eUrl) { eUrl.should.be.equal(self.url); }) .end(); }); ... And this is the…
haotang
  • 5,520
  • 35
  • 46
0
votes
1 answer

Node: Correct way of waiting for a Post request to finish and handle the callback

So I've been trying to implement a Cucumber step that does a POST request to a website, waits for the request to finish ( because following steps rely on post being successful) and break the test if anything went awry: this.Then(/^Post file…
Mantas
  • 3,179
  • 4
  • 20
  • 32
0
votes
1 answer

Assert on bootstrap angular alert when using protractor and cucumberJS

I am using protractor , cucumberJS and chai-as-promised. I have a message (bootstrap alert of angularJS) that appears in DOM when a button is clicked on. It completely disappears from DOM after 6000 ms. I was trying to assert that the expected…