Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Oct 04 14:56
    iomedico-beyer commented #2043
  • Oct 04 14:19
    richarda starred cucumber/cucumber-js
  • Oct 04 12:22
  • Oct 03 20:44
    davidjgoss commented #2140
  • Oct 03 20:33
    davidjgoss commented #2140
  • Oct 02 10:43
    coveralls commented #2136
  • Oct 02 10:40
    davidjgoss synchronize #2136
  • Oct 02 10:40

    davidjgoss on deprecations-before-9

    chore(deps): update dependency … chore(deps): update dependency … chore(deps): pin dependency @ty… and 7 more (compare)

  • Oct 01 17:36

    davidjgoss on main

    fix(deps): update cucumber pack… (compare)

  • Oct 01 17:36

    davidjgoss on cucumber-packages

    (compare)

  • Oct 01 17:36
    davidjgoss closed #2153
  • Oct 01 16:30
    coveralls commented #2153
  • Oct 01 16:27
    renovate[bot] synchronize #2153
  • Oct 01 16:27

    renovate[bot] on cucumber-packages

    fix(deps): update cucumber pack… (compare)

  • Oct 01 16:27

    davidjgoss on main

    chore(deps): update dependency … (compare)

  • Oct 01 16:27

    davidjgoss on microsoft-api-extractor-7.x

    (compare)

  • Oct 01 16:27
    davidjgoss closed #2150
  • Oct 01 16:07
    coveralls commented #2153
  • Oct 01 16:05
    coveralls commented #2150
  • Oct 01 16:03
    renovate[bot] synchronize #2153
Ghouse Mohiddin
@PlaxoGhouse
@SandeepNS12 u have to add the code( what your script/code need perform) in the Step Definition
SandeepNS12
@SandeepNS12
@PlaxoGhouse I have written code.. I'm trying to click same button twice(means after doing some task, it should click on the same button) but itz not working, it is showing the above issue in the terminal
Ghouse Mohiddin
@PlaxoGhouse
@SandeepNS12 Did you place the code in the above step definition?
Ghost
@ghost~5d272f30d73408ce4fc5d0f4

hi,
I’m getting an error 'Unexpected identifier’ with "import printWord from '../support/action/printWord’;” …

Given.js

