Class: Screenshot
- Inherits:
-
Object
- Object
- Screenshot
- Defined in:
- lib/flick/screenshot.rb
Instance Attribute Summary collapse
-
#driver ⇒ Object
Returns the value of attribute driver.
-
#platform ⇒ Object
Returns the value of attribute platform.
Instance Method Summary collapse
-
#initialize(options) ⇒ Screenshot
constructor
A new instance of Screenshot.
- #screenshot ⇒ Object
Constructor Details
#initialize(options) ⇒ Screenshot
Returns a new instance of Screenshot.
5 6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/flick/screenshot.rb', line 5 def initialize Flick::Checker.platform [:platform] self.platform = [:platform] case @platform when "ios" [:todir] = [:outdir] self.driver = Flick::Ios.new when "android" self.driver = Flick::Android.new end setup end |
Instance Attribute Details
#driver ⇒ Object
Returns the value of attribute driver.
3 4 5 |
# File 'lib/flick/screenshot.rb', line 3 def driver @driver end |
#platform ⇒ Object
Returns the value of attribute platform.
3 4 5 |
# File 'lib/flick/screenshot.rb', line 3 def platform @platform end |
Instance Method Details
#screenshot ⇒ Object
18 19 20 21 22 |
# File 'lib/flick/screenshot.rb', line 18 def screenshot puts "Saving to #{driver.outdir}/#{driver.name}.png" driver.screenshot driver.name driver.pull_file "#{driver.dir_name}/#{driver.name}.png", driver.outdir if android end |