Class: Rubidium::TestCase
- Inherits:
-
Object
- Object
- Rubidium::TestCase
- Defined in:
- lib/rubidium/test_case.rb
Instance Attribute Summary collapse
-
#base_url ⇒ Object
readonly
Returns the value of attribute base_url.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#selenese ⇒ Object
(also: #table)
readonly
Returns the value of attribute selenese.
-
#title ⇒ Object
(also: #name)
readonly
Returns the value of attribute title.
Instance Method Summary collapse
- #commands ⇒ Object
-
#initialize(path) ⇒ TestCase
constructor
A new instance of TestCase.
- #ruby ⇒ Object
Constructor Details
#initialize(path) ⇒ TestCase
Returns a new instance of TestCase.
7 8 9 10 11 12 13 14 15 |
# File 'lib/rubidium/test_case.rb', line 7 def initialize(path) @path = path x = Nokogiri::HTML(File.read(path)) @title = x.xpath('//title').first.text @base_url = x.xpath('//link').attr('href').value @selenese = x.xpath('//tbody/tr').map do |tr| tr.search('td').map(&:text).reject { |txt| txt == "" } end end |
Instance Attribute Details
#base_url ⇒ Object (readonly)
Returns the value of attribute base_url.
3 4 5 |
# File 'lib/rubidium/test_case.rb', line 3 def base_url @base_url end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
3 4 5 |
# File 'lib/rubidium/test_case.rb', line 3 def path @path end |
#selenese ⇒ Object (readonly) Also known as: table
Returns the value of attribute selenese.
3 4 5 |
# File 'lib/rubidium/test_case.rb', line 3 def selenese @selenese end |
#title ⇒ Object (readonly) Also known as: name
Returns the value of attribute title.
3 4 5 |
# File 'lib/rubidium/test_case.rb', line 3 def title @title end |
Instance Method Details
#commands ⇒ Object
21 22 23 |
# File 'lib/rubidium/test_case.rb', line 21 def commands Translator.translate(selenese) end |
#ruby ⇒ Object
17 18 19 |
# File 'lib/rubidium/test_case.rb', line 17 def ruby Translator.translate(selenese) end |