Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
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.
Thomas G Henry
@ThomasGHenry
Uncaught TypeError: Cannot set property 'World' of undefined
    at setWorldConstructor (http://localhost:64786/__cypress/tests?p=cypress/integration/testrail/login/login.feature-742:27066:28)
    at Object.<anonymous> (http://localhost:64786/__cypress/tests?p=cypress/integration/testrail/login/login.feature-742:1732:35)
    at Object.25./Users/thomasghenry/code/duke/tams/tams-react/node_modules/@cypress/browserify-preprocessor/node_modules/@babel/runtime/helpers/classCallCheck (http://localhost:64786/__cypress/tests?p=cypress/integration/testrail/login/login.feature-742:1761:4)
    at o (http://localhost:64786/__cypress/tests?p=cypress/integration/testrail/login/login.feature-742:1:265)
    at http://localhost:64786/__cypress/tests?p=cypress/integration/testrail/login/login.feature-742:1:316
    at Suite.<anonymous> (http://localhost:64786/__cypress/tests?p=cypress/integration/testrail/login/login.feature-742:52:1)
    at Object.1./Users/thomasghenry/code/duke/tams/tams-react/cypress/support/step_definitions/cypress/integration/examples/actions.spec.js (http://localhost:64786/__cypress/tests?p=cypress/integration/testrail/login/login.feature-742:29:3)
    at o (http://localhost:64786/__cypress/tests?p=cypress/integration/testrail/login/login.feature-742:1:265)
    at r (http://localhost:64786/__cypress/tests?p=cypress/integration/testrail/login/login.feature-742:1:431)
    at http://localhost:64786/__cypress/tests?p=cypress/integration/testrail/login/login.feature-742:1:460
Thomas G Henry
@ThomasGHenry
@a22183nj are you using picklejs?
a22183nj
@a22183nj
@ThomasGHenry no, just cucumberjs
Abhinaba Ghosh
@abhinaba-ghosh

Hey @channel, I know running a single cucumber scenario gives you so much trouble in VSCode- you need to tag a scenario specifically and then call that tag explicitly from CLI. Very troublesome, right?
What if, you could just right-click a scenario and execute that? What if you just run a whole feature file just by clicking a button? Sounds good, right.

I have published a beta version of that dream just now. I hope you will play with it and help me enhance it by finding bugs.

Here it is: https://marketplace.visualstudio.com/items?itemName=AbhinabaGhosh.cucumberquick

venkatrao-rgare
@venkatrao-rgare
does anyone have cucumber.js report report working when the test fails.
I am using the test script as follows in package json
"test" : "node_modules/.bin/cucumber-js --world-parameters "{\"POB\": \"1\", \"ENV\": \"UAT\"}" features/Smoke.feature --require features/*/.js --require-module @babel/register --require-module @babel/polyfill -f json:out.json -f progress --tags @test--unhandled-rejections=strict && node index.js"
It generate the report when test passes but it doesn't generate the report when the test fails.
node index.js at the end of the script since I am following this, https://www.npmjs.com/package/cucumber-html-reporter. I want to try calling node index.js from afterall but I don't know how to do that yet
Can someone help me here please?
Per-Bjørnar Iversen
@perbi1977
hi. anyone knows how to automatically generate step definitions from feature files? I know how to do it in intellij / mvn, but not javascript / vs code
Daniel Montesinos
@damonpam
Should work in IntelliJ... for vscode I think you need a plugin @perbi1977
Per-Bjørnar Iversen
@perbi1977
@damonpam thanks. I kind of fixed it. it working, but vs code does not recognize the definition when i hover over gherkin syntax
Daniel Montesinos
@damonpam
@perbi1977 did you configure the plugin?
venkatrao-rgare
@venkatrao-rgare
@venkatrao-rgare I used the following to get over this problem,
"test": "test script || node index.js"
this works even when the test is failing
Avik Hazra
@avikhazra
how to create setWorldConstructor for the class in typescript?
@ThomasGHenry @ThomasGHenry how to create setWorldConstructor for class ? in tpyescript?
Avik Hazra
@avikhazra
sorry above this solved
thank you
Sumit Saxena
@sumsax
Iam using multcapabilities to run cucumber test in parellel but still it running it in sequential manner
Sumit Saxena
@sumsax
@abhinaba-ghosh HI Abhinaba , Iam trying to execute multiple test scenario in parellel , tried with multi capabilities multiCapabilities: [{
"browserName": prop.get('browserName'),
'shardTestFiles': true,
'maxInstances': 2
}],
but still it execute sequentially , anything Iam missing
Abhinaba Ghosh
@abhinaba-ghosh
Hi, currently protractor supports parallel feature files execution, not scenario. If you want to try that out, you can checkout this starter kit : https://github.com/abhinaba-ghosh/protractor-cucumber-serenity-typescript-starter
Olga
@osmolyar

Hello everyone, I hope this is the right place to ask this question. I'm running @wdio/cucumber-framework, but maybe those of you familiar with cucumber-js will be able to see the problem. I've defined and set a custom World constructor, and it is being re-constructed with each scenario as expected, as I can see by a console.log("Constructing world") inside the custom constructor function. However: Each scenario is able to somehow modify the subsequently constructed object rather than having it re-constructed with defaults as specified, and the modifications don't get overwritten for the new scenario. world.js looks like this:

const options = {loginBusinessOptions: {
    login: "abc",
    password: "xyz"
    }};

function CustomWorld() {
    console.log("Constructing world");
    console.log("options.loginBusinessOptions is " + JSON.stringify(options.loginBusinessOptions));
    this.nav = {};
    // this.context=options;
    this.context=Object.assign(options);

}
export default CustomWorld

Observe output of running a scenario twice, where the first scenario sets "this.context.loginBusinessOptions.login='new login' instead of its original value 'abc' as set in the 'options' object above, showing that the 'options' object has been overwritten by the 1st scenario's setting of this.context.loginBusinessOptions.login.

This happens whether the custom constructor simply sets 'this.context=options' or does an Object.assign to prevent the two objects being treated as the same object.

[0-0] Constructing world
[0-0] options.loginBusinessOptions is {"login":"abc","password":"xyz"}
[0-0] ***this.context.loginBusinessOptions is {"login":"abc","password":"xyz"}
Constructing world
options.loginBusinessOptions is {"login":"new login","password":"xyz"}
***this.context.loginBusinessOptions is {"login":"new login","password":"xyz"}

There is a reproducible example of this here: https://github.com/osmolyar/wdio_cucumber_world_not_reinitialized . or - if this does not happen with cucumber-js, it can be narrowed down to a @wdio/cucumber-framework issue. Thanks in advance for any guidance.

viktor-silakov
@viktor-silakov
How can I use data transformation for "docstring"?
I make this:
image.png
but this only works for usual parameters, not for docstring
Kirill Eremin
@StaroKep
Hello! Help me please. Maybe you have so problem?
After launching tests we have blank chrome window and error: this is not defined for functions inside Given, Then, etc...
It's strange because all my teammates don't have so problem.
The version of nodejs is 12.13.0 and OS is MacOS Catalina
motha02
@motha02
Hi ,
Does cucumber with typescript support @and decorator?
manoj0516
@manoj0516
chromedriver 83 has been released so if we are not able to get it through package.json then delete entry of chromedriver from package.json and do force download through following command npm install chromedriver --chromedriver-force-download
Dmytro
@Dmytro89_gitlab
@StaroKep Hi, Can it be reproduced on other OS? For example, Windows
Kirill Eremin
@StaroKep
@Dmytro89_gitlab It's strange, but after xcode updating, all works fine
Ghost
@ghost~5714c5cb187bb6f0eadffbf0
Hello! What is the best solution(framework) for API testing with Cucumber-js? Thanks!
Abdul Aziz
@abdulazizkarim11
hello