New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rerun feature troubles #499

Closed
fdubost opened this Issue Jan 19, 2016 · 13 comments

Comments

Projects
None yet
5 participants
@fdubost

fdubost commented Jan 19, 2016

Hi !
Thank you for this great library 馃槂

I have some troubles with rerun feature :

  • it seems that the @ in the file name indicates to cucumber that we run a "rerun" file but we can't do this cucumberjs tests/features/@rerun.txt,
  • when we run cucumberjs @rerun.txt, it run not only the rerun scenarios but also all the features in the current directory and its descendents.

Is these problems known ?

@charlierudolph

This comment has been minimized.

Show comment
Hide comment
@charlierudolph

charlierudolph Jan 19, 2016

Member

it seems that the @ in the file name indicates to cucumber that we run a "rerun" file but we can't do this cucumberjs tests/features/@rerun.txt

Good point, I'll make this work.

when we run cucumberjs @rerun.txt, it run not only the rerun scenarios but also all the features in the current directory and its descendents.

Auhh, I see the bug. Thanks for the report.

Member

charlierudolph commented Jan 19, 2016

it seems that the @ in the file name indicates to cucumber that we run a "rerun" file but we can't do this cucumberjs tests/features/@rerun.txt

Good point, I'll make this work.

when we run cucumberjs @rerun.txt, it run not only the rerun scenarios but also all the features in the current directory and its descendents.

Auhh, I see the bug. Thanks for the report.

@JasonSmiley208

This comment has been minimized.

Show comment
Hide comment
@JasonSmiley208

JasonSmiley208 Feb 2, 2016

Hi!

I am having a similar error, except saying cucumber-js @rerun.txt gives me an error saying "no such file or directory, open '@rerun.txt'.

This seems like a bug...


Stack Trace:

fs.js:584
return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
^

Error: ENOENT: no such file or directory, open '@rerun.txt'
at Error (native)
at Object.fs.openSync (fs.js:584:18)
at Object.fs.readFileSync (fs.js:431:33)
at /usr/local/lib/node_modules/cucumber/lib/cucumber/cli/configuration.js:12:26
at Array.forEach (native)
at Function.Configuration (/usr/local/lib/node_modules/cucumber/lib/cucumber/cli/configuration.js:10:10)
at getConfiguration (/usr/local/lib/node_modules/cucumber/lib/cucumber/cli.js:48:38)
at Object.run (/usr/local/lib/node_modules/cucumber/lib/cucumber/cli.js:54:27)
at Object. (/usr/local/lib/node_modules/cucumber/bin/cucumber.js:4:5)
at Module._compile (module.js:397:26)

JasonSmiley208 commented Feb 2, 2016

Hi!

I am having a similar error, except saying cucumber-js @rerun.txt gives me an error saying "no such file or directory, open '@rerun.txt'.

This seems like a bug...


Stack Trace:

fs.js:584
return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
^

Error: ENOENT: no such file or directory, open '@rerun.txt'
at Error (native)
at Object.fs.openSync (fs.js:584:18)
at Object.fs.readFileSync (fs.js:431:33)
at /usr/local/lib/node_modules/cucumber/lib/cucumber/cli/configuration.js:12:26
at Array.forEach (native)
at Function.Configuration (/usr/local/lib/node_modules/cucumber/lib/cucumber/cli/configuration.js:10:10)
at getConfiguration (/usr/local/lib/node_modules/cucumber/lib/cucumber/cli.js:48:38)
at Object.run (/usr/local/lib/node_modules/cucumber/lib/cucumber/cli.js:54:27)
at Object. (/usr/local/lib/node_modules/cucumber/bin/cucumber.js:4:5)
at Module._compile (module.js:397:26)

@charlierudolph

This comment has been minimized.

Show comment
Hide comment
@charlierudolph

charlierudolph Feb 2, 2016

Member

@JasonSmiley208 that should only be happening if you don't have the file @rerun.txt in your current working directory. Is that the case?

Member

charlierudolph commented Feb 2, 2016

@JasonSmiley208 that should only be happening if you don't have the file @rerun.txt in your current working directory. Is that the case?

@JasonSmiley208

This comment has been minimized.

Show comment
Hide comment
@JasonSmiley208

JasonSmiley208 Feb 2, 2016

well, my file is called "rerun.txt", not "@rerun.txt". Is this what you mean? (It is in the root directory. Aka, where I am running cucumber-js)

Note, when I remove the "@" to say cucumber-js rerun.txt, I get a different error:

