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

How do i use both 'When' and 'And' for the same function without duplicating it

I'm refactoring my script and am currently doing the following; When("I click the button {string}", (buttonID, next) => { pageElement = driver.findElement(By.id(buttonID)); driver.wait(until.elementIsVisible(pageElement), 10000); …
Jack Williams
  • 195
  • 1
  • 1
  • 15
2
votes
3 answers

How setDefinitionFunctionWrapper() works in Cucumber JS?

I couldn't be able to find any good explanation of how the method works exactly and how it could be useable. In the documentation I found the description: setDefinitionFunctionWrapper(fn, options) Set a function used to wrap step / hook…
mathsicist
  • 181
  • 4
  • 15
2
votes
0 answers

Unable to create session from org.openqa.selenium.remote.NewSessionPayload, with phantomjs and nightwatch.js

I am trying to execute my test over Phantom JS in nightwatchjs I am using Selenium server with nightwatchjs and cucumber I took the following link as a reference- https://github.com/nightwatchjs/nightwatch/wiki/Running-tests-in-PhantomJS There are…
Prateik
  • 545
  • 1
  • 5
  • 12
2
votes
1 answer

Use the same examples for multiple Cucumber js scenarios

I'm finding it difficult to use multiple Scenario Outlines to use the same example and run in a sequence. My use case is for a feature to test like this: Scenario Outline: Time consuming login process When I enter login credentials for
2
votes
1 answer

Generic step definitions in Cucumber

I was wondering if it would be possible to write generic step_definitions in cucumber, that can be used for a Given, When or Then scenario when needed. For example: Given the browser is started When I navigate to my webpage Then the element with id…
Bart
  • 101
  • 1
  • 5
2
votes
1 answer

Protractor- cucumber javascript- pass variable values between steps

Following are my steps: Then(/^I clear default folder name$/, function () { var d = new Date(); var n = d.getTime(); // var folderName= "Drawings"+Math.random()+'\n'; var folderName=…
Saagar
  • 794
  • 3
  • 20
  • 41
2
votes
2 answers

Cucumber.js, Protractor, Javascript example with Scenario Outlines

I am learning how to cucumber.js, protractor, bdd etc. I can't find out how to use 'Scenario Outlines' in cucumber.js and protractor I have the following in my .feature file Scenario Outline : Invalid Login When I enter invalid And…
user9033344
  • 21
  • 1
  • 3
2
votes
0 answers

React how to keep track of the last element rendered on a web page

I am using cucumberjs selenium webdriver to take screenshot of web app that's developed with React. My question would be: Given a nested list like below:
  • child 1
  • child 2
  • child 3
  • child 4
WABBIT0111
  • 2,233
  • 2
  • 18
  • 30
2
votes
2 answers

Protractor tests are passing but didn't execute the tests

I am new to java script protractor cucumber framework. I can see similar issue raised here an year ago but this was fixed in a protractor release an year ago as well. hence raising a new question. I am using latest version of cucumber, protractor,…
Navin
  • 273
  • 3
  • 15
2
votes
3 answers

How to use Puppeteer and Headless Chrome with Cucumber-js

I am trying to do BDD with cucumber-js and drive the browser testing with Headless Chrome and puppeteer. Using the documentation from cucumber node example and headless chrome, I get the following errors, the entire code base is avaliable here:…
2
votes
1 answer

using protractor-cucumber-framework for testing it gives this error

Hello friends i testing my angular 2 app using protractor and cucumber js but it give me this error i try several solution for this issue but no one can solve my issue.if you know any sol it would be great thank u.. [1] Unhandled rejection…
2
votes
4 answers

Angular4 + Protractor + Cucumber + TypeScript + weback-dev-server - Angular not found

OS: macOS Sierra 10.12.4 Node: v7.9.0 Npm: 5.0.3 Cucumber-js: 2.3.0 Protractor: 4.0.14 TypeScript: 2.2.2 webpack-dev-server: 2.4.5 i have a problem with running e2e tests. When I try to get an element from the page: const el =…
Jakub Saleniuk
  • 405
  • 5
  • 15
2
votes
2 answers

Cucumberjs regex

So I have this feature in cucumberjs Scenario: Upload a valid pcf file into gpe Given that the user uploads a valid pcf file Then the user should see an upload success indicator Scenario: Upload an invalid pcf file …
Karias Bolster
  • 955
  • 3
  • 17
  • 31
2
votes
1 answer

CucumberJS 2.0.0 How to get the Scenario Name from the Before Scenario Hook

The Problem I have been using the output from the Before hook to name my screenshot files so that we have the name of the Feature and Scenario that the screenshot came from. The output that I was getting in 1.3.0 allowed me to do a…
KyleFairns
  • 2,947
  • 1
  • 15
  • 35
2
votes
0 answers

Error message [null] or [null,null,null,null] when using browser.actions protractor

When runnning code like: element(by.css('input')).sendKeys(arg1).then(function() { browser.actions().sendKeys(protractor.Key.ENTER).perform().then(callback); }); Or anything using browser.actions() I'm getting an error message like: 1)…