const { Given } = require('cucumber’);
import printWord from '../support/action/printWord’;
Given(/^I print the (\S+) word$/, printWord);

printWord.js

export default word => {
console.log('============' + word);
};

Can any one help me ???

Gėorges
@gmoussayan

Hello guys, Im new to Cucumber (and automation in general). I have the following online calculator https://www.online-calculator.com/full-screen-calculator/ which uses html5-canvas... I wrote the below code

`package stepDefinitions;

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.interactions.Actions;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait;
import cucumber.api.java.en.Given;
import cucumber.api.java.en.Then;
import cucumber.api.java.en.When;
import org.junit.Assert;

public class subtractionStepDefinition {

WebDriver driver;    

@Given("^user is already on the full screen calculator Page$")
public void user_is_already_on_the_full_screen_calculator_Page() {

    System.setProperty("webdriver.gecko.driver", "//Users//gmoussayan//Documents//Selenium//geckodriver");
    driver = new FirefoxDriver();
    driver.get("https://www.online-calculator.com/full-screen-calculator/");

}

@When("^title of page is Full Screen Calculator - Online Calculator$")
public void title_of_page_is_Full_Screen_Calculator_Online_Calculator() {

    String title = driver.getTitle();
    System.out.println(title);
    Assert.assertEquals("Full Screen Calculator - Online Calculator", title);

}

@Then("^user maximize the browser$")
public void user_maximize_the_browser() {

    driver.manage().window().maximize();

}

@Then("^user clicks on number six$")
public void user_clicks_on_number_six() {

    new WebDriverWait(driver, 10).until(ExpectedConditions.frameToBeAvailableAndSwitchToIt(By.id("fullframe")));
    WebElement canvas = new WebDriverWait(driver, 10).until(ExpectedConditions.elementToBeClickable(By.id("canvas")));

    new Actions(driver).moveToElement(canvas, 20, 50).click().perform(); //6

}

@Then("^user clicks on number three$")
public void user_clicks_on_number_three() {

    new WebDriverWait(driver, 10).until(ExpectedConditions.frameToBeAvailableAndSwitchToIt(By.id("fullframe")));
    WebElement canvas = new WebDriverWait(driver, 10).until(ExpectedConditions.elementToBeClickable(By.id("canvas")));

    new Actions(driver).moveToElement(canvas, 20, 100).click().perform(); //3

}

@Then("^user clicks on the subtraction sign$")
public void user_clicks_on_the_subtraction_sign() {

    new WebDriverWait(driver, 10).until(ExpectedConditions.frameToBeAvailableAndSwitchToIt(By.id("fullframe")));
    WebElement canvas = new WebDriverWait(driver, 10).until(ExpectedConditions.elementToBeClickable(By.id("canvas")));

    new Actions(driver).moveToElement(canvas, 100, 100).click().perform(); // This is the Subtraction operation

}

@Then("^user clicks on the equal sign$")
public void user_clicks_on_the_equal_sign() {

    new WebDriverWait(driver, 10).until(ExpectedConditions.frameToBeAvailableAndSwitchToIt(By.id("fullframe")));
    WebElement canvas = new WebDriverWait(driver, 10).until(ExpectedConditions.elementToBeClickable(By.id("canvas")));

    new Actions(driver).moveToElement(canvas, 150, 200).click().perform(); //This is the equal (=) operation


}

}`

but im receiving the error Caused by: org.openqa.selenium.NoSuchElementException: Unable to locate element: #fullframe

This is happening because im using the below code under (as you see) all Gherkin keywords...

new WebDriverWait(driver, 10).until(ExpectedConditions.frameToBeAvailableAndSwitchToIt(By.id("fullframe"))); WebElement canvas = new WebDriverWait(driver, 10).until(ExpectedConditions.elementToBeClickable(By.id("canvas")));

So im wondering how can i set new WebDriverWait(driver, 10).until(ExpectedConditions.frameToBeAvailableAndSwitchToIt(By.id("fullframe"))); WebElement canvas = new WebDriverWait(driver, 10).until(ExpectedConditions.elementToBeClickable(By.id("canvas"))); to be readable by all Gherkin keywords without having to repeat it under each Gherkin keyword (which resulting on having it failing) - Im using Cucumber, Java and Selenium

any help would be highly appreciated. Thanks a lot :)
Ghost
@ghost~5d272f30d73408ce4fc5d0f4

Given(/^I open the (\S+) page$/, openWebSitenew.open(page));

is this snippest code is correct...

