Sha256: 4fdbba886c093944c6a8bfec2bf25391cf1446ecd75115db544324933ecbd7d0

Contents?: true

Size: 1.73 KB

Versions: 12

Compression:

Stored size: 1.73 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

        if Cucumber::Ast::Feature.method_defined?(:step_count)
          @step_count = features.step_count # cucumber >=1.3.0
        else
          @step_count = get_step_count(features) # cucumber <1.3.0
        end

        # <!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

12 entries across 12 versions & 1 rubygems

Version Path
frameworks-capybara-1.1.1 lib/monkey-patches/cucumber-patches.rb
frameworks-capybara-1.1.0 lib/monkey-patches/cucumber-patches.rb
frameworks-capybara-1.0.0 lib/monkey-patches/cucumber-patches.rb
frameworks-capybara-0.2.34 lib/monkey-patches/cucumber-patches.rb
frameworks-capybara-0.2.33 lib/monkey-patches/cucumber-patches.rb
frameworks-capybara-0.2.32 lib/monkey-patches/cucumber-patches.rb
frameworks-capybara-0.2.31 lib/monkey-patches/cucumber-patches.rb
frameworks-capybara-0.2.30 lib/monkey-patches/cucumber-patches.rb
frameworks-capybara-0.2.29 lib/monkey-patches/cucumber-patches.rb
frameworks-capybara-0.2.28 lib/monkey-patches/cucumber-patches.rb
frameworks-capybara-0.2.27 lib/monkey-patches/cucumber-patches.rb
frameworks-capybara-0.2.25 lib/monkey-patches/cucumber-patches.rb