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

Protractor takes too long to click on an element

I have the following part of the web page that I want to click using Protractor+Cucumber:
2
votes
1 answer

Cucumber.js: Give Scenarios a second try

Even though I am aware of the fact that tests should run reliably, my experience tells me: that cannot always be accomplished with reasonable effort (and need not be accomplished; see my calculation below). Particularly, if tests are introduced for…
ideaboxer
  • 3,863
  • 8
  • 43
  • 62
2
votes
2 answers

:: Ionic2/Angular2: CucumberJs + Protractor + TypeScript Configuration

I'm not really savvy in TypeScript and Angular2 and I've been trying to run the cucumber's features using steps that have been written in TypeScript. However, on executing the steps.ts files, I'm getting the following error: [launcher] Running 1…
2
votes
0 answers

How to write reusable methods in cucumber + Protractor

/* jshint -W117 */ 'use strict'; var Support = require('./_support'); var $ = new Support(); var LoginPage = require('./login.page'); /** * Collection of basic steps definitions reusable across features */ var basicSteps = function (page) { …
Sneha Shejwal
  • 311
  • 3
  • 6
2
votes
0 answers

cucumber-js not working with node command

On my windows machine, on a cucumber.js project I get: > success on 'cucumber-js' success on > 'C:\Users\\AppData\Roaming\npm\cucumber-js' success on > 'C:\Users\\AppData\Roaming\npm\cucumber-js.cmd' Error on : >…
Mayank
  • 981
  • 7
  • 9
2
votes
0 answers

Cucumber-js TypeError: e.scrollIntoView is not a function

I got the same exception on trying to setup cucumber-js https://github.com/cucumber/cucumber-js Feature: Example feature As a user of Cucumber.js I want to have documentation on Cucumber So that I can concentrate on building awesome…
Mayank
  • 981
  • 7
  • 9
2
votes
1 answer

Can't run cucumber tests with protractor

Every time when I am running tests, I got the error: TypeError: e.getContext is not a function I am using examples from https://github.com/cucumber/cucumber-js with some changes in world.js (made them to fix timeout errors) Versions of apps: node…
svfat
  • 3,273
  • 1
  • 15
  • 34
2
votes
2 answers

Specifying step definition path in Webstorm

I am currently using Protractor and Cucumber.js to run automation tests on an Angular app. I use Webstorm and two plugins, Cucumber.js and Gherkin. The problem I am having is when trying to specify a unique location for the step definitions…
Otto
  • 33
  • 1
  • 6
2
votes
1 answer

How to click element using Cucumber without using xpath?

My application requires to test favorite feature for any product.Products List & UI When a user click on the heart icon shown in the snippet, it will add that product into Favorites list. I would like to know about the Capybara/Cucumber method to…
2
votes
0 answers

Protractor Session ID issues with this driver does not have a valid session ID and may no longer be used

I am new at using Protractor and just started using it a month or so ago. I am using Protractor 2.5.1 and cucumber NOT Jasmine; I have been running into session ID issues with my tests lately. Sometimes my tests pass and sometimes they fail with…
2
votes
0 answers

Verify url is followed in Cucumber.js

I'm using meteor-cucumber meteor-cucumber in my Meteor project, which in turn uses cucumber.js. I want the test to navigate to a url, but I am expecting an error if it is invalid. In this case, the valid url is /articles this.When(/^I navigate to…
port5432
  • 5,889
  • 10
  • 60
  • 97
2
votes
1 answer

Resolving multiple promises using Protractor, Cucumber, Chai as Promised

I'm in the need to assert the number of the children .row of a series of divs .container is greater than 0. this.Then(/^I should see at least one element in each container$/, function (done) { page.element.all(by.css('.container')) …
Mr Peach
  • 1,364
  • 1
  • 12
  • 20
2
votes
1 answer

Protractor & Cucumber. this.visit is not a function

I'm trying to experiment with protractor and cucumber to add some functional BDD testing to some of our webapps. Piecing together the scraps of information online related to this process, I've managed to piece together a very basic test but when I…
Fraser
  • 14,036
  • 22
  • 73
  • 118
2
votes
0 answers

Cucumber.JS, keeping Background DRY by calling previous defined step scenario aka calling Steps in a step

I want to be able to run a Background before calling my scenario that runs steps in a previous scenario. For example, I have a scenario that creates a user and call it "Create A User". I want to create a new scenario called "Reset password" that…
2
votes
2 answers

webdriverio Set getText string to variable

I'm currently trying to instantiate a variable with the contents of the getText method using webdriverio. a = String(browser.getText('.field_notice')); When I attempt to print the variable this is the output: [object Object] Thanks for the…
Dimi
  • 193
  • 1
  • 3
  • 13