Leo Li
@yuxli066
is it possible to run browser.call async calls in after hooks?
I tried and it won't let me
GitHubernadette
@GitHubernadette
Hello everyone, I can't seem to access the attach property of this in the After hook. I verified that I'm not using arrow function. I don't have any error until my program actually gets to the specific line and print "this.attach is not a function" can someone help me ?
Erol
@FrEaKmAn
what is the best practive to setup setWorldConstructor?
actually where? because if I try to set this with protractor onPrepare, it fails with Cannot set property 'World' of undefined
nabeelkhalaf1121
@nabeelkhalaf1121
and if im using the mocha before all hook because there is no such hook in cucumber can i access the file path of the current test I see i can only access the title ?
Andrey Melnichenko
@AndreyMelnichenko
Hi everyone, can anyone help me to setup CustomWorld in my project here(https://github.com/AndreyMelnichenko/wdio-cucumber)? I can't reload default World object, project stack: WDIO5+Cucumber+TS.
Ghost
@ghost~5d272f30d73408ce4fc5d0f4
is it support cucumber html report with WDIO5 ?
Zhaopeng XUAN
@xuanzhaopeng
Hey team, any idea about cucumber/cucumber-js#1288
SandeepNS12
@SandeepNS12
@PlaxoGhouse yes
Ghost
@ghost~5d272f30d73408ce4fc5d0f4
Hi,
can anyone able to explain how i can implement 'http://mklabs.github.io/mocha-gherkin/‘ this ?
George Aristy
@llorllale
Hi
I'm trying to use cucumber within headless chrome, running my tests with karma.
I get this error while setting my custom world:
  TypeError: Cannot set property 'World' of undefined
      at setWorldConstructor (node_modules/cucumber/dist/cucumber.js:79569:29)
I browse to that line and I don't see where the options is set on _this?
  function SupportCodeLibraryBuilder() {
    var _this = this;

    _classCallCheck(this, SupportCodeLibraryBuilder);

    this.methods = {
      defineParameterType: this.defineParameterType.bind(this),
      After: this.defineTestCaseHook('afterTestCaseHookDefinitions'),
      AfterAll: this.defineTestRunHook('afterTestRunHookDefinitions'),
      Before: this.defineTestCaseHook('beforeTestCaseHookDefinitions'),
      BeforeAll: this.defineTestRunHook('beforeTestRunHookDefinitions'),
      defineStep: this.defineStep.bind(this),
      defineSupportCode: _util.default.deprecate(function (fn) {
        fn(_this.methods);
      }, 'cucumber: defineSupportCode is deprecated. Please require/import the individual methods instead.'),
      setDefaultTimeout: function setDefaultTimeout(milliseconds) {
        _this.options.defaultTimeout = milliseconds;
      },
      setDefinitionFunctionWrapper: function setDefinitionFunctionWrapper(fn) {
        _this.options.definitionFunctionWrapper = fn;
      },
      setWorldConstructor: function setWorldConstructor(fn) {
        _this.options.World = fn;                                                                 // ERROR ON THIS LINE
      }
    };
    this.methods.Given = this.methods.When = this.methods.Then = this.methods.defineStep;
  }
George Aristy
@llorllale
Ok - think I found where this.options is supposed to be set
George Aristy
@llorllale
Has anyone managed to make cucumber work with karma?
pnakhat
@pnakhat
Hi Anyone - Wondering if any one can help with cucumber hooks
I need hooks defined globally once, rather then part of every steps
At the moment it works when its part of step file
After((scenario) => {
const path = './errorShots/'+Date.now()+'.png';
if(scenario.result.status === 'failed'){
browser.takeScreenshot();
console.log('Screenshot location:', path);
}
console.log('Scenario '+ scenario.pickle.name +' '+ scenario.result.status)
browser.deleteCookies()
browser.refresh()
browser.pause(2000)
});
venkatrao-rgare
@venkatrao-rgare
does anyone have an example of cucumber.js version 6 used with selenium webdriver? I tried to look this up on online unfortunately didn't get any examples.
venkatrao-rgare
@venkatrao-rgare

.\node_modules.bin\cucumber-js features\POC.feature --require features*\.js
U

Warnings:

1) Scenario: POC # features\POC.feature:3
? Given The application is launched
Undefined. Implement with the following snippet:

     Given('The application is launched', function () {
       // Write code here that turns the phrase above into concrete actions
       return 'pending';
     });

1 scenario (1 undefined)
1 step (1 undefined)
0m00.000s

I am not sure how to make cucumber read the step definitions
Miguel A. Alonso
@migalons
Hi @venkatrao-rgare . I suggest you try https://webdriver.io. You will find it quite useful, and some interesting starting up guides.
Also supports cucumberjs, and you have there some boilerplate projects: https://webdriver.io/docs/boilerplate.html
Andrew Stewart Gibson
@goofballLogic
I'm sure this is a RTFM thing, but I'm struggling to find a description of how to test ES6 modules with cucumber
Andrew Stewart Gibson
@goofballLogic
I think the problem is that cucumber uses "require" to pull in my step definitions, so I can't then use "import" to pull in the modules?
ricardgarcia
@ricardgarcia
You can use the import, installing the babel dependency worked for me
madlado87
@madlado87
Hello, Any one can help me, i need to know how share information between steps, I watch the documentation (World) it doesn't help (Im new in js)
shantalam
@shantalam