Error: Lexing error on line 1: 'features/login.feature:14'. See http://wiki.github.com/cucumber/gherkin/lexingerror for more information.
path: /Users/jason.smiley/Desktop/exampleProjects/protractor-cucumber/rerun.txt
at Lexer.scan (/usr/local/lib/node_modules/cucumber/node_modules/gherkin/lib/gherkin/lexer/en.js:1008:13)
at GherkinLexer.scan (/usr/local/lib/node_modules/cucumber/lib/cucumber/gherkin_lexer.js:25:11)
at Object.parse (/usr/local/lib/node_modules/cucumber/lib/cucumber/parser.js:18:17)
at Object.getFeatures (/usr/local/lib/node_modules/cucumber/lib/cucumber/runtime.js:38:35)
at Object.start (/usr/local/lib/node_modules/cucumber/lib/cucumber/runtime.js:11:27)
at Object.run (/usr/local/lib/node_modules/cucumber/lib/cucumber/cli.js:60:15)
at Object. (/usr/local/lib/node_modules/cucumber/bin/cucumber.js:4:5)
at Module._compile (module.js:397:26)
at Object.Module._extensions..js (module.js:404:10)
at Module.load (module.js:343:32)

Also, the http://wiki.github.com/cucumber/gherkin/lexingerror page does not exist. That said, "features/login.feature:14" is the content of my rerun.txt file. I am assuming this is happening because the runner wants an actual feature file instead of a reference to the file I want to run.

JasonSmiley208 commented Feb 2, 2016

well, my file is called "rerun.txt", not "@rerun.txt". Is this what you mean? (It is in the root directory. Aka, where I am running cucumber-js)

Note, when I remove the "@" to say cucumber-js rerun.txt, I get a different error:

Error: Lexing error on line 1: 'features/login.feature:14'. See http://wiki.github.com/cucumber/gherkin/lexingerror for more information.
path: /Users/jason.smiley/Desktop/exampleProjects/protractor-cucumber/rerun.txt
at Lexer.scan (/usr/local/lib/node_modules/cucumber/node_modules/gherkin/lib/gherkin/lexer/en.js:1008:13)
at GherkinLexer.scan (/usr/local/lib/node_modules/cucumber/lib/cucumber/gherkin_lexer.js:25:11)
at Object.parse (/usr/local/lib/node_modules/cucumber/lib/cucumber/parser.js:18:17)
at Object.getFeatures (/usr/local/lib/node_modules/cucumber/lib/cucumber/runtime.js:38:35)
at Object.start (/usr/local/lib/node_modules/cucumber/lib/cucumber/runtime.js:11:27)
at Object.run (/usr/local/lib/node_modules/cucumber/lib/cucumber/cli.js:60:15)
at Object. (/usr/local/lib/node_modules/cucumber/bin/cucumber.js:4:5)
at Module._compile (module.js:397:26)
at Object.Module._extensions..js (module.js:404:10)
at Module.load (module.js:343:32)

Also, the http://wiki.github.com/cucumber/gherkin/lexingerror page does not exist. That said, "features/login.feature:14" is the content of my rerun.txt file. I am assuming this is happening because the runner wants an actual feature file instead of a reference to the file I want to run.

@charlierudolph

This comment has been minimized.

Show comment
Hide comment
@charlierudolph

charlierudolph Feb 2, 2016

Member

So cucumber-js will actually load the file whatever file path is passed. It does not strip the @ sign before loading a file. However, the fact that it starts with an @ sign causes cucumber-js to treat it differently.

Thus if you rename rerun.txt to @rerun.txt, it should work, though may run into the bug reported in this thread.

Member

charlierudolph commented Feb 2, 2016

So cucumber-js will actually load the file whatever file path is passed. It does not strip the @ sign before loading a file. However, the fact that it starts with an @ sign causes cucumber-js to treat it differently.

Thus if you rename rerun.txt to @rerun.txt, it should work, though may run into the bug reported in this thread.

@JasonSmiley208

This comment has been minimized.

Show comment
Hide comment
@JasonSmiley208

JasonSmiley208 Feb 2, 2016

-That works for me. Thanks!- Well, not exactly....

So, some how passing in this file runs the following code in addition to my test:

Feature: Test

Scenario: Foobar # node_modules/cucumber-assert/spec/integration/features/test.feature:2
Given I run the cucumber suits # node_modules/cucumber-assert/spec/integration/features/step_definitions/definition.js:22
When I fail an assert # node_modules/cucumber-assert/spec/integration/features/step_definitions/definition.js:26
And I fail a throws # node_modules/cucumber-assert/spec/integration/features/step_definitions/definition.js:30
And I fail a doesNotThrow # node_modules/cucumber-assert/spec/integration/features/step_definitions/definition.js:34
And I fail a ifError # node_modules/cucumber-assert/spec/integration/features/step_definitions/definition.js:38
Then everything worked as expected # node_modules/cucumber-assert/spec/integration/features/step_definitions/definition.js:42

JasonSmiley208 commented Feb 2, 2016

-That works for me. Thanks!- Well, not exactly....

So, some how passing in this file runs the following code in addition to my test:

Feature: Test

