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

How to generate json output through cucumberjs

I am quite new to cucumberjs and javascript, trying to generate a json output. Have created a hook: have the following in my JsonOutputHook.js module.exports = function JsonOutputHook() { try { var Cucumber = require('cucumber'); …
Sim_8
  • 56
  • 4
0
votes
1 answer

Cucumber - Javascript Invoke Login Step Definitions Before Other Step Definitions

Using Chimp.js, Cucumberjs and WebdriverIO, I'm trying to run login step definitions in a browser instance, before other step definitions that depend on a user to be logged in. And possibly without adding them into the Background over and over again…
Nigel Earle
  • 775
  • 2
  • 7
  • 19
0
votes
1 answer

Cucumber JS not running step but saying its passed then skipping subsequent steps

I have a step which looks like so: this.When(/^I send a (get|put|post|delete) request to (.*) with payload$/, function(requestType, route, callback) {...}); I have stuff which uses it like so: And I send a post request to users/password/change with…
Grofit
  • 17,693
  • 24
  • 96
  • 176
0
votes
1 answer

Chimp.js configuration

I am using Chimp.js(with Cucumber.js) and all the tests need to pass a login page. I know webdriverIO uses testrunner config file for something like .before() and .after(). How would be the best way to achieve that with Chimp? Thanks!
Sotir
  • 13
  • 2
0
votes
2 answers

Cannot run cucumber from CLI

I managed to run cucumber from CLI with node ./node_modules/cucumber/bin/cucumber but I wasn't able to run it simply with cucumber Windows tried to run it as executable, so it opened some window about missing file association. Is there a way to…
inf3rno
  • 24,976
  • 11
  • 115
  • 197
0
votes
2 answers

Regular expression for gherkin syntax cucumber

I want to write a regular expression for input box validation with respect to Gherkin syntax.The valid example inputs are like this Ex: Given I enter "www.google.com" And enter keyword "new york" When I click on "Images" Then I can see "image…
ronypatil
  • 153
  • 2
  • 3
  • 19
0
votes
1 answer

Using cucumber-mink with meteor-velocity

I have velocity installed and running on a meteor project. I came across cucumber-mink, and I am struggling to get my scenarios to work with steps defined in cucumber-mink. I added cucumber-mink to to cucumber dependencies { "name":…
A.Hidri
  • 41
  • 1
  • 5
0
votes
1 answer

Gulp: Wait for express server to start before running tests

I'm pretty new to node. I built a sample express app and wrote some BDD tests for it using cucumber.js. I would like to automate the tests using gulp so that when I run my tests it will first start the express app and, once the server is up, run…
joniba
  • 3,339
  • 4
  • 35
  • 49
0
votes
1 answer

Cannot add new Given/When/Then, getting error `SyntaxError: Invalid regular expression: missing /`

I had configured cucumber + protractor, and I firstly was splitting stepDefinitions into different files like this: When I created new features files, and started running, cucumber/protractor did not recognized these new steps I was adding to the…
Bruno Soko
  • 624
  • 6
  • 20
0
votes
2 answers

How to reuse a cucumber feature

I have a cucumber feature called "A" located at "C:\cucumber tests" Now I want to create another cucumber feature call "B". The first part of the steps of feature "B" will be exactly the same as in feature "A". I don't want simply to copy all the…
Bluesea
  • 135
  • 1
  • 1
  • 9
0
votes
0 answers

How to run cucumber and jasmine tests sequentually

I need to have (I have to, it's not my decision and I cannot alter it) test-sets in both jasmine and cucumber. So I've made two folders with specs and two conf.js files, one for each framework. When I need to run both jasmine and cucumber tests, I…
Alissa
  • 686
  • 1
  • 8
  • 21
0
votes
2 answers

How to embed screenshot in Cucumberjs using Protractor?

I tried with the below code to take screenshot and save it locally. But, I want to embed the screenshot to the cucumber HTML report (which is generated by Jenkins using json file). What would be the code I should add here for embedding which should…
Yakshith KJ
  • 1
  • 1
  • 4
0
votes
1 answer

How to connect to MySQL using Node-mysql in a Cucumber-JS step definition?

I am trying to connect to a MySQL database in my Cucumber-JS stepDefinition file, using node-mysql, via a connection method defined in world.js. Unfortunately it will not connect and return my query results, nor can I get it to show me an error…
jupiter22
  • 167
  • 1
  • 1
  • 11
0
votes
2 answers

With Protractor, how can I select a DOM Object within a list based on text?

I'm trying to select a product from my product list based on its title. What I want to do is say "If an item from the list has a title that matches "Chicken Breast (200g)" then click the button. Does anyone know how to write this in protractor? I'm…
chris31389
  • 8,414
  • 7
  • 55
  • 66
0
votes
1 answer

Xolvio/meteor-cucumber: get this.userId when logged in

when using xxx shouldnt my fixture methods be aware of this.userId if I am logged in? 'userId': function () { console.log("#################"); console.log("################# USERID: ", this.userId); …
Gravity123
  • 1,130
  • 3
  • 21
  • 39