From b4a68a08abe1d876823d818a1f7c3b64fe7508df Mon Sep 17 00:00:00 2001 From: Rob Aldred Date: Wed, 10 Feb 2010 11:25:00 +0000 Subject: [PATCH] added step file colon line to output similar to console output - textmate user get handy link direct to the step --- features/html_formatter/a.html | 66 ++++++++++++++++------------ lib/cucumber/formatter/cucumber.css | 10 +++++ lib/cucumber/formatter/cucumber.sass | 10 +++++ lib/cucumber/formatter/html.rb | 15 ++++++- 4 files changed, 72 insertions(+), 29 deletions(-) diff --git a/features/html_formatter/a.html b/features/html_formatter/a.html index f012438299..abfe47a7d7 100644 --- a/features/html_formatter/a.html +++ b/features/html_formatter/a.html @@ -48,6 +48,16 @@ .cucumber .summary ul.features li, td .summary ul.features li, th .summary ul.features li { display: inline; } +.cucumber .step_name, td .step_name, th .step_name { + float: left; +} +.cucumber .step_file, td .step_file, th .step_file { + text-align: right; + color: #999999; +} +.cucumber .step_file a, td .step_file a, th .step_file a { + color: #999999; +} .cucumber .tag, td .tag, th .tag { font-weight: bold; color: #246AC1; @@ -258,7 +268,7 @@ document.getElementById(element_id).style.background = '#FAF834'; document.getElementById(element_id).style.color = '#000000'; } -

Cucumber Features

@background_tagged_before_on_outline

Feature: Background tagged Before on Outline

Background:

  1. Given passing without a table

Scenario Outline: passing background

  1. Then I should have '<count>' cukes

Examples:

count
888

Feature: background with name

Background: I'm a background and I'm ok

  1. Given '10' cukes

Scenario: example

  1. Then I should have '10' cukes
@after_file

Feature: Failing background sample

Background:

  1. Given failing without a table
    FAIL
    ./features/step_definitions/sample_steps.rb:2:in `flunker'
    +

    Cucumber Features

    @background_tagged_before_on_outline

    Feature: Background tagged Before on Outline

    Background:

    1. Given passing without a table
      features/step_definitions/sample_steps.rb:12

    Scenario Outline: passing background

    1. Then I should have '<count>' cukes
      features/step_definitions/sample_steps.rb:31

    Examples:

    count
    888

    Feature: background with name

    Background: I'm a background and I'm ok

    1. Given '10' cukes
      features/step_definitions/sample_steps.rb:27

    Scenario: example

    1. Then I should have '10' cukes
      features/step_definitions/sample_steps.rb:31
    @after_file

    Feature: Failing background sample

    Background:

    1. Given failing without a table
      features/step_definitions/sample_steps.rb:15
      FAIL
      ./features/step_definitions/sample_steps.rb:2:in `flunker'
       ./features/step_definitions/sample_steps.rb:16:in `/^failing without a table$/'
       features/background/failing_background.feature:5:in `Given failing without a table':in `flunker'
       ./features/step_definitions/sample_steps.rb:2:in `flunker'
      @@ -268,7 +278,7 @@
       ./features/step_definitions/sample_steps.rb:16:in `/^failing without a table$/'
       features/background/failing_background.feature:5:in `Given failing without a table':in `Given failing without a table'
      0def flunker
       1  raise "FAIL"
      -2end
    2. And '10' cukes

    Scenario: failing background

      FAIL
      ./features/step_definitions/sample_steps.rb:2:in `flunker'
      +2end
    1. And '10' cukes
      features/step_definitions/sample_steps.rb:27

    Scenario: failing background

      FAIL
      ./features/step_definitions/sample_steps.rb:2:in `flunker'
       ./features/step_definitions/sample_steps.rb:16:in `/^failing without a table$/'
       features/background/failing_background.feature:5:in `Given failing without a table':in `flunker'
       ./features/step_definitions/sample_steps.rb:2:in `flunker'
      @@ -278,7 +288,7 @@
       ./features/step_definitions/sample_steps.rb:16:in `/^failing without a table$/'
       features/background/failing_background.feature:5:in `Given failing without a table':in `Given failing without a table'
      0def flunker
       1  raise "FAIL"
      -2end
    1. Then I should have '10' cukes

    Scenario: another failing background

    1. Then I should have '10' cukes

    Feature: Failing background after previously successful background sample

    Background:

    1. Given passing without a table
    2. And '10' global cukes

    Scenario: passing background

    1. Then I should have '10' global cukes

    Scenario: failing background

    1. FAIL
      ./features/step_definitions/sample_steps.rb:2:in `flunker'
      +2end
    2. Then I should have '10' cukes
      features/step_definitions/sample_steps.rb:31

    Scenario: another failing background

    1. Then I should have '10' cukes
      features/step_definitions/sample_steps.rb:31

    Feature: Failing background after previously successful background sample

    Background:

    1. Given passing without a table
      features/step_definitions/sample_steps.rb:12
    2. And '10' global cukes
      features/step_definitions/sample_steps.rb:35

    Scenario: passing background

    1. Then I should have '10' global cukes
      features/step_definitions/sample_steps.rb:42

    Scenario: failing background

    1. FAIL
      ./features/step_definitions/sample_steps.rb:2:in `flunker'
       ./features/step_definitions/sample_steps.rb:37:in `/^'(.+)' global cukes$/'
       features/background/failing_background_after_success.feature:5:in `And '10' global cukes':in `flunker'
       ./features/step_definitions/sample_steps.rb:2:in `flunker'
      @@ -288,9 +298,9 @@
       ./features/step_definitions/sample_steps.rb:37:in `/^'(.+)' global cukes$/'
       features/background/failing_background_after_success.feature:5:in `And '10' global cukes':in `And '10' global cukes'
      0def flunker
       1  raise "FAIL"
      -2end
    2. Then I should have '10' global cukes

    Feature: Passing background with multiline args

    Background:

    1. Given table
      a
      b
      c
      d
    2. And multiline string
        I'm a cucumber and I'm okay. 
        I sleep all night and I test all day

    Scenario: passing background

    1. Then the table should be
      a
      b
      c
      d
    2. Then the multiline string should be
        I'm a cucumber and I'm okay. 
        I sleep all night and I test all day

    Scenario: another passing background

    1. Then the table should be
      a
      b
      c
      d
    2. Then the multiline string should be
        I'm a cucumber and I'm okay. 
        I sleep all night and I test all day

    Feature: Passing background sample

    Background:

    1. Given '10' cukes

    Scenario: passing background

    1. Then I should have '10' cukes

    Scenario: another passing background

    1. Then I should have '10' cukes

    Feature: Pending background sample

    Background:

    1. Given pending
      Given /^pending$/ do
      +2end
    2. Then I should have '10' global cukes
      features/step_definitions/sample_steps.rb:42

    Feature: Passing background with multiline args

    Background:

    1. Given table
      features/step_definitions/sample_steps.rb:46
      a
      b
      c
      d
    2. And multiline string
      features/step_definitions/sample_steps.rb:50
        I'm a cucumber and I'm okay. 
        I sleep all night and I test all day

    Scenario: passing background

    1. Then the table should be
      features/step_definitions/sample_steps.rb:54
      a
      b
      c
      d
    2. Then the multiline string should be
      features/step_definitions/sample_steps.rb:58
        I'm a cucumber and I'm okay. 
        I sleep all night and I test all day

    Scenario: another passing background

    1. Then the table should be
      features/step_definitions/sample_steps.rb:54
      a
      b
      c
      d
    2. Then the multiline string should be
      features/step_definitions/sample_steps.rb:58
        I'm a cucumber and I'm okay. 
        I sleep all night and I test all day

    Feature: Passing background sample

    Background:

    1. Given '10' cukes
      features/step_definitions/sample_steps.rb:27

    Scenario: passing background

    1. Then I should have '10' cukes
      features/step_definitions/sample_steps.rb:31

    Scenario: another passing background

    1. Then I should have '10' cukes
      features/step_definitions/sample_steps.rb:31

    Feature: Pending background sample

    Background:

    1. Given pending
      features/background/pending_background.feature:4
      Given /^pending$/ do
         pending # express the regexp above with the code you wish you had
      -end

    Scenario: pending background

    1. Then I should have '10' cukes

    Scenario: another pending background

    1. Then I should have '10' cukes

    Feature: Failing background with scenario outlines sample

    Background:

    1. Given failing without a table
      FAIL
      ./features/step_definitions/sample_steps.rb:2:in `flunker'
      +end

    Scenario: pending background

    1. Then I should have '10' cukes
      features/step_definitions/sample_steps.rb:31

    Scenario: another pending background

    1. Then I should have '10' cukes
      features/step_definitions/sample_steps.rb:31

    Feature: Failing background with scenario outlines sample

    Background:

    1. Given failing without a table
      features/step_definitions/sample_steps.rb:15
      FAIL
      ./features/step_definitions/sample_steps.rb:2:in `flunker'
       ./features/step_definitions/sample_steps.rb:16:in `/^failing without a table$/'
       features/background/scenario_outline_failing_background.feature:4:in `Given failing without a table':in `flunker'
       ./features/step_definitions/sample_steps.rb:2:in `flunker'
      @@ -300,10 +310,10 @@
       ./features/step_definitions/sample_steps.rb:16:in `/^failing without a table$/'
       features/background/scenario_outline_failing_background.feature:4:in `Given failing without a table':in `Given failing without a table'
      0def flunker
       1  raise "FAIL"
      -2end

    Scenario Outline: failing background

    1. Then I should have '<count>' cukes

    Examples:

    count
    10
    FAIL
    +2end

    Scenario Outline: failing background

    1. Then I should have '<count>' cukes
      features/step_definitions/sample_steps.rb:31

    Examples:

    count
    10
    FAIL
     ./features/step_definitions/sample_steps.rb:2:in `flunker'
     ./features/step_definitions/sample_steps.rb:16:in `/^failing without a table$/'
    -features/background/scenario_outline_failing_background.feature:4:in `Given failing without a table'

    Scenario Outline: another failing background

    1. Then I should have '<count>' cukes

    Examples:

    count
    10

    Feature: Passing background with scenario outlines sample

    Background:

    1. Given '10' cukes

    Scenario Outline: passing background

    1. Then I should have '<count>' cukes

    Examples:

    count
    10

    Scenario Outline: another passing background

    1. Then I should have '<count>' cukes

    Examples:

    count
    10

    Feature: Calling undefined step

    Scenario: Call directly

    1. Given a step definition that calls an undefined step
      Undefined step: "this does not exist"
      ./features/step_definitions/sample_steps.rb:20:in `/^a step definition that calls an undefined step$/'
      +features/background/scenario_outline_failing_background.feature:4:in `Given failing without a table'

    Scenario Outline: another failing background

    1. Then I should have '<count>' cukes
      features/step_definitions/sample_steps.rb:31

    Examples:

    count
    10

    Feature: Passing background with scenario outlines sample

    Background:

    1. Given '10' cukes
      features/step_definitions/sample_steps.rb:27

    Scenario Outline: passing background

    1. Then I should have '<count>' cukes
      features/step_definitions/sample_steps.rb:31

    Examples:

    count
    10

    Scenario Outline: another passing background

    1. Then I should have '<count>' cukes
      features/step_definitions/sample_steps.rb:31

    Examples:

    count
    10

    Feature: Calling undefined step

    Scenario: Call directly

    1. Given a step definition that calls an undefined step
      features/step_definitions/sample_steps.rb:19
      Undefined step: "this does not exist"
      ./features/step_definitions/sample_steps.rb:20:in `/^a step definition that calls an undefined step$/'
       features/call_undefined_step_from_step_def.feature:4:in `Given a step definition that calls an undefined step':in `/^a step definition that calls an undefined step$/'
       ./features/step_definitions/sample_steps.rb:20:in `/^a step definition that calls an undefined step$/'
       features/call_undefined_step_from_step_def.feature:4:in `Given a step definition that calls an undefined step':in `Given a step definition that calls an undefined step'
      18
      @@ -311,7 +321,7 @@
       20  Given 'this does not exist'
       21end
      Given /^$/ do
         pending # express the regexp above with the code you wish you had
      -end

    Scenario: Call via another

    1. Given call step "a step definition that calls an undefined step"
      Undefined step: "this does not exist"
      ./features/step_definitions/sample_steps.rb:20:in `/^a step definition that calls an undefined step$/'
      +end

    Scenario: Call via another

    1. Given call step "a step definition that calls an undefined step"
      features/step_definitions/sample_steps.rb:23
      Undefined step: "this does not exist"
      ./features/step_definitions/sample_steps.rb:20:in `/^a step definition that calls an undefined step$/'
       features/call_undefined_step_from_step_def.feature:7:in `Given call step "a step definition that calls an undefined step"':in `/^a step definition that calls an undefined step$/'
       ./features/step_definitions/sample_steps.rb:20:in `/^a step definition that calls an undefined step$/'
       features/call_undefined_step_from_step_def.feature:7:in `Given call step "a step definition that calls an undefined step"':in `Given call step "a step definition that calls an undefined step"'
      18
      @@ -319,7 +329,7 @@
       20  Given 'this does not exist'
       21end
      Given /^$/ do
         pending # express the regexp above with the code you wish you had
      -end

    Feature: Failing expectation

    Scenario: Failing expectation

    1. Given failing expectation
      expected: "that",
      +end

    Feature: Failing expectation

    Scenario: Failing expectation

    1. Given failing expectation
      features/step_definitions/sample_steps.rb:62
      expected: "that",
            got: "this" (using ==)
       
        Diff:
      @@ -332,30 +342,30 @@
       features/failing_expectation.feature:4:in `Given failing expectation':in `Given failing expectation'
      61
       62Given /^failing expectation$/ do
       63  'this'.should == 'that'
      -64end

    Feature: Lots of undefined

    Scenario: Implement me

    1. Given it snows in Sahara
      Given /^it snows in Sahara$/ do
      +64end

    Feature: Lots of undefined

    Scenario: Implement me

    1. Given it snows in Sahara
      features/lots_of_undefined.feature:4
      Given /^it snows in Sahara$/ do
         pending # express the regexp above with the code you wish you had
      -end
    2. Given it's 40 degrees in Norway
      Given /^it's 40 degrees in Norway$/ do
      +end
    3. Given it's 40 degrees in Norway
      features/lots_of_undefined.feature:5
      Given /^it's 40 degrees in Norway$/ do
         pending # express the regexp above with the code you wish you had
      -end
    4. And it's 40 degrees in Norway
      Given /^it's 40 degrees in Norway$/ do
      +end
    5. And it's 40 degrees in Norway
      features/lots_of_undefined.feature:6
      Given /^it's 40 degrees in Norway$/ do
         pending # express the regexp above with the code you wish you had
      -end
    6. When I stop procrastinating
      When /^I stop procrastinating$/ do
      +end
    7. When I stop procrastinating
      features/lots_of_undefined.feature:7
      When /^I stop procrastinating$/ do
         pending # express the regexp above with the code you wish you had
      -end
    8. And there is world peace
      When /^there is world peace$/ do
      +end
    9. And there is world peace
      features/lots_of_undefined.feature:8
      When /^there is world peace$/ do
         pending # express the regexp above with the code you wish you had
       end

    Feature: multiline

    Background: I'm a multiline name which goes on and on and on for three lines -yawn

    1. Given passing without a table

    Scenario: I'm a multiline name +yawn

    1. Given passing without a table
      features/step_definitions/sample_steps.rb:12

    Scenario: I'm a multiline name which goes on and on and on for three lines -yawn

    1. Given passing without a table

    Scenario Outline: I'm a multiline name +yawn

    1. Given passing without a table
      features/step_definitions/sample_steps.rb:12

    Scenario Outline: I'm a multiline name which goes on and on and on for three lines -yawn

    1. Given <state> without a table

    Examples:

    state
    passing

    Scenario Outline: name

    1. Given <state> without a table

    Examples: I'm a multiline name +yawn

    1. Given <state> without a table
      features/step_definitions/sample_steps.rb:12

    Examples:

    state
    passing

    Scenario Outline: name

    1. Given <state> without a table
      features/step_definitions/sample_steps.rb:12

    Examples: I'm a multiline name which goes on and on and on for three lines -yawn

    state
    passing

    Feature: Outline Sample

    Scenario: I have no steps

      Scenario Outline: Test state

      1. Given <state> without a table
      2. Given <other_state> without a table

      Examples: Rainbow colours

      state
      other_state
      missing
      passing
      passing
      passing
      failing
      passing
      FAIL
      +yawn
      state
      passing

      Feature: Outline Sample

      Scenario: I have no steps

        Scenario Outline: Test state

        1. Given <state> without a table
          features/step_definitions/sample_steps.rb:12
        2. Given <other_state> without a table
          features/step_definitions/sample_steps.rb:12

        Examples: Rainbow colours

        state
        other_state
        missing
        passing
        passing
        passing
        failing
        passing
        FAIL
         ./features/step_definitions/sample_steps.rb:2:in `flunker'
         ./features/step_definitions/sample_steps.rb:16:in `/^failing without a table$/'
        -features/outline_sample.feature:6:in `Given  without a table'

        Examples: Only passing

        state
        other_state
        passing
        passing
        # Feature comment
        @one

        Feature: Sample

        @two @three

        Scenario: Missing

        1. Given missing
          Given /^missing$/ do
          +features/outline_sample.feature:6:in `Given  without a table'

        Examples: Only passing

        state
        other_state
        passing
        passing
        # Feature comment
        @one

        Feature: Sample

        @two @three

        Scenario: Missing

        1. Given missing
          features/sample.feature:7
          Given /^missing$/ do
             pending # express the regexp above with the code you wish you had
          -end
        # Scenario comment
        @three

        Scenario: Passing

        1. Given passing
          a
          b
          c
          d
        @four

        Scenario: Failing

        1. Given failing
          hello
          FAIL
          ./features/step_definitions/sample_steps.rb:2:in `flunker'
          +end
        # Scenario comment
        @three

        Scenario: Passing

        1. Given passing
          features/step_definitions/sample_steps.rb:5
          a
          b
          c
          d
        @four

        Scenario: Failing

        1. Given failing
          features/step_definitions/sample_steps.rb:8
          hello
          FAIL
          ./features/step_definitions/sample_steps.rb:2:in `flunker'
           ./features/step_definitions/sample_steps.rb:9:in `/^failing$/'
           features/sample.feature:18:in `Given failing':in `flunker'
           ./features/step_definitions/sample_steps.rb:2:in `flunker'
          @@ -365,7 +375,7 @@
           ./features/step_definitions/sample_steps.rb:9:in `/^failing$/'
           features/sample.feature:18:in `Given failing':in `Given failing'
          0def flunker
           1  raise "FAIL"
          -2end

        Feature: search examples

        Background: Hantu Pisang background match

        1. Given passing without a table

        Scenario: should match Hantu Pisang

        1. Given passing without a table

        Scenario: Ignore me

        1. Given failing without a table
          FAIL
          ./features/step_definitions/sample_steps.rb:2:in `flunker'
          +2end

        Feature: search examples

        Background: Hantu Pisang background match

        1. Given passing without a table
          features/step_definitions/sample_steps.rb:12

        Scenario: should match Hantu Pisang

        1. Given passing without a table
          features/step_definitions/sample_steps.rb:12

        Scenario: Ignore me

        1. Given failing without a table
          features/step_definitions/sample_steps.rb:15
          FAIL
          ./features/step_definitions/sample_steps.rb:2:in `flunker'
           ./features/step_definitions/sample_steps.rb:16:in `/^failing without a table$/'
           features/search_sample.feature:10:in `Given failing without a table':in `flunker'
           ./features/step_definitions/sample_steps.rb:2:in `flunker'
          @@ -375,26 +385,26 @@
           ./features/step_definitions/sample_steps.rb:16:in `/^failing without a table$/'
           features/search_sample.feature:10:in `Given failing without a table':in `Given failing without a table'
          0def flunker
           1  raise "FAIL"
          -2end

        Scenario Outline: Ignore me

        1. Given <state> without a table

        Examples:

        state
        failing
        FAIL
        +2end

        Scenario Outline: Ignore me

        1. Given <state> without a table
          features/step_definitions/sample_steps.rb:15

        Examples:

        state
        failing
        FAIL
         ./features/step_definitions/sample_steps.rb:2:in `flunker'
         ./features/step_definitions/sample_steps.rb:16:in `/^failing without a table$/'
        -features/search_sample.feature:13:in `Given  without a table'

        Scenario Outline: Hantu Pisang match

        1. Given <state> without a table

        Examples:

        state
        passing

        Scenario Outline: no match in name but in examples

        1. Given <state> without a table

        Examples: Hantu Pisang

        state
        passing

        Examples: Ignore me

        state
        failing
        FAIL
        +features/search_sample.feature:13:in `Given  without a table'

        Scenario Outline: Hantu Pisang match

        1. Given <state> without a table
          features/step_definitions/sample_steps.rb:12

        Examples:

        state
        passing

        Scenario Outline: no match in name but in examples

        1. Given <state> without a table
          features/step_definitions/sample_steps.rb:12

        Examples: Hantu Pisang

        state
        passing

        Examples: Ignore me

        state
        failing
        FAIL
         ./features/step_definitions/sample_steps.rb:2:in `flunker'
         ./features/step_definitions/sample_steps.rb:16:in `/^failing without a table$/'
        -features/search_sample.feature:25:in `Given  without a table'
        @sample_one

        Feature: Tag samples

        @sample_two @sample_four

        Scenario: Passing

        1. Given missing
          Given /^missing$/ do
          +features/search_sample.feature:25:in `Given  without a table'
        @sample_one

        Feature: Tag samples

        @sample_two @sample_four

        Scenario: Passing

        1. Given missing
          features/tags_sample.feature:6
          Given /^missing$/ do
             pending # express the regexp above with the code you wish you had
          -end
        @sample_three

        Scenario Outline:

        1. Given <state>

        Examples:

        state
        missing
        @sample_three @sample_four

        Scenario: Skipped

        1. Given missing
          Given /^missing$/ do
          +end
        @sample_three

        Scenario Outline:

        1. Given <state>
          features/tags_sample.feature:10

        Examples:

        state
        missing
        @sample_three @sample_four

        Scenario: Skipped

        1. Given missing
          features/tags_sample.feature:17
          Given /^missing$/ do
             pending # express the regexp above with the code you wish you had
          -end
        @lots

        Feature: Tons of cukes

        Scenario: Lots and lots

        1. Given '2' cukes
        2. Given '2' cukes
          We already have 2 cukes!
          ./features/step_definitions/sample_steps.rb:28:in `/^'(.+)' cukes$/'
          +end
        @lots

        Feature: Tons of cukes

        Scenario: Lots and lots

        1. Given '2' cukes
          features/step_definitions/sample_steps.rb:27
        2. Given '2' cukes
          features/step_definitions/sample_steps.rb:27
          We already have 2 cukes!
          ./features/step_definitions/sample_steps.rb:28:in `/^'(.+)' cukes$/'
           features/tons_of_cukes.feature:5:in `Given '2' cukes':in `/^'(.+)' cukes$/'
           ./features/step_definitions/sample_steps.rb:28:in `/^'(.+)' cukes$/'
           features/tons_of_cukes.feature:5:in `Given '2' cukes':in `Given '2' cukes'
          26
           27Given /^'(.+)' cukes$/ do |cukes|
           28  raise "We already have #{@cukes} cukes!" if @cukes
           29  @cukes = cukes
          -30end
        3. Given '2' cukes
        4. Given '2' cukes
        5. Given '2' cukes
        6. Given '2' cukes
        7. Given '2' cukes
        8. Given '2' cukes
        9. Given '2' cukes
        10. Given '2' cukes
        11. Given '2' cukes
        12. Given '2' cukes
        13. Given '2' cukes
        14. Given '2' cukes
        15. Given '2' cukes
        16. Given '2' cukes
        17. Given '2' cukes
        18. Given '2' cukes
        19. Given '2' cukes
        20. Given '2' cukes
        21. Given '2' cukes
        22. Given '2' cukes
        23. Given '2' cukes
        24. Given '2' cukes
        25. Given '2' cukes
        26. Given '2' cukes
        27. Given '2' cukes
        28. Given '2' cukes
        29. Given '2' cukes
        30. Given '2' cukes
        31. Given '2' cukes
        32. Given '2' cukes
        33. Given '2' cukes
        34. Given '2' cukes
        35. Given '2' cukes
        36. Given '2' cukes
        37. Given '2' cukes
        38. Given '2' cukes
        39. Given '2' cukes
        40. Given '2' cukes
        41. Given '2' cukes
        42. Given '2' cukes
        43. Given '2' cukes
        44. Given '2' cukes
        45. Given '2' cukes
        46. Given '2' cukes
        47. Given '2' cukes
        48. Given '2' cukes
        49. Given '2' cukes

        Feature: undefined multiline args

        Scenario: pystring

        1. Given a pystring
            example
          Given /^a pystring$/ do |string|
          +30end
        2. Given '2' cukes
          features/step_definitions/sample_steps.rb:27
        3. Given '2' cukes
          features/step_definitions/sample_steps.rb:27
        4. Given '2' cukes
          features/step_definitions/sample_steps.rb:27
        5. Given '2' cukes
          features/step_definitions/sample_steps.rb:27
        6. Given '2' cukes
          features/step_definitions/sample_steps.rb:27
        7. Given '2' cukes
          features/step_definitions/sample_steps.rb:27
        8. Given '2' cukes
          features/step_definitions/sample_steps.rb:27
        9. Given '2' cukes
          features/step_definitions/sample_steps.rb:27
        10. Given '2' cukes
          features/step_definitions/sample_steps.rb:27
        11. Given '2' cukes
          features/step_definitions/sample_steps.rb:27
        12. Given '2' cukes
          features/step_definitions/sample_steps.rb:27
        13. Given '2' cukes
          features/step_definitions/sample_steps.rb:27
        14. Given '2' cukes
          features/step_definitions/sample_steps.rb:27
        15. Given '2' cukes
          features/step_definitions/sample_steps.rb:27
        16. Given '2' cukes
          features/step_definitions/sample_steps.rb:27
        17. Given '2' cukes
          features/step_definitions/sample_steps.rb:27
        18. Given '2' cukes
          features/step_definitions/sample_steps.rb:27
        19. Given '2' cukes
          features/step_definitions/sample_steps.rb:27
        20. Given '2' cukes
          features/step_definitions/sample_steps.rb:27
        21. Given '2' cukes
          features/step_definitions/sample_steps.rb:27
        22. Given '2' cukes
          features/step_definitions/sample_steps.rb:27
        23. Given '2' cukes
          features/step_definitions/sample_steps.rb:27
        24. Given '2' cukes
          features/step_definitions/sample_steps.rb:27
        25. Given '2' cukes
          features/step_definitions/sample_steps.rb:27
        26. Given '2' cukes
          features/step_definitions/sample_steps.rb:27
        27. Given '2' cukes
          features/step_definitions/sample_steps.rb:27
        28. Given '2' cukes
          features/step_definitions/sample_steps.rb:27
        29. Given '2' cukes
          features/step_definitions/sample_steps.rb:27
        30. Given '2' cukes
          features/step_definitions/sample_steps.rb:27
        31. Given '2' cukes
          features/step_definitions/sample_steps.rb:27
        32. Given '2' cukes
          features/step_definitions/sample_steps.rb:27
        33. Given '2' cukes
          features/step_definitions/sample_steps.rb:27
        34. Given '2' cukes
          features/step_definitions/sample_steps.rb:27
        35. Given '2' cukes
          features/step_definitions/sample_steps.rb:27
        36. Given '2' cukes
          features/step_definitions/sample_steps.rb:27
        37. Given '2' cukes
          features/step_definitions/sample_steps.rb:27
        38. Given '2' cukes
          features/step_definitions/sample_steps.rb:27
        39. Given '2' cukes
          features/step_definitions/sample_steps.rb:27
        40. Given '2' cukes
          features/step_definitions/sample_steps.rb:27
        41. Given '2' cukes
          features/step_definitions/sample_steps.rb:27
        42. Given '2' cukes
          features/step_definitions/sample_steps.rb:27
        43. Given '2' cukes
          features/step_definitions/sample_steps.rb:27
        44. Given '2' cukes
          features/step_definitions/sample_steps.rb:27
        45. Given '2' cukes
          features/step_definitions/sample_steps.rb:27
        46. Given '2' cukes
          features/step_definitions/sample_steps.rb:27
        47. Given '2' cukes
          features/step_definitions/sample_steps.rb:27
        48. Given '2' cukes
          features/step_definitions/sample_steps.rb:27

        Feature: undefined multiline args

        Scenario: pystring

        1. Given a pystring
          features/undefined_multiline_args.feature:4
            example
          Given /^a pystring$/ do |string|
             pending # express the regexp above with the code you wish you had
          -end

        Scenario: table

        1. Given a table
          table
          example
          Given /^a table$/ do |table|
          +end

        Scenario: table

        1. Given a table
          features/undefined_multiline_args.feature:10
          table
          example
          Given /^a table$/ do |table|
             # table is a Cucumber::Ast::Table
             pending # express the regexp above with the code you wish you had
           end
        \ No newline at end of file diff --git a/lib/cucumber/formatter/cucumber.css b/lib/cucumber/formatter/cucumber.css index cc7330c9bd..4c47882648 100644 --- a/lib/cucumber/formatter/cucumber.css +++ b/lib/cucumber/formatter/cucumber.css @@ -48,6 +48,16 @@ body { .cucumber .summary ul.features li, td .summary ul.features li, th .summary ul.features li { display: inline; } +.cucumber .step_name, td .step_name, th .step_name { + float: left; +} +.cucumber .step_file, td .step_file, th .step_file { + text-align: right; + color: #999999; +} +.cucumber .step_file a, td .step_file a, th .step_file a { + color: #999999; +} .cucumber .tag, td .tag, th .tag { font-weight: bold; color: #246AC1; diff --git a/lib/cucumber/formatter/cucumber.sass b/lib/cucumber/formatter/cucumber.sass index 4ff04c852f..7de57e51af 100644 --- a/lib/cucumber/formatter/cucumber.sass +++ b/lib/cucumber/formatter/cucumber.sass @@ -73,6 +73,16 @@ body ul.features li :display inline + + .step_name + :float left + + .step_file + :text-align right + :color #999999 + a + :color #999999 + .tag :font-weight bold diff --git a/lib/cucumber/formatter/html.rb b/lib/cucumber/formatter/html.rb index 2fcf292da3..0107b293f5 100644 --- a/lib/cucumber/formatter/html.rb +++ b/lib/cucumber/formatter/html.rb @@ -415,11 +415,24 @@ def get_step_count(features) def build_step(keyword, step_match, status) step_name = step_match.format_args(lambda{|param| %{#{param}}}) - @builder.div do |div| + @builder.div(:class => 'step_name') do |div| @builder.span(keyword, :class => 'keyword') @builder.text!(' ') @builder.span(:class => 'step val') do |name| name << h(step_name).gsub(/<span class="(.*?)">/, '').gsub(/<\/span>/, '') + end + end + + step_file = step_match.file_colon_line + step_file.gsub(/^([^:]*\.rb):(\d*)/) do + if ENV['TM_PROJECT_DIRECTORY'] + step_file = "#{$1}:#{$2} " + end + end + + @builder.div(:class => 'step_file') do |div| + @builder.span do + @builder << step_file end end end