Skip to content

Commit

Permalink
Merge pull request cucumber#182 from niklas/master
Browse files Browse the repository at this point in the history
HTML Formatter should have collapsible backgrounds
  • Loading branch information
mattwynne committed Mar 3, 2012
2 parents f44e5f6 + 6000471 commit f11e934
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
8 changes: 7 additions & 1 deletion lib/cucumber/formatter/cucumber.css
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,20 @@ body {
float: right;
margin: 0 0 0 10px;
}
.cucumber .scenario h3, td .scenario h3, th .scenario h3 {
.cucumber .scenario h3, td .scenario h3, th .scenario h3, .background h3 {
font-size: 11px;
padding: 3px;
margin: 0;
background: #65c400;
color: white;
font-weight: bold;
}

.background h3 {
font-size: 1.2em;
background: #666;
}

.cucumber h1, td h1, th h1 {
margin: 0px 10px 0px 10px;
padding: 10px;
Expand Down
4 changes: 2 additions & 2 deletions lib/cucumber/formatter/html.rb
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ def after_background(background)

def background_name(keyword, name, file_colon_line, source_indent)
@listing_background = true
@builder.h3 do |h3|
@builder.h3(:id => "background_#{@scenario_number}") do |h3|
@builder.span(keyword, :class => 'keyword')
@builder.text!(' ')
@builder.span(name, :class => 'val')
Expand Down Expand Up @@ -513,7 +513,7 @@ def inline_jquery
def inline_js_content
<<-EOF
SCENARIOS = "h3[id^='scenario_']";
SCENARIOS = "h3[id^='scenario_'],h3[id^=background_]";
$(document).ready(function() {
$(SCENARIOS).css('cursor', 'pointer');
Expand Down

0 comments on commit f11e934

Please sign in to comment.