Class: ClickSession::WebRunner
- Inherits:
-
Object
- Object
- ClickSession::WebRunner
- Includes:
- Capybara::DSL
- Defined in:
- lib/click_session/web_runner.rb
Instance Attribute Summary collapse
-
#processor ⇒ Object
readonly
Returns the value of attribute processor.
Instance Method Summary collapse
-
#initialize(processor) ⇒ WebRunner
constructor
A new instance of WebRunner.
- #point_of_no_return ⇒ Object
- #reset ⇒ Object
- #run(model) ⇒ Object
- #save_screenshot(file_name_identity = "") ⇒ Object
Constructor Details
#initialize(processor) ⇒ WebRunner
Returns a new instance of WebRunner.
14 15 16 17 18 19 20 |
# File 'lib/click_session/web_runner.rb', line 14 def initialize(processor) Capybara.default_driver = ClickSession.configuration.driver_client Capybara.javascript_driver = ClickSession.configuration.driver_client Capybara.run_server = false page = Capybara::Session.new(ClickSession.configuration.driver_client) @processor = processor end |
Instance Attribute Details
#processor ⇒ Object (readonly)
Returns the value of attribute processor.
12 13 14 |
# File 'lib/click_session/web_runner.rb', line 12 def processor @processor end |
Instance Method Details
#point_of_no_return ⇒ Object
37 38 39 |
# File 'lib/click_session/web_runner.rb', line 37 def point_of_no_return processor.stop_processing end |
#reset ⇒ Object
26 27 28 |
# File 'lib/click_session/web_runner.rb', line 26 def reset end |
#run(model) ⇒ Object
22 23 24 |
# File 'lib/click_session/web_runner.rb', line 22 def run(model) raise NotImplementedError("You need to override the #steps method by sub classing WebRunner") end |
#save_screenshot(file_name_identity = "") ⇒ Object
30 31 32 33 34 35 |
# File 'lib/click_session/web_runner.rb', line 30 def save_screenshot(file_name_identity = "") @file_name = build_file_name_for(file_name_identity) page.save_screenshot(screenshot_save_path, full: true) S3FileUploader.new.upload_file(@file_name) end |