mirror of
https://github.com/TracksApp/tracks.git
synced 2025-12-17 07:40:12 +01:00
Update selenium on rails using 'official' git repo
git://github.com/paytonrules/selenium-on-rails.git
This commit is contained in:
parent
198f3240b8
commit
9b504b3e47
159 changed files with 16409 additions and 11794 deletions
|
|
@ -1,16 +1,18 @@
|
|||
require 'selenium_on_rails/partials_support'
|
||||
|
||||
class SeleniumOnRails::Selenese
|
||||
end
|
||||
ActionView::Template.register_template_handler 'sel', SeleniumOnRails::Selenese
|
||||
|
||||
|
||||
class SeleniumOnRails::Selenese
|
||||
class SeleniumOnRails::Selenese
|
||||
def initialize view
|
||||
@view = view
|
||||
end
|
||||
|
||||
def render template
|
||||
name = @view.assigns['page_title']
|
||||
lines = template.strip.split "\n"
|
||||
def render template, local_assigns = {}
|
||||
name = (@view.assigns['page_title'] or local_assigns['page_title'])
|
||||
lines = template.source.strip.split "\n"
|
||||
html = ''
|
||||
html << extract_comments(lines)
|
||||
html << extract_commands(lines, name)
|
||||
|
|
@ -19,10 +21,6 @@ class SeleniumOnRails::Selenese
|
|||
html
|
||||
end
|
||||
|
||||
def compilable?
|
||||
false
|
||||
end
|
||||
|
||||
private
|
||||
def next_line lines, expects
|
||||
while lines.any?
|
||||
|
|
@ -36,6 +34,10 @@ class SeleniumOnRails::Selenese
|
|||
return l
|
||||
end
|
||||
end
|
||||
|
||||
def self.call(template)
|
||||
"#{name}.new(self).render(template, local_assigns)"
|
||||
end
|
||||
|
||||
def extract_comments lines
|
||||
comments = ''
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue