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

Protractor tests in Angular: how to check variable in scope without ng-bind and ng-model?

how to check variable in scope without ng-bind and ng-model ? Yellow
Jérémie Chazelle
  • 1,721
  • 4
  • 32
  • 70
4
votes
1 answer

JavaScript Modules - SyntaxError: Unexpected reserved word at exports.runInThisContext

Benjamins-MacBook-Pro:Features Ben$ cucumber.js addItem.feature /Users/Ben/WhatWeGrow.Web/public/Features/addItem.step.js:4 import * as a from "grocery-list"; ^^^^^^ SyntaxError: Unexpected reserved word at exports.runInThisContext…
Ben
  • 259
  • 1
  • 3
  • 14
4
votes
4 answers

How can I check if checkbox is checked with Protractor, CucumberJS and Chai?

How can I check if checkbox is checked with Protractor, CucumberJS and Chai ? var el = 'myCheckbox'; this.expect(element(by.model(el)).to.have.prop("checked", true));
Jérémie Chazelle
  • 1,721
  • 4
  • 32
  • 70
4
votes
0 answers

How can I use local storage with Protractor and CucumberJS?

How can I use local storage with Protractor and CucumberJS ? I would like to use local storage not only with Protractor but with Protractor and CucumberJS but I have an error when I execute my feature : Scenario: Authentication ADMIN success …
Jérémie Chazelle
  • 1,721
  • 4
  • 32
  • 70
4
votes
1 answer

How to prevent transitive dev dependency from being shrinkwrapped

I have a package.json with cucumber listed as a devDependency. cucumber has a dependency on cucumber-html. For some reason when I run npm-shrinkwrap on my project, cucumber-html is included in the npm-shrinkwrap.json. Is there any way to prevent…
MorningDew
  • 503
  • 3
  • 9
4
votes
1 answer

Cucumber JS and actually getting something done

After being completely confused and googling tutorial after tutorial, reading books about cucumber that do not cover the JS implementation, I got over the fear of flames and decided to post my question here. I have setup Cucumber-JS on my box,…
MiningSam
  • 583
  • 2
  • 7
  • 22
4
votes
2 answers

Cucumber.js debugging in IntelliJ

IntelliJ has a plugin for Cucumber.js. This suppose to enable running and debugging inside the IDE. The run configuration for cucumber.js works, but the debug mode is deactivated (Debug button can not be clicked). Does anybody else has the same…
futchas
  • 389
  • 2
  • 10
4
votes
2 answers

Check text in a DOM element using Protractor

Here’s what I’m trying to do while testing an Angular app with Protractor. I would like to get a certain element, which is somewhat like this:

{{textFromBoundModel}}

then get its html, and check whether it…
azangru
  • 2,644
  • 5
  • 34
  • 55
4
votes
1 answer

Can't access world methods in AfterFeatures hook

I have an AfterFeatures hook that I'm using to try to gracefully shut down an expressjs web server that is used for testing only. In this hook, I need to call the visit method, which has been added to World, but I apparently don't have access to…
cayblood
  • 1,838
  • 1
  • 24
  • 44
4
votes
1 answer

Making Protractor wait until a UI Boostrap Modal box has disappeared (with cucumberjs)

I've got a page which displays modal box from UI Bootstrap. My protractor test then clicks a button in the modal which closes it, the test then clicks another button on the page. The problem is that there is nothing waiting until the modal actually…
4
votes
1 answer

How to use "And" in a Gherkin using cucumber.js

I am trying to use Cucumber.JS to do my automated testing. If I do the following... var sharedSteps = module.exports = function(){ this.World = require("../support/world.js").World; this.When(/^I click on the cart$/, function(next) { …
Jackie
  • 21,969
  • 32
  • 147
  • 289
4
votes
3 answers

cucumberjs: finding if a step Result is failed

Task: Perform an automated acceptance test using selenium, webdriver, cucumberjs. Find a failing acceptance test scenario and take a screenshot of the page Save that as an artefact in the go pipeline. That was my task for the day. I have done…
Sanjeev
  • 1,838
  • 1
  • 16
  • 28
3
votes
2 answers

Playwright - Cucumberjs - Allure Reports

I'm trying to implement the Allure reports in Playwright with Cucumber. I'm running the features in the next way: npm run test -- --tags "@Something" After an execution I type: npm run allure generate but the browser displays an Allure Report…
nosequeweaponer
  • 511
  • 10
  • 38
3
votes
2 answers

Playwright - How to test that a network request have finished after on click event

I am making BDD test with a Cucumber-Playwright suit. A page I am making a test for has buttons that will trigger a PUT API request and update the page (Note: The button will not link to new address, just trigger and API request). I want to make…
3
votes
2 answers

Cleaning up detox in cucumber run

I'm using detox with cucumber and the setup works great until the last moment of calling AfterAll hooks. In the hook I do the following: AfterAll(async () => { console.log('CLEANING DETOX'); await detox.cleanup(); }); To run cucumber I use the…
mfilimonov
  • 587
  • 4
  • 18