Module: Applitools::Selenium::ScriptTemplates
- Extended by:
- ScriptTemplates
- Included in:
- ScriptTemplates
- Defined in:
- lib/applitools/selenium/scripts/templates.rb
Instance Method Summary collapse
Instance Method Details
#get_script_by_file_name(fname) ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/applitools/selenium/scripts/templates.rb', line 5 def get_script_by_file_name(fname) script = nil return script unless Dir.exist?(Applitools::JS_PATH) begin Dir.chdir(Applitools::JS_PATH) do script = File.open(File.join('@applitools', 'dom-snapshot', 'dist', "#{fname}.js"), 'r').read end rescue StandardError => e puts e.class puts e. script = '' end script end |