Code Monkey home page Code Monkey logo

Comments (6)

mattwynne avatar mattwynne commented on July 21, 2024

I like this Charlie, it's something that irritates me too, but I've sort of grown used to it and stopped noticing!

When you propose is very similar to RSpec's output. In RSpec, they categorise the different kinds of issues, so you'd probably see something more like this:

..F-.A-.U-.P-

Failures:

  1) Scenario: 2 # features/a.feature:6
     Given a failing step # features/step_definitions/steps.js:4
       Error: error
         at World.<anonymous> (/.../features/step_definitions/steps.js:5:11)

  2) Scenario: 3 # features/a.feature:11
      Given a ambiguous step
      Multiple step definitions match:
        /^an? ambiguous step$/ # features/step_definitions/steps.js:8
        /^a ambiguous step$/   # features/step_definitions/steps.js:9

Undefined: (Failures listed here are expected and do not affect your suite's status)

  1) Scenario: 4 # features/a.feature:16
      Given a undefined step
        Use the following snippet to implement this step
          this.Given(/a undefined step/, function(){
            // Write code to here to turn the step into concrete actions
            callback.pending();
          })

Pending: (Failures listed here are expected and do not affect your suite's status)

  1) Scenario: 5 # features/a.feature:21
      Given a pending step # features/step_definitions/steps.js:11
        Pending

5 scenarios (1 failed, 1 undefined, 1 ambiguous, 1 pending, 1 passed)
13 steps (1 failed, 1 undefined, 1 ambiguous, 1 pending, 4 skipped, 5 passed)
0m00.003s

Personally I like this sorting as it helps you to focus on the big problems first (failures) before dealing with the less urgent undefined / pending issues. The (Failures listed here are expected and do not affect your suite's status) message is ripped off frominspired by RSpec and would not be shown if you're running in --strict mode I suppose.

Just a suggestion to consider. I like trying to make these tools converge. I wonder what @everzet does in Behat? cc @tooky

from common.

charlierudolph avatar charlierudolph commented on July 21, 2024

Here is what [email protected] currently has as the output for the progress formatter (which prints the status along the way and then prints the same as the summary formatter). For reference on cucumber/cucumber-ruby#1030 and if anyone else is interested.

..F-.A-.U-.P-

Failures:

1) Scenario: 2 - features/test.feature:6
   Step: And a failing step - features/test.feature:8
   Step Definition: features/step_definitions/browser_steps.js:22
   Message:
     Error: error
         at CustomWorld.<anonymous> (/Users/charlesrudolph/github/test/features/step_definitions/browser_steps.js:23:11)
         at _combinedTickCallback (internal/process/next_tick.js:67:7)
         at process._tickCallback (internal/process/next_tick.js:98:9)

2) Scenario: 3 - features/test.feature:11
   Step: And a ambiguous step - features/test.feature:13
   Message:
     Multiple step definitions match:
       /^a ambiguous step$/   - features/step_definitions/browser_steps.js:28
       /^an? ambiguous step$/ - features/step_definitions/browser_steps.js:29

Warnings:

1) Scenario: 4 - features/test.feature:16
   Step: And a undefined step - features/test.feature:18
   Message:
     Undefined. Implement with the following snippet:

       this.Given(/^a undefined step$/, function (callback) {
         // Write code here that turns the phrase above into concrete actions
         callback(null, 'pending');
       });

2) Scenario: 5 - features/test.feature:21
   Step: And a pending step - features/test.feature:23
   Step Definition: features/step_definitions/browser_steps.js:25
   Message:
     Pending

5 scenarios (1 failed, 1 ambiguous, 1 undefined, 1 pending, 1 passed)
13 steps (1 failed, 1 ambiguous, 1 undefined, 1 pending, 4 skipped, 5 passed)
0m03.254s

For colors, the scenario name (Example: "1") and step name (Example: "And a failing step") are in bold. The relative paths (Example: features/test.feature:21) are all in gray. The failure messages are in red and the warning messages are in yellow.

If you would like to reproduce, use the feature at the top, and the following step definitions

// features/step_definitions/test_steps.js
module.exports = function () {
  this.Given(/^a passing step$/, function() {});
  this.Given(/^a failing step$/, function() {
    throw new Error('error');
  });
  this.Given(/^a pending step$/, function() {
    return 'pending';
  });
  this.Given(/^a ambiguous step$/, function() {});
  this.Given(/^an? ambiguous step$/, function() {});
  this.Given(/^a skipped step$/, function() {});
};

from common.

mattwynne avatar mattwynne commented on July 21, 2024

Ref cucumber/cucumber-ruby#1030

from common.

stale avatar stale commented on July 21, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in a week if no further activity occurs.

from common.

charlierudolph avatar charlierudolph commented on July 21, 2024

For reference, cucumber-js removed the pretty formatter but now the summary output prints the failed scenarios in the previous pretty format.

from common.

lock avatar lock commented on July 21, 2024

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

from common.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.