Class: RainforestRubyRuntime::Drivers::Selenium
- Inherits:
-
Object
- Object
- RainforestRubyRuntime::Drivers::Selenium
- Defined in:
- lib/rainforest_ruby_runtime/drivers/selenium.rb
Instance Attribute Summary collapse
-
#browsers ⇒ Object
readonly
Returns the value of attribute browsers.
Instance Method Summary collapse
-
#initialize(options) ⇒ Selenium
constructor
A new instance of Selenium.
- #to_rspec(tests) ⇒ Object
Constructor Details
#initialize(options) ⇒ Selenium
Returns a new instance of Selenium.
6 7 8 |
# File 'lib/rainforest_ruby_runtime/drivers/selenium.rb', line 6 def initialize() @browsers = [:browsers] end |
Instance Attribute Details
#browsers ⇒ Object (readonly)
Returns the value of attribute browsers.
4 5 6 |
# File 'lib/rainforest_ruby_runtime/drivers/selenium.rb', line 4 def browsers @browsers end |
Instance Method Details
#to_rspec(tests) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/rainforest_ruby_runtime/drivers/selenium.rb', line 10 def to_rspec(tests) RSpec.describe 'Rainforest', tests: tests, browsers: browsers do [:tests].each do |test| describe "[#{test.id}] #{test.title}" do [:browsers].each do |browser| let(:current_driver) { .current_session.driver } after do if current_driver.respond_to?(:finish!) current_driver.finish! elsif current_driver.respond_to?(:quit) current_driver.quit end end specify browser do # for whatever reason, this line no longer works if put in a `before` block current_driver.[:browser] = browser test.run end end end end end end |