Hi, I am using cucumberjs and trying to run hooks in order, however it always runs in the order functions are mentioned in the file rather than order mentioned.

Before({ tags: '@test2', order:2}, function() {
console.log("Test 2");
});

Before({ tags: '@test0', order:0}, function() {
console.log("Test 0");
});

Before({ tags: '@test1', order:1}, function() {
console.log("Test 1");
});

So output is
Test 2
Test 0
Test 1

But not
Test 0
Test 1
Test 2

Any help please?

vaibhav
@VaibhavBarmkar_twitter
@here Do we have any duplicate step checker for javascript + webdriver IO + cucumber ?
nabeelkhalaf1121
@nabeelkhalaf1121
@here is there is option to repeate like 2 releated steps in scenario etc When type something , Then take snapshot for like 10 times ?
Examples seems to be working for one step or whole scenario
Abhinaba Ghosh
@abhinaba-ghosh
@here I am using protractor-cucumber. Is there a way to re-run all the failed scenarios for a number of time using cucumberOpts?
jpatel2020
@jpatel2020
Hi All, Is there a way to specify multiple formats via the cucumber-js cli? For example --format pretty, json:reports/report.json?
I'm having an issue where the summary report is taking too long to generate is there a way to disable it?
Dmytro
@Dmytro89_gitlab
Hi. Could you tell me please about the cypress-cucumber-html-report. Why do not the Skipped and Pending display tests in the report? The skipped and passed autotests are displayed like Failed
a22183nj
@a22183nj
image.png
Hi, Could anyone let me know why 'TypeError: Cannot set property 'World' of undefined' error would happen?
Thomas G Henry
@ThomasGHenry
@a22183nj fwiw, I was just wondering this myself.
import { setWorldConstructor } from "cucumber";

class CustomWorld {
  constructor() {
    this.cwd = process.cwd();
  }
}

setWorldConstructor(CustomWorld);
TypeError: Arguments to path.resolve must be strings

    at Object.exports.resolve (http://localhost:63862/__cypress/tests?p=cypress/integration/testrail/login/login.feature-179:78415:13)
    at Object.exports.relative (http://localhost:63862/__cypress/tests?p=cypress/integration/testrail/login/login.feature-179:78476:18)
    at getDefinitionLineAndUri (http://localhost:63862/__cypress/tests?p=cypress/integration/testrail/login/login.feature-179:26986:27)
    at buildStepDefinitionConfig (http://localhost:63862/__cypress/tests?p=cypress/integration/testrail/login/login.feature-179:26926:7)
    at SupportCodeLibraryBuilder.defineStep (http://localhost:63862/__cypress/tests?p=cypress/integration/testrail/login/login.feature-179:27112:79)
    at Object.25.../screens.json (http://localhost:63862/__cypress/tests?p=cypress/integration/testrail/login/login.feature-179:1742:20)
    at o (http://localhost:63862/__cypress/tests?p=cypress/integration/testrail/login/login.feature-179:1:265)
    at http://localhost:63862/__cypress/tests?p=cypress/integration/testrail/login/login.feature-179:1:316
    at Suite.<anonymous> (http://localhost:63862/__cypress/tests?p=cypress/integration/testrail/login/login.feature-179:52:1)
    at Object.1./Users/thomasghenry/code/.../cypress/support/step_definitions/cypress/integration/examples/actions.spec.js (http://localhost:63862/__cypress/tests?p=cypress/integration/testrail/login/login.feature-179:29:3)
    at o (http://localhost:63862/__cypress/tests?p=cypress/integration/testrail/login/login.feature-179:1:265)
    at r (http://localhost:63862/__cypress/tests?p=cypress/integration/testrail/login/login.feature-179:1:431)
    at http://localhost:63862/__cypress/tests?p=cypress/integration/testrail/login/login.feature-179:1:460
Thomas G Henry
@ThomasGHenry
oops. got distracted and pasted the wrong thing, but while investigating what I pasted, I ended up seeing what you're seeing also.