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
1 answer

Xolvio/meteor-cucumber: returning result of this.server.call

I am using the package Xolvio/meteor-cucumber and I'm trying to call a fixture method and use its returned value in a step definition: Step: And I fill in the sms code "#smsCodeVerification" Step definition: this.Then(/^I fill in the sms code…
Gravity123
  • 1,130
  • 3
  • 21
  • 39
0
votes
0 answers

Unable to delete mongoose collection within Cucumber-JS Step

I'm using Cucumber-JS to write some BDD features and Mongoose to reset a database for each scenario. I'm setting up a background task, generating the step for it and changing the callback.pending() to callback() which passes. Feature: x …
chris31389
  • 8,414
  • 7
  • 55
  • 66
0
votes
1 answer

How do i check a count value in chai-as-promised?

I use cucumber and chai-as-promised as assertion library. What is the right way to check the count value. I use equal but it works only after converting string to integer.Is there a way to assert a integer value directly? this.Then(/^the list should…
meteor
  • 2,518
  • 4
  • 38
  • 52
0
votes
1 answer

Protractor-Cucumber: how to wait in hooks (After)

I'm not sure this will solve my issue but it seems the most likely. The code right now, in the after hook, redirects to a non-angular page from an angular page via browser.get. The redirection does happen, unfortunately before moving on to the next…
Kotnat
  • 3
  • 4
0
votes
1 answer

How to call afterScenario with a global variable in cucumber hooks

I have an after scenario as : var afterScenario = function(campaignName, that){ console.log('in after scenario'); that.After("@cleanup", function(callback){ console.log('-------IN AFTER SCENARIO--------'); }; I am calling this from…
Anuj Verma
  • 21
  • 3
0
votes
1 answer

To Send Variable in Callback vs. Not to Expose Object properties

I've got 2 different ways to code the World function. The first is an example from Cucumber.js's website. This is extending their existing World object basically. And the second example commented out is me taking that first example code and…
PositiveGuy
  • 17,621
  • 26
  • 79
  • 138
0
votes
1 answer

How to do file upload in cucumber-js

I want to write a script that fills out a form and uploads a file in cucumber-js,selenium,and protractor. whenever I click an upload file button though, there is no xpath/id/etc... to click on. How do you handle file uploads?
William Roberts
  • 319
  • 2
  • 5
  • 21
0
votes
1 answer

Allocate more memory cucumber-js

How do you allocate more memory when running cucumber-js tests from the command line? Is there a specific tag or would you do it in your step-def files?
William Roberts
  • 319
  • 2
  • 5
  • 21
0
votes
0 answers

cucumber click dialog remove

Checking if attribute was excluded, confirm dialog, using rails 4 Quando(/^confirmo$/) do page.execute_script 'window.confirm = function () { return true }' end return error > Capybara::Driver::Base#execute_script…
0
votes
1 answer

Webdriverjs - find length of content within div in test

I am using Protractor wrapped around webdriverjs and I have this function finding the element I search for: ptor.findElement(protractor.By.css('.rightPanel')).then( function(el) { if(el.length > 0){ …
Jenninha
  • 1,357
  • 2
  • 20
  • 42
0
votes
1 answer

Protractor / Cucumber / RequireJs No element found using locator error

I have an AngularJs application that uses requireJs and hence it uses the deferred method of bootstrapping the application. I am trying to test this using a combination of Protractor and its built in cucumber support. I can run the cucumber tests…
alfonsob
  • 635
  • 1
  • 6
  • 16
0
votes
2 answers

Issue with callbacks in Cucumber.js scenario with ZombieJS

I've got some experience with BDD tools like Cucumber and Lettuce. I'm currently building a Phonegap app, and I'd like to start using Cucumber.js to create acceptance tests for it. Unfortunately I'm having a bit of an issue. Here is the basic…
Matthew Daly
  • 9,212
  • 2
  • 42
  • 83
0
votes
1 answer

After Hook to close window but doesn't re-open for next scenario

I am writing some cucumber tests using webdriverJS. I am trying to use an after hook to close the browser window after each scenario. The problem is, the window will close but not re-open. The error I get is that it cannot "find" a window. Any help…
0
votes
3 answers

SetTimeout and recursivity with cucumber

I have a function written in javascript calling itself in a recursive way : function f(attempt){ if (attempt + 1 <= 10) { setTimeout(f(attempt + 1),2000); } } f(0); For an unknown reason the function is effectively called 10 times…
sam
  • 3,441
  • 2
  • 33
  • 42
0
votes
1 answer

Cucumber JS child_process in feature step

I am trying to write some CucumberJS features, which will test a NodeJS command line application I am creating, however I am running into problems being able to execute a child_process within a feature step. Simply to get a proof of concept working…