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

How to use @ (at) symbol in package.json in the scripts section (my case: run cucumber-js for tagged features)

we specify different scripts in the scripts section of a package.json file. I would like to run cucumber-js via the scripts and specify tags to execute only a certain set of tests. This command runs fine in the command line: npx cucumber-js --tags…
CPR
  • 33
  • 2
3
votes
0 answers

How to handle depended scenarios in cucumber 4 parallel execution with TestNG

As per cucumber 4 with TestNG: When using TestNG in parallel mode, scenarios can be executed in separate threads irrespective of which feature file it belongs too. Different rows in a scenario outline can be also executed in separate threads. The…
Shubham Jain
  • 16,610
  • 15
  • 78
  • 125
3
votes
1 answer

Get index of the specific td in tr by XPath

I have thead and tbody in the table. Thead contains a few s in . Each of it have an id. I need to find the index of td in thead by id and then find by index in tbody.
3
votes
1 answer

CucumberJS Console Output Given,When,Then Test Steps during run time

Using protractor-cucumber-framework How do I modify the console output of the CucumberJs that will output the steps during run time. Example Scenario in Feature: Given that Home Page is Displayed When I Click Sales Button at Home Page Then Sales…
Ry-ry
  • 210
  • 1
  • 4
  • 15
3
votes
1 answer

How can I bypass the mixed content error (http/https)

I am getting the below error when I was trying to approve a document in a webpage Mixed Content: The page at \'https://example.com\' was loaded over HTTPS, but requested an insecure resource \'http://insecure-page.com:9870/xyz\'. This request has…
RRR
  • 75
  • 2
  • 11
3
votes
2 answers

cucumber-js parse error when run on Jenkins

I am trying to setup a jenkins pipeline step to runs some test scenarios using cucumber-js but I am getting an error back from the build as follows: Error: Parse error in 'e2e/definitions/login.js': (1:1): expected: #EOF, #Language, #TagLine,…
mindparse
  • 6,115
  • 27
  • 90
  • 191
3
votes
1 answer

How to ignore stepdefinition variable declaration in cucumber for same value

How to ignore stepdefination variable declaration in cucmber for same value? So suppose I have example as below: Scenario Outline: Looking up the definition of fruits Given the user is on the Wikionary home page When the user looks up…
Shubham Jain
  • 16,610
  • 15
  • 78
  • 125
3
votes
0 answers

Parse error in 'test/step_definitions/requester.js': (1:1): expected: #EOF, #Language, #TagLine, #FeatureLine, #Comment, #Empty

I am developing an API automated test case using cucumber and JavaScript and I am getting this error: Error: Parse error in 'test/step_definitions/requester.js': (1:1): expected: #EOF, #Language, #TagLine, #FeatureLine, #Comment, #Empty, got…
Alfredo Bazo Lopez
  • 323
  • 1
  • 4
  • 12
3
votes
2 answers

Invoke cucumber cli programatically through index.js of node

I have been given an automation framework in CucumberJS and node with selenium. But it has an older version of cucumber which relies on promises. In an attempt to avail latest synchronous step feature, I decided to upgrade the cucumberJS version…
Prateik
  • 545
  • 1
  • 5
  • 12
3
votes
3 answers

trying to run cucumber but getting this error

I am trying to run some cucumber tests with javascript but I keep getting this error. Do i need to change my execute path if yes, how can i do it? I have tried to install cucumber locally and globally but it does not seem to get resolved …
J Don
  • 65
  • 1
  • 2
  • 6
3
votes
1 answer

Webpack dev server: Hook or mechanism for trigger command once that the server is running

In my development workflow I open 2 terminal windows for running in one my npm start task, once that the server is running at the second window I run a cucumberjs's functional test suite and this worked as i expected. But my problem is that in my CI…
3
votes
2 answers

Execute only one feature file in protractor by the use of a tag

I am trying to run just one feature file in protractor. I know that I can declare that file in protractor.conf.js, but I have also seen a solution by use of a tag: In a feature file one would insert a tag at the beginning of the file like…
Tobias Gassmann
  • 11,399
  • 15
  • 58
  • 92
3
votes
1 answer

Toggling multiCapabilites config based on cucumber tag

I was wondering if any one had found a way to toggle between different multiCapabilities configurations coming from a cucumber.conf.js file. Currently I have this one config that will run parallel chrome drivers to run tests. multiCapabilities: [{ …
Tree55Topz
  • 1,102
  • 4
  • 20
  • 51
3
votes
2 answers

Cucumberjs Data Tables - How to turn it to .raw()

So I have implemented a Cucumberjs data table, however I do not think I have done it right.. Here what I have this.And(/^If I click the row "([^"]*)" then I should the following nested information$/, function (rowName, data) { …
Tree55Topz
  • 1,102
  • 4
  • 20
  • 51
3
votes
2 answers

Verifying amount of elements using expect

So I have an element identified var errorAlert = element.all('[id*="type-alert"]'); I am trying to create a function that will verify there are 2 alerts displayed.. this.isAlertsDisplayed = function() { return…
Tree55Topz
  • 1,102
  • 4
  • 20
  • 51