Scenario: Foobar # node_modules/cucumber-assert/spec/integration/features/test.feature:2
Given I run the cucumber suits # node_modules/cucumber-assert/spec/integration/features/step_definitions/definition.js:22
When I fail an assert # node_modules/cucumber-assert/spec/integration/features/step_definitions/definition.js:26
And I fail a throws # node_modules/cucumber-assert/spec/integration/features/step_definitions/definition.js:30
And I fail a doesNotThrow # node_modules/cucumber-assert/spec/integration/features/step_definitions/definition.js:34
And I fail a ifError # node_modules/cucumber-assert/spec/integration/features/step_definitions/definition.js:38
Then everything worked as expected # node_modules/cucumber-assert/spec/integration/features/step_definitions/definition.js:42

@gkushang gkushang referenced this issue Feb 4, 2016

Merged

Rerun Feature #54

@charlierudolph

This comment has been minimized.

Show comment
Hide comment
@charlierudolph

charlierudolph Feb 17, 2016

Member

@fdubost can you actually give more information for when cucumber-js @rerun.txt runs all the scenarios? I do have that happen when @rerun.txt (which I don't think is wrong), but not when there is anything in @rerun.txt

Member

charlierudolph commented Feb 17, 2016

@fdubost can you actually give more information for when cucumber-js @rerun.txt runs all the scenarios? I do have that happen when @rerun.txt (which I don't think is wrong), but not when there is anything in @rerun.txt

@charlierudolph

This comment has been minimized.

Show comment
Hide comment
@charlierudolph

charlierudolph Feb 17, 2016

Member

Nevermind @fdubost got it.

Member

charlierudolph commented Feb 17, 2016

Nevermind @fdubost got it.

@fdubost

This comment has been minimized.

Show comment
Hide comment
@fdubost

fdubost Feb 17, 2016

It works well, thank you 馃憤

fdubost commented Feb 17, 2016

It works well, thank you 馃憤

@spkjess

This comment has been minimized.

Show comment
Hide comment
@spkjess

spkjess May 16, 2017

It works for me to

  1. create @rerun.txt
  2. run cucumber-js -f rerun --format rerun:@rerun.txt
  3. run cucumber-js @rerun.txt

spkjess commented May 16, 2017

It works for me to

  1. create @rerun.txt
  2. run cucumber-js -f rerun --format rerun:@rerun.txt
  3. run cucumber-js @rerun.txt
@thangakumard

This comment has been minimized.

Show comment
Hide comment
@thangakumard

thangakumard Jul 13, 2017

@JasonSmiley208 @fdubost @spkjess - Any one of you please help me on

  1. How to generate rerun.txt
  2. How to rerun the test cases in rerun.txt

currently I am using cucumberjs with Selenium-Webdriver. I am using the below command in package.json to run my test cases. All my feature files are in 'src' folder. Babel transformed dependent files are in 'dist' folder.

"test": "node_modules/.bin/cucumberjs src -r dist/steps -r dist/library -r dist/helper",

Please help me to modify the command to capture the failed test cases and to rerun those cases

thangakumard commented Jul 13, 2017

@JasonSmiley208 @fdubost @spkjess - Any one of you please help me on

  1. How to generate rerun.txt
  2. How to rerun the test cases in rerun.txt

currently I am using cucumberjs with Selenium-Webdriver. I am using the below command in package.json to run my test cases. All my feature files are in 'src' folder. Babel transformed dependent files are in 'dist' folder.

"test": "node_modules/.bin/cucumberjs src -r dist/steps -r dist/library -r dist/helper",

Please help me to modify the command to capture the failed test cases and to rerun those cases

@charlierudolph

This comment has been minimized.

Show comment
Hide comment
@charlierudolph

charlierudolph Jul 13, 2017

Member

@thangakumard Using the rerun formatter is two parts. First you generate the rerun file and then on the next run that is what you run.

  • On the first run add the parameters --format rerun:@rerun.txt
  • After a failed run, remove any arguments specifying the locations of feature files and add @rerun.txt

The @ is the only important part of the filename as then cucumber parses it as rerun file. Otherwise you can name the file whatever you want. I'll add this short explanation to the docs

Member

charlierudolph commented Jul 13, 2017

@thangakumard Using the rerun formatter is two parts. First you generate the rerun file and then on the next run that is what you run.

  • On the first run add the parameters --format rerun:@rerun.txt
  • After a failed run, remove any arguments specifying the locations of feature files and add @rerun.txt

The @ is the only important part of the filename as then cucumber parses it as rerun file. Otherwise you can name the file whatever you want. I'll add this short explanation to the docs

@thangakumard

This comment has been minimized.

Show comment
Hide comment
@thangakumard

thangakumard Jul 13, 2017

@charlierudolph - Thanks for your response. it is working fine 馃憤 . Also I was using old version of cucumberjs. once I upgraded to latest version it is working as expected

thangakumard commented Jul 13, 2017

@charlierudolph - Thanks for your response. it is working fine 馃憤 . Also I was using old version of cucumberjs. once I upgraded to latest version it is working as expected

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment