Class | SeleniumOnRails::RSelenese
In: | lib/selenium_on_rails/rselenese.rb
Parent: | SeleniumOnRails::TestBuilder

Renders Selenium test templates in a fashion analogous to `rxml` and `rjs` templates.

      setup
      open :controller => 'customer', :action => 'list'
      assert_title 'Customers'

See SeleniumOnRails::TestBuilder for a list of available commands.

### Methods

new render

### Attributes

view | [RW] |

### Public Class methods

new(view)

Create a new RSelenese renderer bound to view.

[Source]

        # File lib/selenium_on_rails/rselenese.rb, line 17
    17:   def initialize view
    18:     super view
    19:     @view = view
    20:   end

### Public Instance methods

render(template, local_assigns)

Render template using local_assigns.

[Source]

        # File lib/selenium_on_rails/rselenese.rb, line 23
    23:   def render template, local_assigns
    24:     title = (@view.assigns['page_title'] or local_assigns['page_title'])
    25:     table(title) do
    26:       test = self #to enable test.command

    27:
    28:       assign_locals_code = ''
    29:       local_assigns.each_key {|key| assign_locals_code << "#{key} = local_assigns[#{key.inspect}];"}
    30:
    31:       eval assign_locals_code + "\n" + template
    32:     end
    33:   end

[Validate]