| Class | SeleniumOnRails::TestBuilder |
| In: |
lib/selenium_on_rails/test_builder.rb
|
| Parent: | Object |
Builds Selenium test table using a high-level Ruby interface. Normally invoked through SeleniumOnRails::RSelenese.
See SeleniumOnRails::TestBuilderActions for the available actions and SeleniumOnRails::TestBuilderAccessors for the available checks.
For more information on the commands supported by TestBuilder, see the Selenium Commands Documentation at release.openqa.org/selenium-core/nightly/reference.html.
Create a new TestBuilder for view.
# File lib/selenium_on_rails/test_builder.rb, line 47
47: def initialize view
48: @view = view
49: @output = ''
50: @xml = Builder::XmlMarkup.new :indent => 2, :target => @output
51: end
Prepends pattern with ‘exact:’ if it would be considered containing string-match pattern otherwise.
# File lib/selenium_on_rails/test_builder.rb, line 42
42: def exactize pattern
43: pattern.include?(':') ? "exact:#{pattern}" : pattern
44: end
Re routes commands in the provided block to command_and_wait instead of command.
# File lib/selenium_on_rails/test_builder.rb, line 79
79: def make_command_waiting
80: self.class.send :alias_method, :command, :command_and_wait
81: yield
82: self.class.send :alias_method, :command, :command_verbatim
83: end
If arg is an array formats arg to a textual representation. Otherwise return unchanged.
# File lib/selenium_on_rails/test_builder.rb, line 95
95: def collection_arg arg
96: if arg.is_a? Array
97: arg.collect {|e| e.gsub(/[\\,]/) {|s| "\\#{s}" } }.join(',')
98: else
99: arg
100: end
101: end