Class: Maximus::Wraith
- Defined in:
- lib/maximus/statistics/wraith.rb
Overview
Generates screenshots for visual regression testing
Instance Attribute Summary
Attributes inherited from Statistic
Instance Method Summary collapse
-
#result ⇒ Object
Runs Wraith through command line WARNING: If you call this class from a script, you should delete the images generated after they’ve been created.
Methods inherited from Statistic
Methods included from Helper
#discover_path, #edit_yaml, #file_count, #file_list, #is_middleman?, #is_rails?, #node_module_exists, #path_exists?, #prompt, #reporter_path, #root_dir, #truthy?
Constructor Details
This class inherits a constructor from Maximus::Statistic
Instance Method Details
#result ⇒ Object
Runs Wraith through command line WARNING: If you call this class from a script,
you should delete the images generated after they've been
created.
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/maximus/statistics/wraith.rb', line 21 def result return if @settings[:wraith].blank? node_module_exists('phantomjs', 'brew install') puts 'Starting visual regression tests with wraith...'.color(:blue) # Run history or latest depending on the existence of a history directory as defined # in each wraith config file. # @yieldparam browser [String] headless browser name # @yieldparam configpath [String] path to temp config file (see Config#wraith_setup) @settings[:wraith].each { |browser, configpath| wraith_report(browser, configpath) } @output end |