Sha256: 2ee1bcf8efcdd749d5e2d9a26be6a0197d41a90e345d4e5299c9e9d8ea3c4671

Contents?: true

Size: 1.56 KB

Versions: 77

Compression:

Stored size: 1.56 KB

Contents

require 'cucumber/formatter/html.rb'
module Cucumber
  module Formatter
    class Html
      TEAM_NAME = 'BBC Frameworks'
      def before_features(features)
        @project_name = ENV['PROJECT_NAME'] || ''
        unless @project_name.empty? then @project_name += ' - ' end

        @step_count = get_step_count(features)

        # <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
        @builder.declare!(
          :DOCTYPE,
          :html,
          :PUBLIC,
          '-//W3C//DTD XHTML 1.0 Strict//EN',
          'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'
        )

        @builder << '<html xmlns ="http://www.w3.org/1999/xhtml">'
        @builder.head do
          @builder.meta(:content => 'text/html;charset=utf-8')
          @builder.title 'Cucumber'
          inline_css
          inline_js
        end
        @builder << '<body>'
        @builder << "<!-- Step count #{@step_count}-->"
        @builder << '<div class="cucumber">'
        @builder.div(:id => 'cucumber-header') do
          @builder.div(:id => 'label') do
            @builder.h1("#{@project_name}#{TEAM_NAME} - #{Time.now.strftime('%d/%m/%y-%H:%M:%S')}")
          end
          @builder.div(:id => 'summary') do
            @builder.p('',:id => 'totals')
            @builder.p('',:id => 'duration')
            @builder.div(:id => 'expand-collapse') do
              @builder.p('Expand All', :id => 'expander')
              @builder.p('Collapse All', :id => 'collapser')
            end
          end
        end
      end
    end
  end
end

Version data entries

77 entries across 77 versions & 1 rubygems

Version Path
frameworks-capybara-0.2.24 lib/monkey-patches/cucumber-patches.rb
frameworks-capybara-0.2.23 lib/monkey-patches/cucumber-patches.rb
frameworks-capybara-0.2.22 lib/monkey-patches/cucumber-patches.rb
frameworks-capybara-0.2.21 lib/monkey-patches/cucumber-patches.rb
frameworks-capybara-0.2.20 lib/monkey-patches/cucumber-patches.rb
frameworks-capybara-0.2.19 lib/monkey-patches/cucumber-patches.rb
frameworks-capybara-0.2.18 lib/monkey-patches/cucumber-patches.rb
frameworks-capybara-0.2.17 lib/monkey-patches/cucumber-patches.rb
frameworks-capybara-0.3.0.rc5 lib/monkey-patches/cucumber-patches.rb
frameworks-capybara-0.3.0.rc4 lib/monkey-patches/cucumber-patches.rb
frameworks-capybara-0.3.0.rc3 lib/monkey-patches/cucumber-patches.rb
frameworks-capybara-0.3.0.rc2 lib/monkey-patches/cucumber-patches.rb
frameworks-capybara-0.2.16 lib/monkey-patches/cucumber-patches.rb
frameworks-capybara-0.2.15 lib/monkey-patches/cucumber-patches.rb
frameworks-capybara-0.2.14 lib/monkey-patches/cucumber-patches.rb
frameworks-capybara-0.2.13 lib/monkey-patches/cucumber-patches.rb
frameworks-capybara-0.2.12 lib/monkey-patches/cucumber-patches.rb
frameworks-capybara-0.2.11 lib/monkey-patches/cucumber-patches.rb
frameworks-capybara-0.2.10 lib/monkey-patches/cucumber-patches.rb
frameworks-capybara-0.2.9 lib/monkey-patches/cucumber-patches.rb